diff options
author | Andrew W Elble <aweits@rit.edu> | 2024-09-25 09:19:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 15:19:58 +0200 |
commit | fd087107ea52b402e6d385b430a320fc3d3d6734 (patch) | |
tree | 516958987193d8f13095380ac8c440ae3432f1f4 /var | |
parent | a342da56429abc20ba78a9a8da45e41f82d66b85 (diff) | |
download | spack-fd087107ea52b402e6d385b430a320fc3d3d6734.tar.gz spack-fd087107ea52b402e6d385b430a320fc3d3d6734.tar.bz2 spack-fd087107ea52b402e6d385b430a320fc3d3d6734.tar.xz spack-fd087107ea52b402e6d385b430a320fc3d3d6734.zip |
py-tensorflow: fix linking with ubuntu's gcc (#45437)
gcc on ubuntu has fix-cortex-a53-843419 set by default - this causes linking
issues (symbol relocation errors) for tf, even when compiling for different
cpus.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-tensorflow/package.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index c94a2082d5..e6e7dce487 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -452,6 +452,22 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): ) phases = ["configure", "build", "install"] + def flag_handler(self, name, flags): + spec = self.spec + # ubuntu gcc has this workaround turned on by default in aarch64 + # and it causes issues with symbol relocation during link + # note, archspec doesn't currently ever report cortex_a53! + if ( + name == "ldflags" + and spec.target.family == "aarch64" + and "ubuntu" in spec.os + and spec.compiler.name == "gcc" + and "cortex_a53" not in spec.target.name + ): + flags.append("-mno-fix-cortex-a53-843419") + + return (flags, None, None) + # https://www.tensorflow.org/install/source def setup_build_environment(self, env): spec = self.spec |