From 29d2c4d32732129fc02775695e827a039f9b7a4d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 10 Feb 2020 17:02:38 -0700 Subject: [PATCH] cmake/configure_macosx.gnu.cmake: turn OpenMP off for clang compilers, fix netCDF rpath issue (#54) --- cmake/configure_macosx.gnu.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/configure_macosx.gnu.cmake b/cmake/configure_macosx.gnu.cmake index 027e2f8a57..510dff1541 100644 --- a/cmake/configure_macosx.gnu.cmake +++ b/cmake/configure_macosx.gnu.cmake @@ -14,7 +14,12 @@ option(DEBUG "Enable DEBUG mode" OFF) option(REPRO "Enable REPRO mode" OFF) option(VERBOSE "Enable VERBOSE mode" OFF) option(32BIT "Enable 32BIT (single precision arithmetic in dycore)" OFF) -option(OPENMP "Enable OpenMP threading" ON) +# OpenMP broken for clang compiler +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang*") + option(OPENMP "Enable OpenMP threading" OFF) +else() + option(OPENMP "Enable OpenMP threading" ON) +endif() option(AVX2 "Enable AVX2 instruction set" OFF) option(INLINE_POST "Enable inline post" OFF) @@ -36,4 +41,7 @@ set(MKL_DIR $ENV{MKL_DIR}) set(MKL_INC $ENV{MKL_INC}) set(MKL_LIB $ENV{MKL_LIB}) +# Workaround for rpath in netCDF +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ${NETCDF_LIBDIR}") + message("")