Commit a4355d32 authored by GILLES Sebastien's avatar GILLES Sebastien

#1293 Modify CMake so that GOMP is assigned only for gcc (that's a try; I'm...

#1293 Modify CMake so that GOMP is assigned only for gcc (that's a try; I'm not sure yet which VM needs it or not but compiler seems the most likely choice).
parent 1769fd07
......@@ -89,7 +89,7 @@ set(MOREFEM_COMMON_DEP
${LIB_OPEN_MPI}
${LIB_OPEN_MPI_CXX}
${LIB_PETSC}
-lgomp
${MOREFEM_GOMP_DEPENDENCY}
${LIB_PARMETIS}
${LIB_METIS}
${LIB_BOOST_FILESYSTEM}
......
......@@ -69,6 +69,9 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang" OR ${CMAKE_C_COMPILER_ID} STREQU
add_definitions(-DMOREFEM_LLVM_CLANG)
endif()
# GOMP is required when sanitizer is used for gcc, but is not known is macOS hence this variable.
set(MOREFEM_GOMP_DEPENDENCY "")
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_cxx_compiler_flag("-Wall")
add_cxx_compiler_flag("-Wextra")
......@@ -102,10 +105,15 @@ elseif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_cxx_compiler_flag("-Wunused-parameter")
add_cxx_compiler_flag("-Wvariadic-macros")
add_cxx_compiler_flag("-Wwrite-strings")
# GOMP is required when sanitizer is used for gcc, but is not known is macOS hence this variable.
set(MOREFEM_GOMP_DEPENDENCY "-lgomp")
else()
message(FATAL_ERROR "Sorry, your compiler family wasn't recognized. If CMake has updated its flag, please modify the cmake/Compiler.cmake file in MoReFEM accoerdingly. See CMAKE_LANG_COMPILER_ID in CMake tutorial to find out the valid options.")
endif()
if (${MOREFEM_DO_SANITIZE})
add_cxx_compiler_flag("-fno-omit-frame-pointer")
add_cxx_compiler_flag("-fsanitize=address")
......@@ -118,6 +126,8 @@ if (${MOREFEM_DO_SANITIZE})
endif()
set(MOREFEM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME})
set(MOREFEM_INSTALL_DIR_EXE ${MOREFEM_INSTALL_DIR}/bin)
......
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