Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{vis}[foss/2022a] VTK v9.2.2 w/ Python 3.10.4 (+ use it as dependency of ITK 5.2.1) #16918

Merged
merged 2 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion easybuild/easyconfigs/i/ITK/ITK-5.2.1-foss-2022a.eb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
('libjpeg-turbo', '2.1.3'),
('libpng', '1.6.37'),
('LibTIFF', '4.3.0'),
('VTK', '9.2.0.rc2'),
('VTK', '9.2.2'),
('zlib', '1.2.12'),
]

Expand Down
87 changes: 87 additions & 0 deletions easybuild/easyconfigs/v/VTK/VTK-9.2.2-foss-2022a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
##
# Authors::
# * Fotis Georgatos <fotis@cern.ch>
# * Robert Mijakovic <robert.mijakovic@lxp.lu>
##

easyblock = 'CMakeMake'

name = 'VTK'
version = '9.2.2'

homepage = 'https://www.vtk.org'
description = """The Visualization Toolkit (VTK) is an open-source, freely available software system for
3D computer graphics, image processing and visualization. VTK consists of a C++ class library and several
interpreted interface layers including Tcl/Tk, Java, and Python. VTK supports a wide variety of visualization
algorithms including: scalar, vector, tensor, texture, and volumetric methods; and advanced modeling techniques
such as: implicit modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay triangulation."""

toolchain = {'name': 'foss', 'version': '2022a'}
toolchainopts = {'usempi': True}

source_urls = ['https://www.vtk.org/files/release/%(version_major_minor)s']
sources = [
SOURCE_TAR_GZ,
'%(name)sData-%(version)s.tar.gz',
]
patches = [('vtk-version.egg-info', '.')]
checksums = [
{'VTK-9.2.2.tar.gz': '1c5b0a2be71fac96ff4831af69e350f7a0ea3168981f790c000709dcf9121075'},
{'VTKData-9.2.2.tar.gz': '4b0ac438c77773ff741fd02c0e3b0dc1406b4c51e6cbe4e8304306fa125f27bf'},
{'vtk-version.egg-info': '787b82415ae7a4a1f815b4db0e25f7abc809a05fc85d7d219627f3a7e5d3867b'},
]

builddependencies = [('CMake', '3.23.1')]

dependencies = [
('Python', '3.10.4'),
('SciPy-bundle', '2022.05'),
('XZ', '5.2.5'),
('libGLU', '9.0.2'),
('X11', '20220504'),
]

separate_build_dir = True

# OpenGL
configopts = "-DOPENGL_glu_LIBRARY=$EBROOTLIBGLU/lib/libGLU.%s " % SHLIB_EXT
configopts += "-DOPENGL_gl_LIBRARY=$EBROOTMESA/lib/libGL.%s " % SHLIB_EXT
configopts += "-DOPENGL_INCLUDE_DIR=$EBROOTMESA/include "
# Python
configopts += "-DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3 -DVTK_PYTHON_OPTIONAL_LINK=OFF "
configopts += "-DPython3_ROOT_DIR=$EBROOTPYTHON "
# Other
configopts += "-DVTK_USE_MPI=ON "
configopts += "-DCMAKE_INSTALL_LIBDIR=lib"

preinstallopts = "export PYTHONPATH=%(installdir)s/lib/python%(pyshortver)s/site-packages:$PYTHONPATH && "

# Install a egg-info file so VTK is more python friendly, required for mayavi
local_egg_info_src = '%(builddir)s/VTK-%(version)s/vtk-version.egg-info'
local_egg_info_dest = '%(installdir)s/lib/python%(pyshortver)s/site-packages/vtk-%(version)s.egg-info'
postinstallcmds = [
'sed "s/#VTK_VERSION#/%%(version)s/" %s > %s' % (local_egg_info_src, local_egg_info_dest),
]

modextrapaths = {'PYTHONPATH': ['lib/python%(pyshortver)s/site-packages']}

local_vtk_exec = ['vtk%s-%%(version_major_minor)s' % x
for x in ['WrapJava', 'ParseJava', 'WrapPythonInit', 'WrapPython', 'WrapHierarchy']]
local_vtk_exec += ['vtkpython']
local_vtk_libs = ['CommonCore', 'IONetCDF', 'ParallelCore', 'RenderingOpenGL2']

sanity_check_paths = {
'files': ['bin/%s' % x for x in local_vtk_exec] + ['include/vtk-%(version_major_minor)s/vtkMPI.h'] +
['lib/libvtk%s-%%(version_major_minor)s.%s' % (l, SHLIB_EXT) for l in local_vtk_libs],
'dirs': ['lib/python%(pyshortver)s/site-packages/', 'include/vtk-%(version_major_minor)s'],
}

sanity_check_commands = [
"python -c 'import %(namelower)s'",
"python -c 'import pkg_resources; pkg_resources.get_distribution(\"vtk\")'",
# make sure that VTK Python libraries link to libpython (controlled via DVTK_PYTHON_OPTIONAL_LINK=OFF),
# see https://gitlab.kitware.com/vtk/vtk/-/issues/17881
"ldd $EBROOTVTK/lib/libvtkPythonContext2D-%%(version_major_minor)s.%s | grep /libpython" % SHLIB_EXT,
]

moduleclass = 'vis'