summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJen Herting <jen@herting.cc>2020-09-01 14:44:12 -0400
committerGitHub <noreply@github.com>2020-09-01 13:44:12 -0500
commite7f1eeb7af944f1977097b4da6e9a4c6e385c2fa (patch)
tree3abd3e7c87b5e9924fa70f5a9b4de22a4d032f41
parentf9a330ae9904db97a27e38890444def52f1d31b3 (diff)
downloadspack-e7f1eeb7af944f1977097b4da6e9a4c6e385c2fa.tar.gz
spack-e7f1eeb7af944f1977097b4da6e9a4c6e385c2fa.tar.bz2
spack-e7f1eeb7af944f1977097b4da6e9a4c6e385c2fa.tar.xz
spack-e7f1eeb7af944f1977097b4da6e9a4c6e385c2fa.zip
Update dependencies: py-torch-geometric (#18265)
* [py-torch-geometric] depends on py-torch-sparse * [py-torch-geometric] setting TORCH_CUDA_ARCH_LIST * [py-torch-geometric] added the rest of the dependencies * [py-torch-geometric] added cuda variant and added more build env vars * [py-torch-geometric] added variant info for depenedencies * [py-torch-geometric] flake8 * [py-torch-geometric] add variant description
-rw-r--r--var/spack/repos/builtin/packages/py-torch-geometric/package.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-torch-geometric/package.py b/var/spack/repos/builtin/packages/py-torch-geometric/package.py
index 84d633c261..a8fc7ed366 100644
--- a/var/spack/repos/builtin/packages/py-torch-geometric/package.py
+++ b/var/spack/repos/builtin/packages/py-torch-geometric/package.py
@@ -20,6 +20,8 @@ class PyTorchGeometric(PythonPackage):
version('1.6.0', sha256='7d5231cdcc2ebd4444f406cbf1537eb49bf90ab6f446eaf1b7af5cdbe105f3c9')
+ variant('cuda', default=False, description="Enable CUDA support")
+
depends_on('python@3.6:', type=('build', 'run'))
depends_on('py-setuptools', type='build')
depends_on('py-pytest-runner', type='build')
@@ -37,3 +39,24 @@ class PyTorchGeometric(PythonPackage):
depends_on('py-h5py~mpi', type=('build', 'run'))
depends_on('py-ase', type=('build', 'run'))
depends_on('py-jinja2', type=('build', 'run'))
+ depends_on('py-torch-sparse+cuda', when='+cuda', type=('build', 'run'))
+ depends_on('py-torch-scatter+cuda', when='+cuda', type=('build', 'run'))
+ depends_on('py-torch-cluster+cuda', when='+cuda', type=('build', 'run'))
+ depends_on('py-torch-spline-conv+cuda', when='+cuda', type=('build', 'run'))
+ depends_on('py-torch-sparse~cuda', when='~cuda', type=('build', 'run'))
+ depends_on('py-torch-scatter~cuda', when='~cuda', type=('build', 'run'))
+ depends_on('py-torch-cluster~cuda', when='~cuda', type=('build', 'run'))
+ depends_on('py-torch-spline-conv~cuda', when='~cuda', type=('build', 'run'))
+
+ def setup_build_environment(self, env):
+ if '+cuda' in self.spec:
+ cuda_arches = list(
+ self.spec['py-torch'].variants['cuda_arch'].value)
+ for i, x in enumerate(cuda_arches):
+ cuda_arches[i] = '{0}.{1}'.format(x[0:-1], x[-1])
+ env.set('TORCH_CUDA_ARCH_LIST', str.join(' ', cuda_arches))
+
+ env.set('FORCE_CUDA', '1')
+ env.set('CUDA_HOME', self.spec['cuda'].prefix)
+ else:
+ env.set('FORCE_CUDA', '0')