From a4a393d097b2f7395511b1c20de415913b919bab Mon Sep 17 00:00:00 2001 From: Scott McMillan Date: Mon, 28 Jun 2021 02:19:36 -0500 Subject: Update Boost package to support building the latest with the NV compilers (#24541) Co-authored-by: Scott McMillan --- .../repos/builtin/packages/boost/nvhpc-1.74.patch | 45 ++++++++++++++++++++++ .../repos/builtin/packages/boost/nvhpc-1.76.patch | 27 +++++++++++++ .../packages/boost/nvhpc-find_address.patch | 11 ++++++ var/spack/repos/builtin/packages/boost/nvhpc.patch | 45 ---------------------- var/spack/repos/builtin/packages/boost/package.py | 6 ++- 5 files changed, 88 insertions(+), 46 deletions(-) create mode 100644 var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch create mode 100644 var/spack/repos/builtin/packages/boost/nvhpc-1.76.patch create mode 100644 var/spack/repos/builtin/packages/boost/nvhpc-find_address.patch delete mode 100644 var/spack/repos/builtin/packages/boost/nvhpc.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch b/var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch new file mode 100644 index 0000000000..f660f5cf53 --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch @@ -0,0 +1,45 @@ +--- a/tools/build/src/engine/build.sh 2020-08-25 08:44:18.873304084 -0700 ++++ b/tools/build/src/engine/build.sh 2020-08-25 08:44:34.215370891 -0700 +@@ -89,7 +89,7 @@ + kylix) ( ${CXX:=bc++} -tC -q check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + mipspro) ( ${CXX:=CC} -FE:template_in_elf_section -ptused check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + pathscale) ( ${CXX:=pathCC} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; +- pgi) ( ${CXX:=pgc++} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; ++ pgi) ( ${CXX:=nvc++} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + sun*) ( ${CXX:=CC} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + clang*) ( ${CXX:=clang++} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; + tru64cxx) ( ${CXX:=cc} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; +@@ -140,7 +140,7 @@ + elif test -r /opt/intel/compiler50/ia32/bin/iccvars.sh && test_cxx11 intel-linux ; then + B2_TOOLSET=intel-linux + B2_TOOLSET_ROOT=/opt/intel/compiler50/ia32/ +- elif test_path pgc++ && test_cxx11 pgi ; then B2_TOOLSET=pgi ++ elif test_path nvc++ && test_cxx11 pgi ; then B2_TOOLSET=pgi + elif test_path pathCC && test_cxx11 pathscale ; then B2_TOOLSET=pathscale + elif test_path como && test_cxx11 como ; then B2_TOOLSET=como + elif test_path KCC && test_cxx11 kcc ; then B2_TOOLSET=kcc +@@ -345,7 +345,7 @@ + ;; + + pgi) +- CXX=${CXX:=pgc++} ++ CXX=${CXX:=nvc++} + CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} + B2_CXX="${CXX} -std=c++11" + B2_CXXFLAGS_RELEASE="-fast -s" +--- a/tools/build/src/tools/pgi.jam 2020-08-25 08:45:01.015487600 -0700 ++++ b/tools/build/src/tools/pgi.jam 2020-08-25 08:45:16.462554871 -0700 +@@ -26,11 +26,11 @@ + { + local condition = [ common.check-init-parameters pgi : version $(version) ] ; + +- local l_command = [ common.get-invocation-command pgi : pgc++ : $(command) ] ; ++ local l_command = [ common.get-invocation-command pgi : nvc++ : $(command) ] ; + + common.handle-options pgi : $(condition) : $(l_command) : $(options) ; + +- command_c = $(command_c[1--2]) $(l_command[-1]:B=pgcc) ; ++ command_c = $(command_c[1--2]) $(l_command[-1]:B=nvc) ; + + toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ; + diff --git a/var/spack/repos/builtin/packages/boost/nvhpc-1.76.patch b/var/spack/repos/builtin/packages/boost/nvhpc-1.76.patch new file mode 100644 index 0000000000..b1dd564a15 --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/nvhpc-1.76.patch @@ -0,0 +1,27 @@ +--- a/tools/build/src/engine/build.sh ++++ b/tools/build/src/engine/build.sh +@@ -232,7 +232,7 @@ + # AIX VA C++ (vacpp) + if test_toolset vacpp && test_uname AIX && test_compiler xlC_r ; then B2_TOOLSET=vacpp ; return ${TRUE} ; fi + # PGI (pgi) +- if test_toolset pgi && test_compiler pgc++ -std=c++11 ; then B2_TOOLSET=pgi ; return ${TRUE} ; fi ++ if test_toolset pgi && test_compiler nvc++ -std=c++11 ; then B2_TOOLSET=pgi ; return ${TRUE} ; fi + # Pathscale C++ (pathscale) + if test_toolset pathscale && test_compiler pathCC ; then B2_TOOLSET=pathscale ; return ${TRUE} ; fi + # Como (como) +--- a/tools/build/src/tools/pgi.jam 2020-08-25 08:45:01.015487600 -0700 ++++ b/tools/build/src/tools/pgi.jam 2020-08-25 08:45:16.462554871 -0700 +@@ -26,11 +26,11 @@ + { + local condition = [ common.check-init-parameters pgi : version $(version) ] ; + +- local l_command = [ common.get-invocation-command pgi : pgc++ : $(command) ] ; ++ local l_command = [ common.get-invocation-command pgi : nvc++ : $(command) ] ; + + common.handle-options pgi : $(condition) : $(l_command) : $(options) ; + +- command_c = $(command_c[1--2]) $(l_command[-1]:B=pgcc) ; ++ command_c = $(command_c[1--2]) $(l_command[-1]:B=nvc) ; + + toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ; + diff --git a/var/spack/repos/builtin/packages/boost/nvhpc-find_address.patch b/var/spack/repos/builtin/packages/boost/nvhpc-find_address.patch new file mode 100644 index 0000000000..64a8558222 --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/nvhpc-find_address.patch @@ -0,0 +1,11 @@ +--- a/libs/atomic/src/find_address_sse2.cpp ++++ b/libs/atomic/src/find_address_sse2.cpp +@@ -51,7 +51,7 @@ + // a hypervisor blocks SSE4.1 detection), and there pand may have a better throughput. For example, + // Sandy Bridge can execute 3 pand instructions per cycle, but only one andps. For this reason + // we prefer to generate pand and not andps. +-#if defined(__GNUC__) ++#if defined(__GNUC__) && !defined(__NVCOMPILER) + __asm__("pand %1, %0\n\t" : "+x" (mm1) : "x" (mm2)); + #else + mm1 = _mm_and_si128(mm1, mm2); diff --git a/var/spack/repos/builtin/packages/boost/nvhpc.patch b/var/spack/repos/builtin/packages/boost/nvhpc.patch deleted file mode 100644 index f660f5cf53..0000000000 --- a/var/spack/repos/builtin/packages/boost/nvhpc.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/tools/build/src/engine/build.sh 2020-08-25 08:44:18.873304084 -0700 -+++ b/tools/build/src/engine/build.sh 2020-08-25 08:44:34.215370891 -0700 -@@ -89,7 +89,7 @@ - kylix) ( ${CXX:=bc++} -tC -q check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - mipspro) ( ${CXX:=CC} -FE:template_in_elf_section -ptused check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - pathscale) ( ${CXX:=pathCC} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; -- pgi) ( ${CXX:=pgc++} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; -+ pgi) ( ${CXX:=nvc++} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - sun*) ( ${CXX:=CC} -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - clang*) ( ${CXX:=clang++} -x c++ -std=c++11 check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; - tru64cxx) ( ${CXX:=cc} check_cxx11.cpp && rm -f a.out ) 1>/dev/null 2>/dev/null ;; -@@ -140,7 +140,7 @@ - elif test -r /opt/intel/compiler50/ia32/bin/iccvars.sh && test_cxx11 intel-linux ; then - B2_TOOLSET=intel-linux - B2_TOOLSET_ROOT=/opt/intel/compiler50/ia32/ -- elif test_path pgc++ && test_cxx11 pgi ; then B2_TOOLSET=pgi -+ elif test_path nvc++ && test_cxx11 pgi ; then B2_TOOLSET=pgi - elif test_path pathCC && test_cxx11 pathscale ; then B2_TOOLSET=pathscale - elif test_path como && test_cxx11 como ; then B2_TOOLSET=como - elif test_path KCC && test_cxx11 kcc ; then B2_TOOLSET=kcc -@@ -345,7 +345,7 @@ - ;; - - pgi) -- CXX=${CXX:=pgc++} -+ CXX=${CXX:=nvc++} - CXX_VERSION_OPT=${CXX_VERSION_OPT:=--version} - B2_CXX="${CXX} -std=c++11" - B2_CXXFLAGS_RELEASE="-fast -s" ---- a/tools/build/src/tools/pgi.jam 2020-08-25 08:45:01.015487600 -0700 -+++ b/tools/build/src/tools/pgi.jam 2020-08-25 08:45:16.462554871 -0700 -@@ -26,11 +26,11 @@ - { - local condition = [ common.check-init-parameters pgi : version $(version) ] ; - -- local l_command = [ common.get-invocation-command pgi : pgc++ : $(command) ] ; -+ local l_command = [ common.get-invocation-command pgi : nvc++ : $(command) ] ; - - common.handle-options pgi : $(condition) : $(l_command) : $(options) ; - -- command_c = $(command_c[1--2]) $(l_command[-1]:B=pgcc) ; -+ command_c = $(command_c[1--2]) $(l_command[-1]:B=nvc) ; - - toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ; - diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index a0c3656941..81c13139f1 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -217,7 +217,11 @@ class Boost(Package): patch('boost_1.63.0_pgi_17.4_workaround.patch', when='@1.63.0%pgi@17.4') # Patch to override the PGI toolset when using the NVIDIA compilers - patch('nvhpc.patch', when='%nvhpc') + patch('nvhpc-1.74.patch', when='@1.74.0:1.75.9999%nvhpc') + patch('nvhpc-1.76.patch', when='@1.76.0:1.76.9999%nvhpc') + + # Patch to workaround compiler bug + patch('nvhpc-find_address.patch', when='@1.75.0:1.76.999%nvhpc') # Fix for version comparison on newer Clang on darwin # See: https://github.com/boostorg/build/issues/440 -- cgit v1.2.3-60-g2f50