From 0ea81affd18820933640279bbc687038b3296a4e Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 8 Dec 2022 06:31:00 +0100 Subject: py-torch: fix build with gcc@12: (#34352) --- var/spack/repos/builtin/packages/py-torch/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index fa498232cb..3521475f6f 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -338,6 +338,15 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): when="@:1.9.1 ^cuda@11.4.100:", ) + # PyTorch does not build with GCC 12 (fixed on master) + # See: https://github.com/pytorch/pytorch/issues/77614 + patch( + "https://github.com/facebookincubator/gloo/commit/4a5e339b764261d20fc409071dc7a8b8989aa195.patch?full_index=1", + sha256="dc8b3a9bea4693f32d6850ea2ce6ce75e1778538bfba464b50efca92bac425e3", + when="@:1.13 %gcc@12:", + working_dir="third_party/gloo", + ) + @when("@1.5.0:") def patch(self): # https://github.com/pytorch/pytorch/issues/52208 -- cgit v1.2.3-70-g09d2