diff --git a/CMakeLists.txt b/CMakeLists.txt index 17ecd971..01fe15cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ option(qt_based_tools "try to install Qt based tools (musredit, musrWiz, musrSte option(try_OpenMP "try to use OpenMP if available" ON) #--- perform some checks and generate the config.h ---------------------------- +include(CheckTypeSize) include(CheckIncludeFiles) include(CheckFunctionExists) check_include_files(alloca.h HAVE_ALLOCA_H) @@ -31,6 +32,12 @@ check_include_files(strings.h HAVE_STRINGS_H) check_include_files(sys/stat.h HAVE_SYS_STAT_H) check_include_files(sys/types.h HAVE_SYS_TYPES_H) check_include_files(sys/unistd.h HAVE_UNISTD_H) +check_type_size("long double" LONG_DOUBLE) +check_type_size("double" DOUBLE) +if (${LONG_DOUBLE} GREATER ${DOUBLE}) + set(HAVE_LONG_DOUBLE 1) + set(HAVE_LONG_DOUBLE_WIDER 1) +endif (${LONG_DOUBLE} GREATER ${DOUBLE}) #--- check for all the needed packages ---------------------------------------- diff --git a/cmake/config.h.in b/cmake/config.h.in index 5e85b16d..365a361c 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -23,6 +23,12 @@ // Define to 1 if you have the header file. #cmakedefine HAVE_INTTYPES_H 1 +// Define to 1 if the type `long double' works and has more range or precision than `double'. +#cmakedefine HAVE_LONG_DOUBLE 1 + +// Define to 1 if the type `long double' works and has more range or precision than `double'. +#cmakedefine HAVE_LONG_DOUBLE_WIDER 1 + // Define to 1 if fftw3f_threads are available #cmakedefine HAVE_LIBFFTW3F_THREADS 1 diff --git a/src/external/libCuba/src/cuhre/CMakeLists.txt b/src/external/libCuba/src/cuhre/CMakeLists.txt index 21bae662..999b74cf 100644 --- a/src/external/libCuba/src/cuhre/CMakeLists.txt +++ b/src/external/libCuba/src/cuhre/CMakeLists.txt @@ -1,29 +1,22 @@ #--- cuhre -------------------------------------------------------------------- #--- obj lib creation --------------------------------------------------------- -add_library(cuhre OBJECT +add_library(cuhre OBJECT Cuhre.c ) #--- make sure that the include directory is found ---------------------------- target_include_directories( cuhre BEFORE PRIVATE + $ $ $ $ ) #--- check for pre compile flags ---------------------------------------------- -set(COMP_DEF "") -if (HAVE_FORK) - set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK") -endif (HAVE_FORK) -if (HAVE_ALLOCA_H) - set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H") -endif (HAVE_ALLOCA_H) -if (HAVE_SHMGET) - set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET") -endif (HAVE_SHMGET) +set(COMP_DEF "-DHAVE_CONFIG_H") +set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE") target_compile_definitions( cuhre PRIVATE ${COMP_DEF} diff --git a/src/external/libCuba/src/divonne/CMakeLists.txt b/src/external/libCuba/src/divonne/CMakeLists.txt index 0a0ce00a..b94089e4 100644 --- a/src/external/libCuba/src/divonne/CMakeLists.txt +++ b/src/external/libCuba/src/divonne/CMakeLists.txt @@ -8,22 +8,15 @@ add_library(divonne OBJECT #--- make sure that the include directory is found ---------------------------- target_include_directories( divonne BEFORE PRIVATE + $ $ $ $ ) #--- check for pre compile flags ---------------------------------------------- -set(COMP_DEF "") -if (HAVE_FORK) - set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK") -endif (HAVE_FORK) -if (HAVE_ALLOCA_H) - set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H") -endif (HAVE_ALLOCA_H) -if (HAVE_SHMGET) - set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET") -endif (HAVE_SHMGET) +set(COMP_DEF "-DHAVE_CONFIG_H") +set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE") target_compile_definitions( divonne PRIVATE ${COMP_DEF} diff --git a/src/external/libCuba/src/suave/CMakeLists.txt b/src/external/libCuba/src/suave/CMakeLists.txt index b4417c15..c4ebdc24 100644 --- a/src/external/libCuba/src/suave/CMakeLists.txt +++ b/src/external/libCuba/src/suave/CMakeLists.txt @@ -8,22 +8,15 @@ add_library(suave OBJECT #--- make sure that the include directory is found ---------------------------- target_include_directories( suave BEFORE PRIVATE + $ $ $ $ ) #--- check for pre compile flags ---------------------------------------------- -set(COMP_DEF "") -if (HAVE_FORK) - set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK") -endif (HAVE_FORK) -if (HAVE_ALLOCA_H) - set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H") -endif (HAVE_ALLOCA_H) -if (HAVE_SHMGET) - set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET") -endif (HAVE_SHMGET) +set(COMP_DEF "-DHAVE_CONFIG_H") +set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE") target_compile_definitions( suave PRIVATE ${COMP_DEF} diff --git a/src/external/libCuba/src/vegas/CMakeLists.txt b/src/external/libCuba/src/vegas/CMakeLists.txt index 8ceb2d9b..f4635a3a 100644 --- a/src/external/libCuba/src/vegas/CMakeLists.txt +++ b/src/external/libCuba/src/vegas/CMakeLists.txt @@ -8,22 +8,15 @@ add_library(vegas OBJECT #--- make sure that the include directory is found ---------------------------- target_include_directories( vegas BEFORE PRIVATE + $ $ $ $ ) #--- check for pre compile flags ---------------------------------------------- -set(COMP_DEF "") -if (HAVE_FORK) - set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK") -endif (HAVE_FORK) -if (HAVE_ALLOCA_H) - set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H") -endif (HAVE_ALLOCA_H) -if (HAVE_SHMGET) - set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET") -endif (HAVE_SHMGET) +set(COMP_DEF "-DHAVE_CONFIG_H") +set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE") target_compile_definitions( vegas PRIVATE ${COMP_DEF}