diff --git a/src/catalyst/CMakeLists.txt b/src/catalyst/CMakeLists.txt index b68d34860661157f6d2763705ec1b91c3f3fbcc5..13fe67e640eacfabe00c8e5e20c4e3530e82b916 100644 --- a/src/catalyst/CMakeLists.txt +++ b/src/catalyst/CMakeLists.txt @@ -12,6 +12,15 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) "In-source builds disallowed. Use a separate build directory") endif() +# workaround to fix a problem with GCC and CUDA 10, fixed in CUDA 11 +# see https://github.com/LLNL/blt/issues/341 +# an alternative is to add: -Xcompiler=-mno-float128 +if ( (CMAKE_CXX_COMPILER_ID MATCHES GNU) AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le) ) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -std=c++11") + endif() +endif() + #------------------------------------------------------------------------------ # Simple discovery and sanity checks diff --git a/src/runTimePostProcessing/CMakeLists.txt b/src/runTimePostProcessing/CMakeLists.txt index fd5d3a16854f27b2e128a07ebe4c2a09558db0b9..3d2de56c680b673344cfc57abafb2acfee0e1f4b 100644 --- a/src/runTimePostProcessing/CMakeLists.txt +++ b/src/runTimePostProcessing/CMakeLists.txt @@ -12,6 +12,15 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) "In-source builds disallowed. Use a separate build directory") endif() +# workaround to fix a problem with GCC and CUDA 10, fixed in CUDA 11 +# see https://github.com/LLNL/blt/issues/341 +# an alternative is to add: -Xcompiler=-mno-float128 +if ( (CMAKE_CXX_COMPILER_ID MATCHES GNU) AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le) ) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -std=c++11") + endif() +endif() + #----------------------------------------------------------------------------- # Simple discovery and sanity checks