Commit 341c3c2c authored by BRAMAS Berenger's avatar BRAMAS Berenger

Add a generic way to test if a FUSE is inside a file

parent 25204605
...@@ -57,23 +57,15 @@ if(SCALFMM_ADDON_CKERNELAPI) ...@@ -57,23 +57,15 @@ if(SCALFMM_ADDON_CKERNELAPI)
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT SCALFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT SCALFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
...@@ -57,23 +57,15 @@ if(SCALFMM_ADDON_FMMAPI) ...@@ -57,23 +57,15 @@ if(SCALFMM_ADDON_FMMAPI)
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT SCALFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT SCALFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
...@@ -121,6 +121,14 @@ ELSE(APPLE) ...@@ -121,6 +121,14 @@ ELSE(APPLE)
SET(SSE_FLAGS "-mtune=native -march=native") # -mtune=native -march=native SET(SSE_FLAGS "-mtune=native -march=native") # -mtune=native -march=native
ENDIF(APPLE) ENDIF(APPLE)
endif() endif()
##############################################################################
# FUSE list #
##############################################################################
set(FUSE_LIST "")
# then do list(APPEND FUSE_LIST "BLAS") to protect from FUSE_BLAS
list(APPEND FUSE_LIST "MPI")
############################################################################## ##############################################################################
# Debug flags # # Debug flags #
############################################################################## ##############################################################################
...@@ -212,6 +220,7 @@ if( ScalFMM_USE_BLAS ) ...@@ -212,6 +220,7 @@ if( ScalFMM_USE_BLAS )
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLASLAPACK_LIBRARIES}") SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLASLAPACK_LIBRARIES}")
MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}") MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
endif(ScalFMM_USE_BLAS) endif(ScalFMM_USE_BLAS)
list(APPEND FUSE_LIST "BLAS")
# #
# FFT option # FFT option
# #
...@@ -239,6 +248,7 @@ if( ScalFMM_USE_FFT ) ...@@ -239,6 +248,7 @@ if( ScalFMM_USE_FFT )
MESSAGE(STATUS " SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}") MESSAGE(STATUS " SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
MESSAGE(STATUS " SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}") MESSAGE(STATUS " SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
endif(ScalFMM_USE_FFT) endif(ScalFMM_USE_FFT)
list(APPEND FUSE_LIST "FFT")
# Compile option # Compile option
#ADD_DEFINITIONS(-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -fpic ) #ADD_DEFINITIONS(-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -fpic )
...@@ -278,6 +288,7 @@ if( ScalFMM_USE_STARPU ) ...@@ -278,6 +288,7 @@ if( ScalFMM_USE_STARPU )
# SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${STARPU_INCLUDES}") # SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${STARPU_INCLUDES}")
include_directories(${STARPU_INCLUDES}) include_directories(${STARPU_INCLUDES})
endif(ScalFMM_USE_STARPU) endif(ScalFMM_USE_STARPU)
list(APPEND FUSE_LIST "STARPU")
# #
################################################################## ##################################################################
# Use SSE # # Use SSE #
...@@ -304,6 +315,7 @@ if( ScalFMM_USE_SSE ) ...@@ -304,6 +315,7 @@ if( ScalFMM_USE_SSE )
MESSAGE(FATAL_ERROR "SSE NOT SUPPORTED ; Set ScalFMM_USE_SSE to OFF \n Output from test is : ${COMPILE_SSE_OUTPUT}") MESSAGE(FATAL_ERROR "SSE NOT SUPPORTED ; Set ScalFMM_USE_SSE to OFF \n Output from test is : ${COMPILE_SSE_OUTPUT}")
ENDIF(${COMPILE_SSE}) ENDIF(${COMPILE_SSE})
endif() endif()
list(APPEND FUSE_LIST "SSE")
################################################################## ##################################################################
# Use AVX # # Use AVX #
################################################################## ##################################################################
...@@ -329,6 +341,7 @@ ELSE(${COMPILE_AVX}) ...@@ -329,6 +341,7 @@ ELSE(${COMPILE_AVX})
MESSAGE(FATAL_ERROR "AVX NOT SUPPORTED ; Set ScalFMM_USE_AVX to OFF \n Output from test is : ${COMPILE_AVX_OUTPUT} ") MESSAGE(FATAL_ERROR "AVX NOT SUPPORTED ; Set ScalFMM_USE_AVX to OFF \n Output from test is : ${COMPILE_AVX_OUTPUT} ")
ENDIF(${COMPILE_AVX}) ENDIF(${COMPILE_AVX})
endif(ScalFMM_USE_AVX) endif(ScalFMM_USE_AVX)
list(APPEND FUSE_LIST "AVX")
# #
# Error if both ScalFMM_USE_AVX AND ScalFMM_USE_SSE are set # Error if both ScalFMM_USE_AVX AND ScalFMM_USE_SSE are set
# #
...@@ -348,6 +361,7 @@ if( ScalFMM_USE_MIC_NATIVE ) ...@@ -348,6 +361,7 @@ if( ScalFMM_USE_MIC_NATIVE )
else() else()
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xhost") # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xhost")
ENDIF() ENDIF()
list(APPEND FUSE_LIST "MIC")
################################################################## ##################################################################
# #
################################################################## ##################################################################
......
...@@ -33,32 +33,15 @@ foreach(exec ${source_tests_files}) ...@@ -33,32 +33,15 @@ foreach(exec ${source_tests_files})
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT ScalFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test FFT dependency
file(STRINGS "${exec}" lines_fft REGEX "@FUSE_FFT")
if(lines_fft)
if( NOT ScalFMM_USE_FFT )
MESSAGE( STATUS "This needs FFT = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT ScalFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
...@@ -32,32 +32,15 @@ foreach(exec ${source_tests_files}) ...@@ -32,32 +32,15 @@ foreach(exec ${source_tests_files})
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT ScalFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test FFT dependency
file(STRINGS "${exec}" lines_fft REGEX "@FUSE_FFT")
if(lines_fft)
if( NOT ScalFMM_USE_FFT )
MESSAGE( STATUS "This needs FFT = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT ScalFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
...@@ -71,32 +71,15 @@ foreach(exec ${source_tests_files}) ...@@ -71,32 +71,15 @@ foreach(exec ${source_tests_files})
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT ScalFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test FFT dependency
file(STRINGS "${exec}" lines_fft REGEX "@FUSE_FFT")
if(lines_fft)
if( NOT ScalFMM_USE_FFT )
MESSAGE( STATUS "This needs FFT = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT ScalFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
...@@ -32,32 +32,15 @@ foreach(exec ${source_tests_files}) ...@@ -32,32 +32,15 @@ foreach(exec ${source_tests_files})
set(compile_exec "TRUE") set(compile_exec "TRUE")
# Test Blas dependency foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_blas REGEX "@FUSE_BLAS") file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_blas) if(lines_fuse)
if( NOT ScalFMM_USE_BLAS ) if( NOT ScalFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs BLAS = ${exec}" ) MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test FFT dependency
file(STRINGS "${exec}" lines_fft REGEX "@FUSE_FFT")
if(lines_fft)
if( NOT ScalFMM_USE_FFT )
MESSAGE( STATUS "This needs FFT = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
# Test MPI dependency
file(STRINGS "${exec}" lines_mpi REGEX "@FUSE_MPI")
if(lines_mpi)
if( NOT ScalFMM_USE_MPI )
MESSAGE( STATUS "This needs MPI = ${exec}" )
set(compile_exec "FALSE") set(compile_exec "FALSE")
endif() endif()
endif() endif()
endforeach()
# Dependency are OK # Dependency are OK
if( compile_exec ) if( compile_exec )
......
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