mirror of
https://github.com/cosmo-sims/MUSIC.git
synced 2024-09-19 17:03:46 +02:00
better handling of single/double precision fftw3 support
This commit is contained in:
parent
42874ec00e
commit
4c1feec117
2 changed files with 26 additions and 19 deletions
|
@ -27,12 +27,7 @@ find_package(Threads REQUIRED)
|
|||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
if( MUSIC_ENABLE_SINGLE_PRECISION )
|
||||
find_package(FFTW3 COMPONENTS SINGLE THREADS)
|
||||
else(MUSIC_ENABLE_SINGLE_PRECISION )
|
||||
find_package(FFTW3 COMPONENTS DOUBLE THREADS)
|
||||
endif(MUSIC_ENABLE_SINGLE_PRECISION)
|
||||
|
||||
find_package(FFTW3 COMPONENTS SINGLE DOUBLE THREADS)
|
||||
|
||||
########################################################################################################################
|
||||
# Add a custom command that produces version.cc, plus
|
||||
|
@ -81,18 +76,26 @@ if(FFTW3_FOUND)
|
|||
|
||||
if( MUSIC_ENABLE_SINGLE_PRECISION )
|
||||
target_compile_options(${PRGNAME} PRIVATE "-DSINGLE_PRECISION")
|
||||
if (FFTW3_SINGLE_THREADS_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_SINGLE_THREADS_LIBRARY})
|
||||
target_compile_options(${PRGNAME} PRIVATE "-DUSE_FFTW_THREADS")
|
||||
elseif(FFTW3_SINGLE_SERIAL_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_SINGLE_SERIAL_LIBRARY})
|
||||
message( WARNING "using serial version of FFTW3 -- this will most likely cause a very slow version of MUSIC. Rec: install FFTW3 with thread support")
|
||||
else()
|
||||
message( FATAL "chose compilation in single precision, but FFTW3 not found for single precision")
|
||||
endif()
|
||||
else(MUSIC_ENABLE_SINGLE_PRECISION)
|
||||
if (FFTW3_DOUBLE_THREADS_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_DOUBLE_THREADS_LIBRARY})
|
||||
target_compile_options(${PRGNAME} PRIVATE "-DUSE_FFTW_THREADS")
|
||||
elseif(FFTW3_DOUBLE_SERIAL_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_DOUBLE_SERIAL_LIBRARY})
|
||||
message( WARNING "using serial version of FFTW3 -- this will most likely cause a very slow version of MUSIC. Rec: install FFTW3 with thread support")
|
||||
else()
|
||||
message( FATAL "chose compilation in double precision, but FFTW3 not found for double precision")
|
||||
endif()
|
||||
endif(MUSIC_ENABLE_SINGLE_PRECISION)
|
||||
|
||||
if(FFTW3_DOUBLE_THREADS_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_DOUBLE_THREADS_LIBRARY})
|
||||
target_compile_options(${PRGNAME} PRIVATE "-DUSE_FFTW_THREADS")
|
||||
endif(FFTW3_DOUBLE_THREADS_FOUND)
|
||||
|
||||
if(FFTW3_SINGLE_THREADS_FOUND)
|
||||
target_link_libraries(${PRGNAME} ${FFTW3_SINGLE_THREADS_LIBRARY})
|
||||
target_compile_options(${PRGNAME} PRIVATE "-DUSE_FFTW_THREADS")
|
||||
endif(FFTW3_SINGLE_THREADS_FOUND)
|
||||
|
||||
endif(FFTW3_FOUND)
|
||||
|
||||
if(HDF5_FOUND)
|
||||
|
|
|
@ -90,9 +90,13 @@ void splash(void)
|
|||
<< " this is " << THE_CODE_NAME << " version " << THE_CODE_VERSION << "\n\n";
|
||||
|
||||
#if defined(CMAKE_BUILD)
|
||||
LOGINFO("Version built from git rev.: %s, tag: %s, branch: %s\n", GIT_REV, GIT_TAG, GIT_BRANCH);
|
||||
LOGINFO("Version built from git rev.: %s, tag: %s, branch: %s", GIT_REV, GIT_TAG, GIT_BRANCH);
|
||||
#endif
|
||||
#if defined(SINGLE_PRECISION)
|
||||
LOGINFO("Version was compiled for single precision.");
|
||||
#else
|
||||
LOGINFO("Version was compiled for double precision.");
|
||||
#endif
|
||||
|
||||
std::cout << "\n\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue