Commit f8e0545e authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Fix SSE choices on MacOs X

Improvement of Ressources.cmake for Mac
parent 3b54fc6c
......@@ -12,8 +12,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# Project Declaration
#===========================================================================
project(SCALFMM C CXX)
# Adds the CMAKE_DEPENDENT_OPTION command
INCLUDE( CMakeDependentOption )
# check if compiling into source directories
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
if(insource)
......@@ -22,13 +21,13 @@ endif(insource)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/)
set(SCALFMM_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
#
# Adds the CMAKE_DEPENDENT_OPTION command
INCLUDE(CMakeDependentOption)
# Add to check CPU info
include(GetCpuInfos)
GetCpuInfos()
# Adds the CMAKE_DEPENDENT_OPTION command
#INCLUDE(CMakeDependentOption)
#===========================================================================
# Version Number
#===========================================================================
......@@ -54,7 +53,6 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
set(MORSE_CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/morse )
endif()
include(MorseInit)
#
# Options
option( SCALFMM_USE_MPI "Set to ON to build ScaFMM with MPI" OFF )
......@@ -130,7 +128,11 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# INTEL
IF (APPLE)
IF( CPUOPTION_SSE42 )
set(SSE_FLAGS "-msse4 -mfpmath=sse") # -mtune=native -march=native
ELSEIF (CPUOPTION_SSE3)
set(SSE_FLAGS "-msse3 -mfpmath=sse") # -mtune=native -march=native
ENDIF (CPUOPTION_SSE42)
else(APPLE)
set(AVX_FLAGS "-march=native -axCORE-AVX2,CORE-AVX-I,AVX") #-mavx
set(AVX2_FLAGS "-march=native -axCORE-AVX2,CORE-AVX-I") #-march=core-avx2
......@@ -153,8 +155,12 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
endif()
endif()
IF (APPLE)
# set(SSE_FLAGS "-msse4 -mfpmath=sse") # -mtune=native -march=native
set(SSE_FLAGS "-msse3 -mfpmath=sse")
# set(SSE_FLAGS "-msse4 -mfpmath=sse") # -mtune=native -march=native
IF( CPUOPTION_SSE42 )
set(SSE_FLAGS "-msse4 -mfpmath=sse") # -mtune=native -march=native
ELSEIF (CPUOPTION_SSE3)
set(SSE_FLAGS "-msse3 -mfpmath=sse") # -mtune=native -march=native
ENDIF (CPUOPTION_SSE42)
set(AVX_FLAGS "-mtune=native -march=avx")
set(AVX2_FLAGS "-mtune=native -march=native -mmic")
else(APPLE)
......@@ -289,7 +295,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
if( SCALFMM_USE_MKL_AS_BLAS )
set(BLA_VENDOR "Intel10_64lp_seq")
find_package(BLASEXT) # not REQUIRED
find_package(BLASEXT QUIET) # not REQUIRED
if(BLAS_LIBRARY_DIRS)
# the RPATH to be used when installing
......@@ -647,8 +653,12 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
if(PKG_CONFIG_FOUND)
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH "ON")
pkg_search_module( EZTrace REQUIRED eztrace)
if(PEZTrace_FOUND)
link_directories(${EZTrace_LIBRARY_DIRS})
link_libraries( ${EZTrace_LIBRARIES} -leztrace-mpi)
link_libraries( ${EZTrace_LIBRARIES})
IF( SCALFMM_USE_MPI )
link_libraries(-leztrace-mpi)
ENDIF(SCALFMM_USE_MPI)
include_directories(${EZTrace_INCLUDE_DIRS})
MESSAGE(STATUS "EZTRACE: ${EZTrace_INCLUDE_DIRS} ${EZTrace_LIBRARY_DIRS} ${EZTrace_LIBRARIES}")
CMAKE_DEPENDENT_OPTION(SCALFMM_TRACE_ALGO "Set to ON to trace the full algorithm (all operators)" ON "SCALFMM_USE_EZTRACE" OFF )
......@@ -657,9 +667,12 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
CMAKE_DEPENDENT_OPTION(SCALFMM_TRACE_M2L "Set to ON to trace M2L operator" OFF "SCALFMM_USE_EZTRACE" OFF )
CMAKE_DEPENDENT_OPTION(SCALFMM_TRACE_L2L "Set to ON to trace L2L operator" OFF "SCALFMM_USE_EZTRACE" OFF )
CMAKE_DEPENDENT_OPTION(SCALFMM_TRACE_P2P "Set to ON to trace P2P operator" OFF "SCALFMM_USE_EZTRACE" OFF )
else(EZTrace_FOUND)
MESSAGE(WARNING "Eztrace not found - EZTRACE Is set to OFF")
set(SCALFMM_USE_EZTRACE OFF)
endif(EZTrace_FOUND)
else(PKG_CONFIG_FOUND)
MESSAGE(WARNING "PKG-CONFIG not found- EZTRACE Is set to NONE")
MESSAGE(WARNING "PKG-CONFIG not found - EZTRACE Is set to OFF")
set(SCALFMM_USE_EZTRACE OFF)
endif(PKG_CONFIG_FOUND)
......@@ -825,7 +838,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
message(STATUS "SCALFMM_USE_BLAS = ${SCALFMM_USE_BLAS}")
message(STATUS "SCALFMM_USE_FFT = ${SCALFMM_USE_FFT}")
message(STATUS "SCALFMM_USE_MKL = ${SCALFMM_USE_MKL}")
#
#
message(STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
message(STATUS "SCALFMM_CXX_FLAGS = ${SCALFMM_CXX_FLAGS}")
message(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
......
......@@ -43,8 +43,8 @@ if(NOT DEFINED PROCESSOR_COUNT)
if(APPLE)
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
execute_process(COMMAND ${cmd_sys_pro} SPHardwareDataType OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number of Cores: ([0-9]+).*$" "\\1"
NUMBER_OF_CPU "${info}")
endif()
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment