Merge branch 'master' of ssh://bitbucket.org/glavaux/cosmotool

This commit is contained in:
Guilhem Lavaux 2013-04-08 16:26:39 -04:00
commit 0a412e0ec3
3 changed files with 20 additions and 17 deletions

View File

@ -12,6 +12,7 @@ get_git_head_revision(HEAD GIT_VER)
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
option(BUILD_STATIC_LIBS "Build static libraries." ON)
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
option(ENABLE_SHARP "Enable SPHT support." ON)
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
@ -30,21 +31,23 @@ find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++ netcdf_c++4)
find_library(GSL_LIBRARY gsl)
find_library(GSLCBLAS_LIBRARY gslcblas)
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
ExternalProject_Add(sharp
if (ENABLE_SHARP)
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
ExternalProject_Add(sharp
SOURCE_DIR ${SHARP_SOURCE}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${SHARP_SOURCE}/configure --prefix=${DEP_BUILD}
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
INSTALL_COMMAND echo "No install"
)
)
SET(CUTILS_LIBRARY ${DEP_BUILD}/lib/libc_utils.a)
SET(FFTPACK_LIBRARY ${DEP_BUILD}/lib/libfftpack.a)
SET(SHARP_LIBRARY ${DEP_BUILD}/lib/libsharp.a)
SET(SHARP_LIBRARIES ${SHARP_LIBRARY} ${FFTPACK_LIBRARY} ${CUTILS_LIBRARY})
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
endif (ENABLE_SHARP)
SET(SHARP_LIBRARY ${DEP_BUILD}/lib/libsharp.a)
SET(FFTPACK_LIBRARY ${DEP_BUILD}/lib/libfftpack.a)
SET(CUTILS_LIBRARY ${DEP_BUILD}/lib/libc_utils.a)
SET(SHARP_LIBRARIES ${SHARP_LIBRARY} ${FFTPACK_LIBRARY} ${CUTILS_LIBRARY})
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
set(HDF5_FIND_COMPONENTS HL CXX)
if(HDF5_ROOTDIR)

View File

@ -52,13 +52,13 @@ if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
if (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
include_directories(${SHARP_INCLUDE_PATH})
add_executable(test_healpix_calls test_healpix_calls.cpp)
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
add_dependencies(test_healpix_calls sharp)
endif (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
endif (ENABLE_SHARP AND SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
add_executable(test_cosmopower test_cosmopower.cpp)
target_link_libraries(test_cosmopower ${tolink})

View File

@ -87,7 +87,7 @@ namespace CosmoTool
HealpixSpectrum<T> *new_spectrum = new HealpixSpectrum<T>(in_spec.Lmax());
T *out_d = new_spectrum->data();
std::copy(data, data + min(size,new_spectrum->size()), out_d);
std::copy(data, data + std::min(size,new_spectrum->size()), out_d);
return Spectrum_ptr(new_spectrum);
}