summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott McMillan <scott.andrew.mcmillan@gmail.com>2021-06-28 02:19:36 -0500
committerGitHub <noreply@github.com>2021-06-28 01:19:36 -0600
commita4a393d097b2f7395511b1c20de415913b919bab (patch)
tree86b428aa9c6e5eeb362c5a9b3ae5a6a5a4be877a
parenta6ce000e09608749bae46df90aa268a8e8282f50 (diff)
downloadspack-a4a393d097b2f7395511b1c20de415913b919bab.tar.gz
spack-a4a393d097b2f7395511b1c20de415913b919bab.tar.bz2
spack-a4a393d097b2f7395511b1c20de415913b919bab.tar.xz
spack-a4a393d097b2f7395511b1c20de415913b919bab.zip
Update Boost package to support building the latest with the NV compilers (#24541)
Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
-rw-r--r--var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch (renamed from var/spack/repos/builtin/packages/boost/nvhpc.patch)0
-rw-r--r--var/spack/repos/builtin/packages/boost/nvhpc-1.76.patch27
-rw-r--r--var/spack/repos/builtin/packages/boost/nvhpc-find_address.patch11
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py6
4 files changed, 43 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/boost/nvhpc.patch b/var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch
index f660f5cf53..f660f5cf53 100644
--- a/var/spack/repos/builtin/packages/boost/nvhpc.patch
+++ b/var/spack/repos/builtin/packages/boost/nvhpc-1.74.patch
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/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