summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Lipsa <dan.lipsa@kitware.com>2019-06-11 12:50:22 -0400
committerChuck Atkins <chuck.atkins@kitware.com>2019-06-11 12:50:22 -0400
commit667e2f20fe1279fc55661e25755c436040e40955 (patch)
tree5928b677da25637c69aa7eac97ad57a0bbf06936
parent91205545f0ae22f98d069dcb65ca93f5bdef5053 (diff)
downloadspack-667e2f20fe1279fc55661e25755c436040e40955.tar.gz
spack-667e2f20fe1279fc55661e25755c436040e40955.tar.bz2
spack-667e2f20fe1279fc55661e25755c436040e40955.tar.xz
spack-667e2f20fe1279fc55661e25755c436040e40955.zip
Add support for using python3 in new verison of VTK. (#11673)
* Add support for python3 in new versions of VTK.
-rw-r--r--var/spack/repos/builtin/packages/vtk/package.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py
index 3ce93c5125..03a0b9bff1 100644
--- a/var/spack/repos/builtin/packages/vtk/package.py
+++ b/var/spack/repos/builtin/packages/vtk/package.py
@@ -30,6 +30,7 @@ class Vtk(CMakePackage):
variant('opengl2', default=True, description='Enable OpenGL2 backend')
variant('osmesa', default=False, description='Enable OSMesa support')
variant('python', default=False, description='Enable Python support')
+ variant('python3', default=False, description='Enable Python3 support')
variant('qt', default=False, description='Build with support for Qt')
variant('xdmf', default=False, description='Build XDMF file support')
variant('ffmpeg', default=False, description='Build with FFMPEG support')
@@ -40,10 +41,18 @@ class Vtk(CMakePackage):
# At the moment, we cannot build with both osmesa and qt, but as of
# VTK 8.1, that should change
conflicts('+osmesa', when='+qt')
+ conflicts('+python', when='+python3')
+ conflicts('+python3', when='@:8.0')
- depends_on('python', when='+python')
- depends_on('py-mpi4py', when='+mpi +python', type='run')
extends('python', when='+python')
+ extends('python', when='+python3')
+
+ depends_on('python@2.7:2.8', when='+python', type=('build', 'run'))
+ depends_on('python@3:', when='+python3', type=('build', 'run'))
+
+ depends_on('py-mpi4py', when='+python+mpi', type='run')
+ depends_on('py-mpi4py', when='+python3+mpi', type='run')
+
# python3.7 compatibility patch backported from upstream
# https://gitlab.kitware.com/vtk/vtk/commit/706f1b397df09a27ab8981ab9464547028d0c322
patch('python3.7-const-char.patch', when='@:8.1.1 ^python@3.7:')
@@ -133,7 +142,7 @@ class Vtk(CMakePackage):
cmake_args.extend(['-DModule_vtkIOFFMPEG:BOOL=ON'])
# Enable/Disable wrappers for Python.
- if '+python' in spec:
+ if '+python' in spec or '+python3' in spec:
cmake_args.extend([
'-DVTK_WRAP_PYTHON=ON',
'-DPYTHON_EXECUTABLE={0}'.format(spec['python'].command.path),