Fix Clang CUDA for Clang>=9
authorRoland Schulz <roland.schulz@intel.com>
Mon, 11 May 2020 04:36:57 +0000 (21:36 -0700)
committerRoland Schulz <roland.schulz@intel.com>
Mon, 11 May 2020 05:21:05 +0000 (22:21 -0700)
CUDA and OpenMP is broken (bug 45533). Overwrite OpenMP
flag with -fno-openmp to work-around it. No CUDA files
use OpenMP and therefore this has no negative impact.

cmake/gmxManageClangCudaConfig.cmake

index d58eaf462fe9ea5b47378a99e741f117bb27f019..a2b0927d977382991b0e168d37184a0a7ada9ce1 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -81,6 +81,8 @@ endif()
 
 # default flags
 list(APPEND _CUDA_CLANG_FLAGS "-x cuda" "-ffast-math")
+# Workaround for clang>=9 (Bug 45533). No CUDA file uses OpenMP.
+list(APPEND _CUDA_CLANG_FLAGS "-fno-openmp")
 # CUDA toolkit
 list(APPEND _CUDA_CLANG_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
 # codegen flags