summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Adamson <5460406+padamson@users.noreply.github.com>2021-08-10 02:05:26 -0400
committerGitHub <noreply@github.com>2021-08-10 08:05:26 +0200
commite44de970f8b6b713955417c9e0b514bef41bfa81 (patch)
treec60dd301f5c0902a5ebc44722fa3fcc32e38bcaa
parent5916afec849ae40fd2924364a77da72d262d4118 (diff)
downloadspack-e44de970f8b6b713955417c9e0b514bef41bfa81.tar.gz
spack-e44de970f8b6b713955417c9e0b514bef41bfa81.tar.bz2
spack-e44de970f8b6b713955417c9e0b514bef41bfa81.tar.xz
spack-e44de970f8b6b713955417c9e0b514bef41bfa81.zip
uqtk: add pyqutk variant to uqtk (#25298)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/uqtk/package.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/uqtk/package.py b/var/spack/repos/builtin/packages/uqtk/package.py
index 846b5bbfa7..43b0749811 100644
--- a/var/spack/repos/builtin/packages/uqtk/package.py
+++ b/var/spack/repos/builtin/packages/uqtk/package.py
@@ -18,11 +18,21 @@ class Uqtk(CMakePackage):
version('3.1.0', sha256='56ecd3d13bdd908d568e9560dc52cc0f66d7bdcdbe64ab2dd0147a7cf1734f97')
version('3.0.4', sha256='0a72856438134bb571fd328d1d30ce3d0d7aead32eda9b7fb6e436a27d546d2e')
+ variant('pyuqtk', default=True,
+ description='Compile Python scripts and interface to C++ libraries')
+
depends_on('expat')
depends_on('sundials', when='@3.1.0:')
depends_on('blas', when='@3.1.0:')
depends_on('lapack', when='@3.1.0:')
+ extends('python', when='+pyuqtk')
+ depends_on('py-numpy', when='+pyuqtk')
+ depends_on('py-scipy', when='+pyuqtk')
+ depends_on('py-matplotlib', when='+pyuqtk')
+ depends_on('py-pymc3', when='+pyuqtk')
+ depends_on('swig', when='+pyuqtk')
+
# Modify the process of directly specifying blas/lapack
# as the library name.
patch('remove_unique_libname.patch', when='@3.1.0:')
@@ -38,8 +48,19 @@ class Uqtk(CMakePackage):
lapack_libs = spec['lapack'].libs.joined(';')
blas_libs = spec['blas'].libs.joined(';')
- return [
- '-DCMAKE_SUNDIALS_DIR={0}'.format(spec['sundials'].prefix),
- '-DLAPACK_LIBRARIES={0}'.format(lapack_libs),
- '-DBLAS_LIBRARIES={0}'.format(blas_libs)
+ args = [
+ self.define('CMAKE_SUNDIALS_DIR', spec['sundials'].prefix),
+ self.define('LAPACK_LIBRARIES', lapack_libs),
+ self.define('BLAS_LIBRARIES', blas_libs),
+ self.define_from_variant('PyUQTk', 'pyuqtk')
]
+
+ return args
+
+ def setup_run_environment(self, env):
+ if '+pyuqtk' in self.spec:
+ env.prepend_path('PYTHONPATH', self.prefix)
+ env.prepend_path('PYTHONPATH', '{0}/PyUQTk'.format(self.prefix))
+ env.prepend_path('LD_LIBRARY_PATH', '{0}/PyUQTk/'.format(self.prefix))
+ env.set('UQTK_SRC', self.prefix)
+ env.set('UQTK_INS', self.prefix)