Avoid linking both libgomp and libomp in mixed clang/gfortran builds

This commit is contained in:
Martin Kroeker 2024-02-22 22:17:05 +01:00 committed by GitHub
parent 4adfe4d531
commit ca121eb5ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,10 @@ set(ZDMDEIGTST zchkdmd.f90)
macro(add_eig_executable name)
add_executable(${name} ${ARGN})
target_link_libraries(${name} openblas${SUFFIX64_UNDERSCORE})
if (USE_OPENMP AND (${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU) AND (${CMAKE_C_COMPILER_ID} STREQUAL Clang))
string(REGEX REPLACE "-fopenmp" "" CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}")
target_link_libraries(${name} omp pthread)
endif()
#${TMGLIB} ../${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
endmacro()