py-torch-nvidia-apex: @3.11: Add config_settings(PEP517), add missing py-packaging (#43306)

This commit is contained in:
Auriane R 2024-03-23 16:04:10 +01:00 committed by GitHub
parent 99744a766b
commit 99bb288db7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage):
depends_on("python@3:", type=("build", "run"))
depends_on("py-setuptools", type="build")
depends_on("py-packaging", type="build")
depends_on("py-torch@0.4:", type=("build", "run"))
depends_on("cuda@9:", when="+cuda")
depends_on("py-pybind11", type=("build", "link", "run"))
@ -43,6 +44,7 @@ def setup_build_environment(self, env):
else:
env.unset("CUDA_HOME")
@when("^python@:3.10")
def global_options(self, spec, prefix):
args = []
if spec.satisfies("^py-torch@1.0:"):
@ -50,3 +52,11 @@ def global_options(self, spec, prefix):
if "+cuda" in spec:
args.append("--cuda_ext")
return args
@when("^python@3.11:")
def config_settings(self, spec, prefix):
return {
"builddir": "build",
"compile-args": f"-j{make_jobs}",
"--global-option": "--cpp_ext --cuda_ext",
}