py-torch-nvidia-apex: ~cuda does not build (#32939)

This commit is contained in:
Adam J. Stewart 2022-10-05 12:38:21 -05:00 committed by GitHub
parent 4ed963dda1
commit d956da95c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,9 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage):
variant("cuda", default=True, description="Build with CUDA")
# https://github.com/NVIDIA/apex/issues/1498
conflicts("~cuda")
def setup_build_environment(self, env):
if "+cuda" in self.spec:
env.set("CUDA_HOME", self.spec["cuda"].prefix)
@ -35,7 +38,7 @@ def setup_build_environment(self, env):
)
env.set("TORCH_CUDA_ARCH_LIST", torch_cuda_arch)
def install_options(self, spec, prefix):
def global_options(self, spec, prefix):
args = []
if spec.satisfies("^py-torch@1.0:"):
args.append("--cpp_ext")