Merge branch 'master' of ssh://bitbucket.org/glavaux/cosmotool
This commit is contained in:
commit
0a412e0ec3
@ -12,6 +12,7 @@ get_git_head_revision(HEAD GIT_VER)
|
|||||||
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
|
||||||
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
option(BUILD_STATIC_LIBS "Build static libraries." ON)
|
||||||
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
|
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
|
||||||
|
option(ENABLE_SHARP "Enable SPHT support." ON)
|
||||||
|
|
||||||
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
|
||||||
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
|
find_path(NETCDFCPP_INCLUDE_PATH NAMES netcdfcpp.h netcdf)
|
||||||
@ -30,6 +31,7 @@ find_library(NETCDFCPP_LIBRARY NAMES netcdf_c++ netcdf_c++4)
|
|||||||
find_library(GSL_LIBRARY gsl)
|
find_library(GSL_LIBRARY gsl)
|
||||||
find_library(GSLCBLAS_LIBRARY gslcblas)
|
find_library(GSLCBLAS_LIBRARY gslcblas)
|
||||||
|
|
||||||
|
if (ENABLE_SHARP)
|
||||||
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
|
SET(SHARP_SOURCE ${CMAKE_SOURCE_DIR}/external/sharp)
|
||||||
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
|
SET(DEP_BUILD ${CMAKE_SOURCE_DIR}/external/sharp/auto)
|
||||||
ExternalProject_Add(sharp
|
ExternalProject_Add(sharp
|
||||||
@ -39,12 +41,13 @@ ExternalProject_Add(sharp
|
|||||||
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
|
||||||
INSTALL_COMMAND echo "No install"
|
INSTALL_COMMAND echo "No install"
|
||||||
)
|
)
|
||||||
|
|
||||||
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(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_LIBRARIES ${SHARP_LIBRARY} ${FFTPACK_LIBRARY} ${CUTILS_LIBRARY})
|
||||||
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
|
SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include)
|
||||||
|
endif (ENABLE_SHARP)
|
||||||
|
|
||||||
|
|
||||||
set(HDF5_FIND_COMPONENTS HL CXX)
|
set(HDF5_FIND_COMPONENTS HL CXX)
|
||||||
if(HDF5_ROOTDIR)
|
if(HDF5_ROOTDIR)
|
||||||
|
@ -52,13 +52,13 @@ if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
|
|||||||
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
|
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES})
|
||||||
endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND)
|
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})
|
include_directories(${SHARP_INCLUDE_PATH})
|
||||||
add_executable(test_healpix_calls test_healpix_calls.cpp)
|
add_executable(test_healpix_calls test_healpix_calls.cpp)
|
||||||
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
|
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})
|
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
add_dependencies(test_healpix_calls sharp)
|
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)
|
add_executable(test_cosmopower test_cosmopower.cpp)
|
||||||
target_link_libraries(test_cosmopower ${tolink})
|
target_link_libraries(test_cosmopower ${tolink})
|
||||||
|
@ -87,7 +87,7 @@ namespace CosmoTool
|
|||||||
HealpixSpectrum<T> *new_spectrum = new HealpixSpectrum<T>(in_spec.Lmax());
|
HealpixSpectrum<T> *new_spectrum = new HealpixSpectrum<T>(in_spec.Lmax());
|
||||||
T *out_d = new_spectrum->data();
|
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);
|
return Spectrum_ptr(new_spectrum);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user