summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2020-03-20 05:08:54 -0400
committerGitHub <noreply@github.com>2020-03-20 10:08:54 +0100
commit9a71a7646130017c767a3a85c642fc2b097d824d (patch)
tree56a61f8bb794419993c013370d240cf29c84bead /var
parentfdf363eaadb7edea5c9d9b15e043449742484db9 (diff)
downloadspack-9a71a7646130017c767a3a85c642fc2b097d824d.tar.gz
spack-9a71a7646130017c767a3a85c642fc2b097d824d.tar.bz2
spack-9a71a7646130017c767a3a85c642fc2b097d824d.tar.xz
spack-9a71a7646130017c767a3a85c642fc2b097d824d.zip
py-tfdlpack: add new package (#15583)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-tfdlpack/package.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-tfdlpack/package.py b/var/spack/repos/builtin/packages/py-tfdlpack/package.py
new file mode 100644
index 0000000000..678cc2d6db
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-tfdlpack/package.py
@@ -0,0 +1,45 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+class PyTfdlpack(CMakePackage):
+ """Tensorflow plugin for DLPack."""
+
+ homepage = "https://github.com/VoVAllen/tf-dlpack"
+ git = "https://github.com/VoVAllen/tf-dlpack.git"
+
+ maintainers = ['adamjstewart']
+
+ version('master', branch='master', submodules=True)
+ version('0.1.1', tag='v0.1.1', submodules=True)
+
+ variant('cuda', default=True, description='Build with CUDA support')
+
+ depends_on('cmake@3.5:', type='build')
+ depends_on('cuda', when='+cuda')
+
+ # Python dependencies
+ extends('python')
+ depends_on('py-setuptools', type='build')
+ depends_on('py-tensorflow', type=('build', 'run'))
+
+ def cmake_args(self):
+ args = ['-DPYTHON_EXECUTABLE=' + self.spec['python'].command.path]
+
+ if '+cuda' in self.spec:
+ args.append('-DUSE_CUDA=ON')
+ else:
+ args.append('-DUSE_CUDA=OFF')
+
+ return args
+
+ def install(self, spec, prefix):
+ with working_dir('python'):
+ setup_py('install', '--prefix=' + prefix,
+ '--single-version-externally-managed', '--root=/')
+
+ def setup_run_environment(self, env):
+ # Prevent TensorFlow from taking over the whole GPU
+ env.set('TF_FORCE_GPU_ALLOW_GROWTH', 'true')