Skip to content

Commit ca121eb

Browse files
authored
Avoid linking both libgomp and libomp in mixed clang/gfortran builds
1 parent 4adfe4d commit ca121eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lapack-netlib/TESTING/EIG/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ set(ZDMDEIGTST zchkdmd.f90)
107107
macro(add_eig_executable name)
108108
add_executable(${name} ${ARGN})
109109
target_link_libraries(${name} openblas${SUFFIX64_UNDERSCORE})
110+
if (USE_OPENMP AND (${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU) AND (${CMAKE_C_COMPILER_ID} STREQUAL Clang))
111+
string(REGEX REPLACE "-fopenmp" "" CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
112+
target_link_libraries(${name} omp pthread)
113+
endif()
110114
#${TMGLIB} ../${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
111115
endmacro()
112116

0 commit comments

Comments
 (0)