From 26f0dc2891617e3141499ba9304e671c1b48f902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Sat, 5 Aug 2023 16:59:34 +0200 Subject: [PATCH] Don't use OpenMP with LLVM Flang before version 17. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fba4a2057..fa211e0fba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,12 @@ if(NOT NOFORTRAN AND CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND CMAKE_Fo message(STATUS "Disabling AVX512 instructions for LLVM Flang before version 17.") endif() set(NO_AVX512 1) + + # LLVM Flang before version 17 doesn't support necessary OpenMP constructs. + if (USE_OPENMP) + message(STATUS "Disabling OpenMP for LLVM Flang before version 17.") + set(USE_OPENMP 0) + endif() endif() include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")