Skip to content
Permalink
Browse files

Try to fix clang builds with OpenMP

  • Loading branch information...
milot-mirdita committed Jun 13, 2019
1 parent c153905 commit aec87ef124af90f6cfd39b390a16392b13cd6d19
Showing with 8 additions and 4 deletions.
  1. +1 −1 CMakeLists.txt
  2. +7 −3 src/CMakeLists.txt
@@ -21,7 +21,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif (NOT CMAKE_BUILD_TYPE)

# find compiler
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# using Clang
message("-- Compiler is clang(++)")
set(CMAKE_COMPILER_IS_CLANG 1)
@@ -220,9 +220,13 @@ if (${HAVE_OMP})
if (OPENMP_FOUND)
message("-- Found OpenMP")
target_compile_definitions(mmseqs-framework PUBLIC -DOPENMP=1)
# compiler should already link OpenMP libraries itself
# if we leave this in we might link the openmp libraries twice
# target_link_libraries(mmseqs-framework ${OpenMP_CXX_LIBRARIES})
if (CMAKE_COMPILER_IS_CLANG)
# Clang does not seem to be able to resolve the path to the library itself
# For GCC we dont want to do this since it breaks macOS static builds
# It will link libgomp.a internally (through -fopenmp I guess)
# and also link libgomp.dylib thus breaking static builds
target_link_libraries(mmseqs-framework ${OpenMP_CXX_LIBRARIES})
endif ()
append_target_property(mmseqs-framework COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
append_target_property(mmseqs-framework LINK_FLAGS ${OpenMP_CXX_FLAGS})
endif ()

0 comments on commit aec87ef

Please sign in to comment.
You can’t perform that action at this time.