spack/var/spack/repos/builtin/packages/paraview/package.py

205 lines
8.1 KiB
Python
Raw Normal View History

# Copyright 2013-2019 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)
from spack import *
import os
2016-08-10 16:50:00 +08:00
class Paraview(CMakePackage):
"""ParaView is an open-source, multi-platform data analysis and
visualization application."""
homepage = 'http://www.paraview.org'
url = "http://www.paraview.org/files/v5.3/ParaView-v5.3.0.tar.gz"
_urlfmt = 'http://www.paraview.org/files/v{0}/ParaView-v{1}{2}.tar.gz'
2018-11-13 23:36:18 +08:00
version('5.6.0', sha256='cb8c4d752ad9805c74b4a08f8ae6e83402c3f11e38b274dba171b99bb6ac2460')
2018-10-04 10:34:38 +08:00
version('5.5.2', '7eb93c31a1e5deb7098c3b4275e53a4a')
version('5.5.1', 'a7d92a45837b67c3371006cc45163277')
version('5.5.0', 'a8f2f41edadffdcc89b37fdc9aa7f005')
version('5.4.1', '4030c70477ec5a85aa72d6fc86a30753')
version('5.4.0', 'b92847605bac9036414b644f33cb7163')
version('5.3.0', '68fbbbe733aa607ec13d1db1ab5eba71')
version('5.2.0', '4570d1a2a183026adb65b73c7125b8b0')
version('5.1.2', '44fb32fc8988fcdfbc216c9e40c3e925')
version('5.0.1', 'fdf206113369746e2276b95b257d2c9b')
version('4.4.0', 'fa1569857dd680ebb4d7ff89c2227378')
variant('plugins', default=True,
description='Install include files for plugins support')
variant('python', default=False, description='Enable Python support')
variant('mpi', default=True, description='Enable MPI support')
variant('osmesa', default=False, description='Enable OSMesa support')
variant('qt', default=False, description='Enable Qt (gui) support')
variant('opengl2', default=True, description='Enable OpenGL2 backend')
variant('examples', default=False, description="Build examples")
variant('hdf5', default=False, description="Use external HDF5")
depends_on('python@2:2.8', when='+python')
2016-03-09 23:46:56 +08:00
depends_on('py-numpy', when='+python', type='run')
# Matplotlib >2.x requires Python 3
depends_on('py-matplotlib@:2.99', when='+python', type='run')
depends_on('mpi', when='+mpi')
depends_on('qt+opengl', when='@5.3.0:+qt+opengl2')
depends_on('qt~opengl', when='@5.3.0:+qt~opengl2')
depends_on('qt@:4', when='@:5.2.0+qt')
depends_on('mesa+swrender', when='+osmesa')
depends_on('libxt', when='+qt')
conflicts('+qt', when='+osmesa')
depends_on('bzip2')
depends_on('freetype')
2016-08-10 16:50:00 +08:00
# depends_on('hdf5+mpi', when='+mpi')
# depends_on('hdf5~mpi', when='~mpi')
depends_on('hdf5+hl+mpi', when='+hdf5+mpi')
depends_on('hdf5+hl~mpi', when='+hdf5~mpi')
depends_on('jpeg')
depends_on('libpng')
depends_on('libtiff')
depends_on('libxml2')
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
depends_on('netcdf')
depends_on('expat')
2016-08-10 16:50:00 +08:00
# depends_on('netcdf-cxx')
# depends_on('protobuf') # version mismatches?
# depends_on('sqlite') # external version not supported
depends_on('zlib')
depends_on('cmake@3.3:', type='build')
2016-03-21 23:24:36 +08:00
patch('stl-reader-pv440.patch', when='@4.4.0')
# Broken gcc-detection - improved in 5.1.0, redundant later
patch('gcc-compiler-pv501.patch', when='@:5.0.1')
# Broken installation (ui_pqExportStateWizard.h) - fixed in 5.2.0
patch('ui_pqExportStateWizard.patch', when='@:5.1.2')
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
# Broken vtk-m config. Upstream catalyst changes
patch('vtkm-catalyst-pv551.patch', when='@5.5.0:5.5.2')
def url_for_version(self, version):
"""Handle ParaView version-based custom URLs."""
if version < Version('5.1.0'):
return self._urlfmt.format(version.up_to(2), version, '-source')
else:
return self._urlfmt.format(version.up_to(2), version, '')
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
@property
def paraview_subdir(self):
"""The paraview subdirectory name as paraview-major.minor"""
return 'paraview-{0}'.format(self.spec.version.up_to(2))
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
if os.path.isdir(self.prefix.lib64):
lib_dir = self.prefix.lib64
else:
lib_dir = self.prefix.lib
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
spack_env.set('ParaView_DIR', self.prefix)
spack_env.set('PARAVIEW_VTK_DIR',
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
join_path(lib_dir, 'cmake', self.paraview_subdir))
def setup_environment(self, spack_env, run_env):
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
# paraview 5.5 and later
# - cmake under lib/cmake/paraview-5.5
# - libs under lib
# - python bits under lib/python2.8/site-packages
if os.path.isdir(self.prefix.lib64):
lib_dir = self.prefix.lib64
else:
lib_dir = self.prefix.lib
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
run_env.set('ParaView_DIR', self.prefix)
run_env.set('PARAVIEW_VTK_DIR',
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
join_path(lib_dir, 'cmake', self.paraview_subdir))
if self.spec.version <= Version('5.4.1'):
lib_dir = join_path(lib_dir, self.paraview_subdir)
run_env.prepend_path('LIBRARY_PATH', lib_dir)
run_env.prepend_path('LD_LIBRARY_PATH', lib_dir)
if '+python' in self.spec:
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
if self.spec.version <= Version('5.4.1'):
pv_pydir = join_path(lib_dir, 'site-packages')
run_env.prepend_path('PYTHONPATH', pv_pydir)
run_env.prepend_path('PYTHONPATH', join_path(pv_pydir, 'vtk'))
else:
python_version = self.spec['python'].version.up_to(2)
run_env.prepend_path('PYTHONPATH', join_path(lib_dir,
'python{0}'.format(python_version),
'site-packages'))
def cmake_args(self):
"""Populate cmake arguments for ParaView."""
spec = self.spec
def variant_bool(feature, on='ON', off='OFF'):
"""Ternary for spec variant to ON/OFF string"""
if feature in spec:
return on
return off
def nvariant_bool(feature):
"""Negated ternary for spec variant to OFF/ON string"""
return variant_bool(feature, on='OFF', off='ON')
rendering = variant_bool('+opengl2', 'OpenGL2', 'OpenGL')
includes = variant_bool('+plugins')
cmake_args = [
'-DPARAVIEW_BUILD_QT_GUI:BOOL=%s' % variant_bool('+qt'),
'-DVTK_OPENGL_HAS_OSMESA:BOOL=%s' % variant_bool('+osmesa'),
'-DVTK_USE_X:BOOL=%s' % nvariant_bool('+osmesa'),
'-DVTK_RENDERING_BACKEND:STRING=%s' % rendering,
'-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s' % includes,
'-DBUILD_TESTING:BOOL=OFF',
'-DBUILD_EXAMPLES:BOOL=%s' % variant_bool('+examples'),
'-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON',
'-DVTK_USE_SYSTEM_HDF5:BOOL=%s' % variant_bool('+hdf5'),
'-DVTK_USE_SYSTEM_JPEG:BOOL=ON',
'-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON',
openFOAM-paraview-catalyst (#10129) * paraview: adding variants to use external packages as internal do not compile * paraview: add latest paraview version * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: add latest catalyst version * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * paraview: added missing self to a member variable * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * of-catalyst: added full variant and openfoam version dependency * paraview: adding variants to use external packages as internal do not compile * catalyst: fixed libvtkexpat undefined reference linking error in Catalyst 5.5 * catalyst: added ParaView_DIR env variable to catalyst module * add paraview, catalyst patches - https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 - https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 * - Handle updated library paths for catalyst. Versions 5.4 and old places libraries under a paraview subdirectory. Eg, "lib/paraview-5.4", they are now placed directly under "lib" - Minor code style cleanup * Handle update library and python paths for ParaView-5.5 * catalyst: added ParaView_DIR path to spack_env * BUG: applied the patch to the extracted catalyst source files * of-catalyst: added new package * add (FOAM,WM)_PROJECT_DIR also to spack_env environment * depends on first openfoam release supporting catalyst * paraview: added missing self to a member variable * openfoam-com: added missing env variables to module generation * openfoam: fixed flake8 errors * paraview: added Paraview_DIR to env * catalyst: added osmesa variant * of-catalyst: added full variant and openfoam version dependency * paraview-catalyst: use always external expat and netcdf * of-catalyst: reformatted package description * paraview-catalyst: removed duplicated function * catalyst: fixed flake8 error * of-catalyst: fixed license header * of-catalyst: minor changes * of-catalyst: renamed gitrepo with git * of-catalyst: removed useless gitrepo parameter
2018-12-24 03:40:25 +08:00
'-DVTK_USE_SYSTEM_NETCDF:BOOL=ON',
'-DVTK_USE_SYSTEM_EXPAT:BOOL=ON',
'-DVTK_USE_SYSTEM_TIFF:BOOL=ON',
'-DVTK_USE_SYSTEM_ZLIB:BOOL=ON',
]
# The assumed qt version changed to QT5 (as of paraview 5.2.1),
# so explicitly specify which QT major version is actually being used
if '+qt' in spec:
cmake_args.extend([
'-DPARAVIEW_QT_VERSION=%s' % spec['qt'].version[0],
])
if '+python' in spec:
cmake_args.extend([
'-DPARAVIEW_ENABLE_PYTHON:BOOL=ON',
Python command, libraries, and headers (#3367) ## Motivation Python installations are both important and unfortunately inconsistent. Depending on the Python version, OS, and the strength of the Earth's magnetic field when it was installed, the name of the Python executable, directory containing its libraries, library names, and the directory containing its headers can vary drastically. I originally got into this mess with #3274, where I discovered that Boost could not be built with Python 3 because the executable is called `python3` and we were telling it to use `python`. I got deeper into this mess when I started hacking on #3140, where I discovered just how difficult it is to find the location and name of the Python libraries and headers. Currently, half of the packages that depend on Python and need to know this information jump through hoops to determine the correct information. The other half are hard-coded to use `python`, `spec['python'].prefix.lib`, and `spec['python'].prefix.include`. Obviously, none of these packages would work for Python 3, and there's no reason to duplicate the effort. The Python package itself should contain all of the information necessary to use it properly. This is in line with the recent work by @alalazo and @davydden with respect to `spec['blas'].libs` and friends. ## Prefix For most packages in Spack, we assume that the installation directory is `spec['python'].prefix`. This generally works for anything installed with Spack, but gets complicated when we include external packages. Python is a commonly used external package (it needs to be installed just to run Spack). If it was installed with Homebrew, `which python` would return `/usr/local/bin/python`, and most users would erroneously assume that `/usr/local` is the installation directory. If you peruse through #2173, you'll immediately see why this is not the case. Homebrew actually installs Python in `/usr/local/Cellar/python/2.7.12_2` and symlinks the executable to `/usr/local/bin/python`. `PYTHONHOME` (and presumably most things that need to know where Python is installed) needs to be set to the actual installation directory, not `/usr/local`. Normally I would say, "sounds like user error, make sure to use the real installation directory in your `packages.yaml`". But I think we can make a special case for Python. That's what we decided in #2173 anyway. If we change our minds, I would be more than happy to simplify things. To solve this problem, I created a `spec['python'].home` attribute that works the same way as `spec['python'].prefix` but queries Python to figure out where it was actually installed. @tgamblin Is there any way to overwrite `spec['python'].prefix`? I think it's currently immutable. ## Command In general, Python 2 comes with both `python` and `python2` commands, while Python 3 only comes with a `python3` command. But this is up to the OS developers. For example, `/usr/bin/python` on Gentoo is actually Python 3. Worse yet, if someone is using an externally installed Python, all 3 commands may exist in the same directory! Here's what I'm thinking: If the spec is for Python 3, try searching for the `python3` command. If the spec is for Python 2, try searching for the `python2` command. If neither are found, try searching for the `python` command. ## Libraries Spack installs Python libraries in `spec['python'].prefix.lib`. Except on openSUSE 13, where it installs to `spec['python'].prefix.lib64` (see #2295 and #2253). On my CentOS 6 machine, the Python libraries are installed in `/usr/lib64`. Both need to work. The libraries themselves change name depending on OS and Python version. For Python 2.7 on macOS, I'm seeing: ``` lib/libpython2.7.dylib ``` For Python 3.6 on CentOS 6, I'm seeing: ``` lib/libpython3.so lib/libpython3.6m.so.1.0 lib/libpython3.6m.so -> lib/libpython3.6m.so.1.0 ``` Notice the `m` after the version number. Yeah, that's a thing. ## Headers In Python 2.7, I'm seeing: ``` include/python2.7/pyconfig.h ``` In Python 3.6, I'm seeing: ``` include/python3.6m/pyconfig.h ``` It looks like all Python 3 installations have this `m`. Tested with Python 3.2 and 3.6 on macOS and CentOS 6 Spack has really nice support for libraries (`find_libraries` and `LibraryList`), but nothing for headers. Fixed.
2017-04-30 08:24:13 +08:00
'-DPYTHON_EXECUTABLE:FILEPATH=%s' % spec['python'].command.path
])
if '+mpi' in spec:
cmake_args.extend([
'-DPARAVIEW_USE_MPI:BOOL=ON',
'-DMPIEXEC:FILEPATH=%s/bin/mpiexec' % spec['mpi'].prefix,
'-DMPI_CXX_COMPILER:PATH=%s' % spec['mpi'].mpicxx,
'-DMPI_C_COMPILER:PATH=%s' % spec['mpi'].mpicc,
'-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc
])
if 'darwin' in spec.architecture:
cmake_args.extend([
'-DVTK_USE_X:BOOL=OFF',
'-DPARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON',
])
# Hide git from Paraview so it will not use `git describe`
# to find its own version number
if spec.satisfies('@5.4.0:5.4.1'):
cmake_args.extend([
'-DGIT_EXECUTABLE=FALSE'
])
return cmake_args