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

MPI_CXX_COMPILE_FLAGS is used as it is in compilation flags while it is a list...

MPI_CXX_COMPILE_FLAGS is used as it is in compilation flags while it is a list (contains semicolons) so that we remove the semicolons to prevent errors
parent 12dd385c
......@@ -101,7 +101,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
message(WARNING "OpenMP_VERSION: ${OpenMP_VERSION}")
option( OPENMP_SUPPORT_PRIORITY "Set to ON to enable tasks priority (OMP4.x/KSTAR/StarPU compiler only)" OFF )
# STARPU options
CMAKE_DEPENDENT_OPTION(OPENMP_SUPPORT_COMMUTE "Set to ON to let tasks commute (KSTAR/StarPU compiler only)" OFF
CMAKE_DEPENDENT_OPTION(OPENMP_SUPPORT_COMMUTE "Set to ON to let tasks commute (KSTAR/StarPU compiler only)" OFF
"SCALFMM_USE_STARPU" OFF)
CMAKE_DEPENDENT_OPTION(OPENMP_SUPPORT_TASK_NAME "Set to ON to enable a taskname clause for tasks (KSTAR/StarPU compiler only)" OFF
"SCALFMM_USE_STARPU" OFF)
......@@ -155,12 +155,12 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
add_subdirectory(inastemp)
# use the filled variables from inastemp
INCLUDE_DIRECTORIES(
${INASTEMP_BINARY_DIR}/Src
${INASTEMP_SOURCE_DIR}/Src
${INASTEMP_BINARY_DIR}/Src
${INASTEMP_SOURCE_DIR}/Src
${INASTEMP_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/inastemp/Src
)
# propagate the flags to be able to compile
# propagate the flags to be able to compile
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INASTEMP_CXX_FLAGS}")
##############################################################################
......@@ -170,7 +170,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
#set(FUSE_LIST " MPI;BLAS;FFT;STARPU;CUDA;OPENCL;OMP4;SSE;AVX;AVX2;MIC;MPI2")
# then do list(APPEND FUSE_LIST "BLAS") to protect from FUSE_BLAS
# list(APPEND FUSE_LIST "MPI")
##############################################################################
# Debug flags #
##############################################################################
......@@ -196,12 +196,12 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
# ADD_DEFINITIONS(${SCALFMM_FLAGS_OPTI_DEBUG})
set(SCALFMM_CXX_FLAGS "${SCALFMM_CXX_FLAGS} ${SCALFMM_FLAGS_OPTI_DEBUG}")
set(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_DEBUG}")
else()
##############################################################################
# Release flags #
##############################################################################
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_RELEASE}")
# if compiler is intel add -ip
......@@ -231,7 +231,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
endif()
MESSAGE(STATUS " %%%%%%%%%% SCALFMM_CXX_FLAGS ${SCALFMM_CXX_FLAGS} %%%%%%%%%%%%%")
MESSAGE(STATUS " %%%%%%%%%% CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} %%%%%%%%%%%%%")
#
##############################################################################
# Attach source code to exec #
......@@ -251,27 +251,28 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
if(MPI_FOUND)
if (MPI_CXX_FOUND)
# message("MPI_CXX is in the place")
if (MPI_CXX_INCLUDE_PATH)
include_directories( ${MPI_CXX_INCLUDE_PATH} )
endif()
if (MPI_CXX_COMPILE_FLAGS)
set(SCALFMM_CXX_FLAGS "${SCALFMM_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
endif()
if (MPI_CXX_INCLUDE_PATH)
if (MPI_CXX_INCLUDE_PATH)
include_directories( ${MPI_CXX_INCLUDE_PATH} )
endif()
if (MPI_CXX_COMPILE_FLAGS)
string(REPLACE ";" " " MPI_CXX_COMPILE_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
set(SCALFMM_CXX_FLAGS "${SCALFMM_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
endif()
if (MPI_CXX_INCLUDE_PATH)
LIST(APPEND SCALFMM_INCLUDES "${SCALFMM_INCLUDES};${MPI_CXX_INCLUDE_PATH}")
endif()
if (MPI_CXX_LINK_FLAGS)
list(APPEND "CMAKE_EXE_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS}")
endif()
if (MPI_CXX_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${MPI_CXX_LIBRARIES}")
endif()
endif()
if (MPI_CXX_LINK_FLAGS)
list(APPEND "CMAKE_EXE_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS}")
endif()
if (MPI_CXX_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${MPI_CXX_LIBRARIES}")
endif()
else (MPI_CXX_FOUND)
message(FATAL_ERROR "MPI_CXX is required but was not found. "
"Please provide an MPI compiler in your environment."
"Note that you can give the path to your MPI installation "
"by setting MPI_DIR cmake variable.")
endif (MPI_CXX_FOUND)
message(FATAL_ERROR "MPI_CXX is required but was not found. "
"Please provide an MPI compiler in your environment."
"Note that you can give the path to your MPI installation "
"by setting MPI_DIR cmake variable.")
endif (MPI_CXX_FOUND)
else(MPI_FOUND)
endif(MPI_FOUND)
endif( SCALFMM_USE_MPI)
......@@ -388,7 +389,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
endif()
endif (NOT SCALFMM_BLAS_ADD_ AND NOT SCALFMM_BLAS_UPCASE AND NOT SCALFMM_BLAS_NOCHANGE)
else()
MESSAGE(WARNING "BLAS: ${BLAS-FOUND}")
MESSAGE(WARNING "BLAS: ${BLAS-FOUND}")
message(WARNING "BLAS has not been found, SCALFMM will continue to compile but some applications will be disabled.")
message(WARNING "If you have BLAS set BLAS_LIBDIR, BLAS_INCDIR or BLAS_DIR (CMake variables using -D or environment variables).")
......@@ -423,22 +424,22 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
if(FFTW_FOUND)
if (FFTW_LIBRARY_DIRS_DEP)
set(FFT_LIBRARIES "-L${FFTW_LIBRARY_DIRS_DEP};" CACHE STRING "Set your MKL flags")
set(FFT_LIBRARIES "-L${FFTW_LIBRARY_DIRS_DEP};" CACHE STRING "Set your MKL flags")
endif()
if (FFTW_LIBRARIES_DEP)
foreach (fft_lib ${FFTW_LIBRARIES_DEP})
foreach (fft_lib ${FFTW_LIBRARIES_DEP})
set(FFT_LIBRARIES "${FFT_LIBRARIES};${fft_lib};")
endforeach()
endforeach()
endif()
set(FFT_INCLUDES "${FFTW_INCLUDE_DIRS_DEP}" )
if (FFT_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${FFT_LIBRARIES}")
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${FFT_LIBRARIES}")
endif()
if(FFTW_LIBRARY_DIRS)
# the RPATH to be used when installing
list(APPEND CMAKE_INSTALL_RPATH "${FFTW_LIBRARY_DIRS}")
# the RPATH to be used when installing
list(APPEND CMAKE_INSTALL_RPATH "${FFTW_LIBRARY_DIRS}")
endif()
if (FFT_INCLUDES)
LIST(APPEND SCALFMM_INCLUDES "${FFT_INCLUDES}")
......@@ -508,11 +509,11 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
# create list of components in order to make a single call to find_package(starpu...)
set(STARPU_COMPONENT_LIST "HWLOC")
if(SCALFMM_USE_CUDA)
list(APPEND STARPU_COMPONENT_LIST "CUDA")
endif()
list(APPEND FUSE_LIST "CUDA")
list(APPEND FUSE_LIST "CUDA")
if(SCALFMM_USE_MPI)
list(APPEND STARPU_COMPONENT_LIST "MPI")
......@@ -521,7 +522,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
OPTION( SCALFMM_USE_OPENCL "Set to ON to use OPENCL with StarPU" OFF )
if(SCALFMM_USE_OPENCL)
list(APPEND STARPU_COMPONENT_LIST "OPENCL")
list(APPEND STARPU_COMPONENT_LIST "OPENCL")
# include_directories($ENV{OPENCL_INC})
# SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};-L$ENV{OPENCL_LIB};-lOpenCL")
endif()
......@@ -546,18 +547,18 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_
# Append list of libraries and include dirs
include_directories(${STARPU_INCLUDE_DIRS_DEP})
foreach (starpu_libdir ${STARPU_LIBRARY_DIRS_DEP})
if (${starpu_libdir} MATCHES "^ *-L")
if (${starpu_libdir} MATCHES "^ *-L")
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${starpu_libdir}")
else()
else()
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};-L${starpu_libdir}")
endif()
endif()
endforeach()
foreach (starpu_lib ${STARPU_LIBRARIES_DEP})
if (EXISTS ${starpu_lib} OR ${starpu_lib} MATCHES "^ *-")
if (EXISTS ${starpu_lib} OR ${starpu_lib} MATCHES "^ *-")
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${starpu_lib}")
else()
else()
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};-l${starpu_lib}")
endif()
endif()
endforeach()
else()
# StarPU not 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