Skip to content

Commit

Permalink
Link OpenMP clang+gfortran build with -lomp
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored Feb 16, 2024
1 parent ba4ea7b commit a75dac6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ctest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat1 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat1"
COMMAND $<TARGET_FILE:x${float_char}cblat1>)

Expand All @@ -68,6 +71,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat2 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat2"
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat2> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in2")

Expand All @@ -93,6 +99,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat3 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat3"
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat3> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in3")

Expand Down

0 comments on commit a75dac6

Please sign in to comment.