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
This commit is contained in:
parent
f9a330ae99
commit
e7f1eeb7af
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user