Skip to content

Commit d0d3c14

Browse files
committed
Don't use OpenMP with LLVM Flang before version 19.
1 parent c95ef37 commit d0d3c14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ if (NOT NOFORTRAN AND CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
128128
endif()
129129
set(NO_AVX512 1)
130130
endif()
131+
132+
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 19)
133+
# LLVM Flang before version 19 doesn't support necessary OpenMP constructs.
134+
if (USE_OPENMP)
135+
message(STATUS "Disabling OpenMP for LLVM Flang before version 19.")
136+
set(USE_OPENMP 0)
137+
endif()
138+
endif()
131139
endif()
132140

133141
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")

0 commit comments

Comments
 (0)