From 30839202882048cd23e6b8893b14b01c2e16ad53 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Sun, 15 Aug 2021 12:23:52 -0600 Subject: [PATCH] Provide a couple of fixes for XL on power9 (#1108) + Allows CI to run on Darwin Power9 for XL. --- config/compilerEnv.cmake | 2 ++ config/unix-xl.cmake | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/compilerEnv.cmake b/config/compilerEnv.cmake index f0e1fc69e..d66480d28 100644 --- a/config/compilerEnv.cmake +++ b/config/compilerEnv.cmake @@ -344,6 +344,8 @@ macro(dbsSetupCxx) include(unix-g++) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") include(windows-cl) + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XLClang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "XLCLang") + include(unix-xl) else() # missing CMAKE_CXX_COMPILER_ID? - try to match the compiler path+name to a string. if("${my_cxx_compiler}" MATCHES "pgCC" OR "${my_cxx_compiler}" MATCHES "pgc[+][+]") diff --git a/config/unix-xl.cmake b/config/unix-xl.cmake index 557fee3a7..20eb5d4f3 100644 --- a/config/unix-xl.cmake +++ b/config/unix-xl.cmake @@ -29,7 +29,7 @@ if(NOT CXX_FLAGS_INITIALIZED) if(EXISTS /usr/gapps) # ATS-2 string(APPEND CMAKE_C_FLAGS " --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1") - elseif(EXISTS /projects/opt/ppc64le/ibm) + elseif(EXISTS /projects/opt/ppc64le/ibm AND NOT $ENV{CXX} MATCHES "-F") # Darwin power9 - extract version from module environment. string(REPLACE ":" ";" modules $ENV{LOADEDMODULES}) foreach(module ${modules}) @@ -43,7 +43,7 @@ if(NOT CXX_FLAGS_INITIALIZED) ${xlc_version}) elseif(${module} MATCHES "^cuda") if(NOT DEFINED cuda_version) - string(REGEX REPLACE "[^0-9]*([0-9]+).([0-9]+)" "\\1.\\2" cuda_version ${module}) + string(REGEX REPLACE "[^0-9]*([0-9]+).([0-9]+).*" "\\1.\\2" cuda_version ${module}) endif() endif() endforeach()