Commit 9c263144 authored by PRUVOST Florent's avatar PRUVOST Florent

code factorization for starpu functions test

parent 1fdc9fe3
...@@ -596,15 +596,23 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -596,15 +596,23 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
if(STARPU_LINKER_FLAGS) if(STARPU_LINKER_FLAGS)
list(APPEND CMAKE_EXE_LINKER_FLAGS "${STARPU_LINKER_FLAGS}") list(APPEND CMAKE_EXE_LINKER_FLAGS "${STARPU_LINKER_FLAGS}")
endif() endif()
set(CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS}") set(CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS_DEP}")
foreach(libdir ${STARPU_LIBRARY_DIRS_DEP}) foreach(libdir ${STARPU_LIBRARY_DIRS_DEP})
list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}") list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}")
endforeach() endforeach()
set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES_DEP}")
if (CHAMELEON_USE_MPI)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}")
list(APPEND CMAKE_REQUIRED_FLAGS "${MPI_C_LINK_FLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
if (NOT CHAMELEON_SIMULATION)
list(APPEND CMAKE_REQUIRED_LIBRARIES "mpi")
endif()
endif()
if (CHAMELEON_SIMULATION) if (CHAMELEON_SIMULATION)
list(APPEND CMAKE_REQUIRED_FLAGS "-include" "starpu_simgrid_wrap.h") list(APPEND CMAKE_REQUIRED_FLAGS "-include" "starpu_simgrid_wrap.h")
endif() endif()
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES_DEP}")
check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND) check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND)
if ( STARPU_IDLE_PREFETCH_FOUND ) if ( STARPU_IDLE_PREFETCH_FOUND )
add_definitions(-DCHAMELEON_USE_STARPU_IDLE_PREFETCH) add_definitions(-DCHAMELEON_USE_STARPU_IDLE_PREFETCH)
...@@ -615,7 +623,6 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -615,7 +623,6 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
endif() endif()
if(CHAMELEON_ENABLE_TRACING) if(CHAMELEON_ENABLE_TRACING)
# check if fxt profiling is accessible in starpu and activate it in chameleon # check if fxt profiling is accessible in starpu and activate it in chameleon
set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES_DEP}")
unset(STARPU_FXT_START_PROFILING_FOUND CACHE) unset(STARPU_FXT_START_PROFILING_FOUND CACHE)
check_function_exists(starpu_fxt_start_profiling STARPU_FXT_START_PROFILING_FOUND) check_function_exists(starpu_fxt_start_profiling STARPU_FXT_START_PROFILING_FOUND)
if ( STARPU_FXT_START_PROFILING_FOUND ) if ( STARPU_FXT_START_PROFILING_FOUND )
...@@ -628,15 +635,8 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/") ...@@ -628,15 +635,8 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
message("-- ${Red}Check in CMakeFiles/CMakeError.log to figure out why it fails${ColourReset}") message("-- ${Red}Check in CMakeFiles/CMakeError.log to figure out why it fails${ColourReset}")
endif() endif()
endif() endif()
if (CHAMELEON_USE_MPI AND STARPU_MPI_LIBRARIES) if (CHAMELEON_USE_MPI)
# Check if a specific function exist # Check if a specific function exist
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}")
list(APPEND CMAKE_REQUIRED_FLAGS "${MPI_C_LINK_FLAGS}")
set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES_DEP}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
if (NOT CHAMELEON_SIMULATION)
list(APPEND CMAKE_REQUIRED_LIBRARIES "mpi")
endif()
unset(STARPU_MPI_DATA_REGISTER_FOUND CACHE) unset(STARPU_MPI_DATA_REGISTER_FOUND CACHE)
check_function_exists(starpu_mpi_data_register_comm STARPU_MPI_DATA_REGISTER_FOUND) check_function_exists(starpu_mpi_data_register_comm STARPU_MPI_DATA_REGISTER_FOUND)
if ( STARPU_MPI_DATA_REGISTER_FOUND ) if ( STARPU_MPI_DATA_REGISTER_FOUND )
......
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