summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2024-10-08 05:54:39 +0200
committerGitHub <noreply@github.com>2024-10-08 05:54:39 +0200
commit1a965e9ec290dac6734cf6441e7c3b7facfd0eb7 (patch)
tree4b529a2bf5a210f463cd20ee266fbf01c737fad8
parenta9e9b901d12a4139801b6ef48a8cf3aee334b6f3 (diff)
downloadspack-1a965e9ec290dac6734cf6441e7c3b7facfd0eb7.tar.gz
spack-1a965e9ec290dac6734cf6441e7c3b7facfd0eb7.tar.bz2
spack-1a965e9ec290dac6734cf6441e7c3b7facfd0eb7.tar.xz
spack-1a965e9ec290dac6734cf6441e7c3b7facfd0eb7.zip
py-torchvision: fix build with Apple Clang 16 (#46462)
-rw-r--r--var/spack/repos/builtin/packages/py-torchvision/package.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-torchvision/package.py b/var/spack/repos/builtin/packages/py-torchvision/package.py
index d5ea32a137..1f17b6529d 100644
--- a/var/spack/repos/builtin/packages/py-torchvision/package.py
+++ b/var/spack/repos/builtin/packages/py-torchvision/package.py
@@ -152,6 +152,13 @@ class PyTorchvision(PythonPackage):
# Many of the datasets require additional dependencies to use.
# These can be installed after the fact.
+ def flag_handler(self, name, flags):
+ # https://github.com/pytorch/vision/issues/8653
+ if name == "ldflags":
+ if self.spec.satisfies("%apple-clang@15:"):
+ flags.append("-Wl,-ld_classic")
+ return (flags, None, None)
+
def setup_build_environment(self, env):
# The only documentation on building is what is found in setup.py and:
# https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#development-installation