diff --git a/cmake/system.cmake b/cmake/system.cmake index bf4c548b9..11ebb529e 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -418,10 +418,15 @@ if (USE_OPENMP) if (NOT NOFORTRAN) find_package(OpenMP COMPONENTS Fortran REQUIRED) # Avoid mixed OpenMP linkage - get_target_property(OMP_C_LIB OpenMP::OpenMP_C INTERFACE_LINK_LIBRARIES) - get_target_property(OMP_Fortran_LIB OpenMP::OpenMP_Fortran INTERFACE_LINK_LIBRARIES) - if (NOT OMP_C_LIB STREQUAL OMP_Fortran_LIB) - message(FATAL_ERROR "Multiple OpenMP runtime libraries detected. Mixed OpenMP runtime linkage is dangerous. You may pass -DOpenMP_LANG_LIB_NAMES and -DOpenMP_omp_LIBRARY to manually choose the OpenMP library.") + get_target_property(OMP_C_LIBS OpenMP::OpenMP_C INTERFACE_LINK_LIBRARIES) + get_target_property(OMP_F_LIBS OpenMP::OpenMP_Fortran INTERFACE_LINK_LIBRARIES) + if (NOT OMP_C_LIBS STREQUAL OMP_F_LIBS) + message(NOTICE + "OpenMP runtimes detected:\n" + "C=${OMP_C_LIBS}\n" + "Fortran=${OMP_F_LIBS}\n" + "Please check that they are the same OpenMP runtime implementation." + ) endif() endif () endif ()