summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToyohisa Kameyama <fj5358cc@fujitsu.com>2022-02-14 23:06:34 +0900
committerGitHub <noreply@github.com>2022-02-14 08:06:34 -0600
commit5353032eefd0369d70d071bbd8dbcdf7e41164ad (patch)
treece2ee422390cded96ab2e3e0df0fd76b50046a1f
parentdc57f987a79545f71a7b5f233a6c5cb853fc6b46 (diff)
downloadspack-5353032eefd0369d70d071bbd8dbcdf7e41164ad.tar.gz
spack-5353032eefd0369d70d071bbd8dbcdf7e41164ad.tar.bz2
spack-5353032eefd0369d70d071bbd8dbcdf7e41164ad.tar.xz
spack-5353032eefd0369d70d071bbd8dbcdf7e41164ad.zip
Python: fix build with Fujitsu compiler (#28744)
-rw-r--r--var/spack/repos/builtin/packages/python/fj-rpath-3.9.patch11
-rw-r--r--var/spack/repos/builtin/packages/python/package.py8
2 files changed, 18 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/python/fj-rpath-3.9.patch b/var/spack/repos/builtin/packages/python/fj-rpath-3.9.patch
new file mode 100644
index 0000000000..1542b367e9
--- /dev/null
+++ b/var/spack/repos/builtin/packages/python/fj-rpath-3.9.patch
@@ -0,0 +1,11 @@
+--- spack-src/Lib/distutils/unixccompiler.py.org 2022-01-31 14:42:34.000000000 +0900
++++ spack-src/Lib/distutils/unixccompiler.py 2022-01-31 14:43:19.000000000 +0900
+@@ -212,7 +212,7 @@
+
+ def _is_gcc(self, compiler_name):
+ # clang uses same syntax for rpath as gcc
+- return any(name in compiler_name for name in ("gcc", "g++", "clang"))
++ return any(name in compiler_name for name in ("gcc", "g++", "clang", "fcc", "FCC"))
+
+ def runtime_library_dir_option(self, dir):
+ # XXX Hackish, at the very least. See Python bug #445902:
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index b22d745176..8d33d7ad75 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -224,7 +224,8 @@ class Python(AutotoolsPackage):
# Ensure that distutils chooses correct compiler option for RPATH on fj:
patch('fj-rpath-2.3.patch', when='@2.3:3.0.1 %fj')
- patch('fj-rpath-3.1.patch', when='@3.1:3 %fj')
+ patch('fj-rpath-3.1.patch', when='@3.1:3.9.7,3.10.0 %fj')
+ patch('fj-rpath-3.9.patch', when='@3.9.8:3.9,3.10.1: %fj')
# Fixes an alignment problem with more aggressive optimization in gcc8
# https://github.com/python/cpython/commit/0b91f8a668201fc58fa732b8acc496caedfdbae0
@@ -418,6 +419,11 @@ class Python(AutotoolsPackage):
env.unset('PYTHONPATH')
env.unset('PYTHONHOME')
+ # avoid build error on fugaku
+ if spec.satisfies('@3.10.0 arch=linux-rhel8-a64fx'):
+ if spec.satisfies('%gcc') or spec.satisfies('%fj'):
+ env.unset('LC_ALL')
+
def flag_handler(self, name, flags):
# python 3.8 requires -fwrapv when compiled with intel
if self.spec.satisfies('@3.8: %intel'):