diff --git a/CMakeLists.txt b/CMakeLists.txt index 42c349ac45417621e7fd7b0850d70bc3936cd527..5c4564d89cdd1b892879a3e7677f9b599bdd386a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,12 @@ if(insource) message(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../") endif(insource) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/) set(SCALFMM_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules) +include(GetCpuInfos) +GetCpuInfos() + # Adds the CMAKE_DEPENDENT_OPTION command INCLUDE(CMakeDependentOption) @@ -65,9 +69,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/") option( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF ) option( SCALFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF ) option( SCALFMM_USE_ADDONS "Set to ON to compile add ons" OFF ) - option( SCALFMM_USE_SSE "Set to ON to compile with SSE support (and use intrinsec SSE P2P)" ON ) - option( SCALFMM_USE_AVX "Set to ON to compile with AVX support (and use intrinsec AVX P2P)" OFF ) - option( SCALFMM_USE_AVX2 "Set to ON to compile with AVX support (and use intrinsec AVXZ P2P)" OFF ) + CMAKE_DEPENDENT_OPTION( SCALFMM_USE_SSE "Set to ON to compile with SSE support (and use intrinsec SSE P2P)" ON "CPUOPTION_SSE3;NOT CPUOPTION_AVX;NOT CPUOPTION_AVX2" OFF ) + CMAKE_DEPENDENT_OPTION( SCALFMM_USE_AVX "Set to ON to compile with AVX support (and use intrinsec AVX P2P)" ON "CPUOPTION_AVX; NOT CPUOPTION_AVX2" OFF ) + CMAKE_DEPENDENT_OPTION( SCALFMM_USE_AVX2 "Set to ON to compile with AVX support (and use intrinsec AVXZ P2P)" ON "CPUOPTION_AVX2" OFF ) option( SCALFMM_USE_ASSERT "Set to ON to enable safe tests during execution" ON ) option( SCALFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF ) option( SCALFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" ON ) diff --git a/CMakeModules/GetCpuInfos.cmake b/CMakeModules/GetCpuInfos.cmake index 6c2d618b79f542f211064cae0b95ac3eb8570cb2..e6fd0611e7fb064341681745a0ab64d9a6495702 100644 --- a/CMakeModules/GetCpuInfos.cmake +++ b/CMakeModules/GetCpuInfos.cmake @@ -12,7 +12,7 @@ ########################################################################################### macro(GetCpuInfos) # The original CPP file -set(GetCpuInfosFile "${PROJECT_SOURCE_DIR}/SparseTd/CMake/getCpuInfos.cpp") +set(GetCpuInfosFile "${PROJECT_SOURCE_DIR}/CMakeModules/getCpuInfos.cpp") # Fatal error if the file does not exist if(NOT EXISTS ${GetCpuInfosFile})