Skip to content

VTK 9.4.1 #93

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

Open
wants to merge 2 commits into
base: computecanada-main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions easybuild/easyconfigs/v/VTK/VTK-9.4.1-GCC-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
easyblock = 'CMakeMake'

name = 'VTK'
version = '9.4.1'

homepage = 'http://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': 'GCC', 'version': '12.3.0'}

source_urls = ['https://www.vtk.org/files/release/%(version_major_minor)s']
sources = [
SOURCE_TAR_GZ,
'%(name)sData-%(version)s.tar.gz',
]
checksums = [
{'VTK-9.4.1.tar.gz': 'c253b0c8d002aaf98871c6d0cb76afc4936c301b72358a08d5f3f72ef8bc4529'},
{'VTKData-9.4.1.tar.gz': '188ef68f3decea56c7218877598ec0a84d838d35ff5d4f688d8867986c743114'},
]

multi_deps = { 'Python': ['3.13', '3.12', '3.11'] }

multi_deps_load_default = False

modextrapaths = {'EBPYTHONPREFIXES': ['']}

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

dependencies = [
('SciPy-Stack', '2024b'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not depend on Scipy-stack directly.

Better to have flexibility and have it in the modluafooter if required. But I think in this case we can remove the scipy-stack and simply use the numpy module as builddep

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccoulombe Interesting, I didn't know that there was a numpy module.

I did build it by first moving pretty every dependency to the builddeps as suggested, but it fails on the import vtk sanity check for Python 3.13 (the first version it tries):

== 2025-03-27 15:06:14,134 build_log.py:171 ERROR EasyBuild crashed with an error (at easybuild/tools/build_log.py:111 in caller_info): Sanity check failed: sanity check command python -c 'import vtk' exited with code 1 (output: Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import vtk
  File "/home/cwant/.local/easybuild/software/2023/x86-64-v3/Compiler/gcc12/vtk/9.4.1/lib/python3.13/site-packages/vtk.py", line 26, in <module>
    from vtkmodules.vtkPythonContext2D import *
ImportError: /home/cwant/.local/easybuild/software/2023/x86-64-v3/Compiler/gcc12/vtk/9.4.1/lib/libvtkWrappingPythonCore3.11-9.4.so.1: undefined symbol: _Py_HashPointer
) (at easybuild/framework/easyblock.py:3674 in _sanity_check_step)

Is it interesting that it's an issue with 3.11 stuff?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ishh, that's not good. So I guess we were wrong, and that dirty bug is not resolved after all :( :(

('HDF5', '1.14.2'),
('netCDF', '4.9.2'),
]

separate_build_dir = True

configopts = ' '.join([
# Third party modules
"-DVTK_USE_SYSTEM_LZMA=ON",
"-DVTK_USE_SYSTEM_HDF5=ON",
"-DVTK_USE_SYSTEM_NETCDF=ON",
# Python
"-DVTK_WRAP_PYTHON=ON",
"-DVTK_PYTHON_VERSION=3",
"-DPYTHON_INCLUDE_DIR=$EBROOTPYTHON/include/python%(pyshortver)s",
"-DPYTHON_LIBRARY=$EBROOTPYTHON/lib/libpython%%(pyshortver)s.%s" % SHLIB_EXT,
"-DPython3_EXECUTABLE=$EBROOTPYTHON/bin/python",
# Other
"-DCMAKE_INSTALL_LIBDIR=lib",
])

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

postinstallcmds = [
'/cvmfs/soft.computecanada.ca/easybuild/bin/setrpaths.sh --path %(installdir)s/lib --add_path %(installdir)s/lib --any_interpreter',
] + [
"mkdir -p %(installdir)s/lib/python{py}/site-packages/{dist}-%(version)s.dist-info && echo -e 'Metadata-Version: 2.3\nName: {dist}\nVersion: %(version)s' > %(installdir)s/lib/python{py}/site-packages/{dist}-%(version)s.dist-info/METADATA".format(py=py, dist=name.lower())
for py in multi_deps['Python']
]

sanity_check_paths = {
'files': ['bin/vtk%s-%%(version_major_minor)s' % x for x in
['WrapJava', 'ParseJava', 'WrapPythonInit', 'WrapPython', 'WrapHierarchy']] +
['bin/vtkpython'],
'dirs': ['lib/python%(pyshortver)s/site-packages/', 'include/vtk-%(version_major_minor)s'],
}

sanity_check_commands = [('python', "-c 'import %(namelower)s'")]

moduleclass = 'vis'
68 changes: 68 additions & 0 deletions easybuild/easyconfigs/v/VTK/VTK-9.4.1-gompi-2023a-mpi.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
easyblock = 'CMakeMake'

name = 'VTK'
version = '9.4.1'
versionsuffix = '-mpi'

homepage = 'http://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': 'gompi', 'version': '2023a'}
toolchainopts = {'usempi': True}

source_urls = ['https://www.%(namelower)s.org/files/release/%(version_major_minor)s']
sources = [
SOURCE_TAR_GZ,
'%(name)sData-%(version)s.tar.gz',
]
checksums = [
{'VTK-9.4.1.tar.gz': 'c253b0c8d002aaf98871c6d0cb76afc4936c301b72358a08d5f3f72ef8bc4529'},
{'VTKData-9.4.1.tar.gz': '188ef68f3decea56c7218877598ec0a84d838d35ff5d4f688d8867986c743114'},
]

builddependencies = [
('CMake', '3.27.7', '', SYSTEM),
]
dependencies = [
('SciPy-Stack', '2024b', '', SYSTEM),
('HDF5', '1.14.2'),
('netCDF', '4.9.2'),
]
multi_deps = {'Python': ['3.13', '3.12', '3.11']}

configopts = "-DVTK_USE_SYSTEM_LZMA=ON -DVTK_USE_SYSTEM_HDF5=ON -DVTK_USE_SYSTEM_NETCDF=ON -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3 -DPYTHON_INCLUDE_DIR=$EBROOTPYTHON/include/python%(pyshortver)s -DPYTHON_LIBRARY=$EBROOTPYTHON/lib/libpython%(pyshortver)s.so -DPython3_EXECUTABLE=$EBROOTPYTHON/bin/python -DCMAKE_INSTALL_LIBDIR=lib -DVTK_Group_MPI:BOOL=ON"


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

postinstallcmds = [
"/cvmfs/soft.computecanada.ca/easybuild/bin/setrpaths.sh --path %(installdir)s/lib --add_path %(installdir)s/lib --any_interpreter",
"""mkdir -p %(installdir)s/lib/python3.11/site-packages/%(namelower)s-%(version)s.dist-info && echo -e 'Metadata-Version: 2.3
Name: %(namelower)s
Version: %(version)s' > %(installdir)s/lib/python3.11/site-packages/%(namelower)s-%(version)s.dist-info/METADATA""",
"""mkdir -p %(installdir)s/lib/python3.12/site-packages/%(namelower)s-%(version)s.dist-info && echo -e 'Metadata-Version: 2.3
Name: %(namelower)s
Version: %(version)s' > %(installdir)s/lib/python3.12/site-packages/%(namelower)s-%(version)s.dist-info/METADATA""",
"""mkdir -p %(installdir)s/lib/python3.13/site-packages/%(namelower)s-%(version)s.dist-info && echo -e 'Metadata-Version: 2.3
Name: %(namelower)s
Version: %(version)s' > %(installdir)s/lib/python3.13/site-packages/%(namelower)s-%(version)s.dist-info/METADATA""",
]
multi_deps_load_default = False

sanity_check_paths = {
'files': ['bin/vtkWrapJava-%(version_major_minor)s', 'bin/vtkParseJava-%(version_major_minor)s', 'bin/vtkWrapPythonInit-%(version_major_minor)s', 'bin/vtkWrapPython-%(version_major_minor)s', 'bin/vtkWrapHierarchy-%(version_major_minor)s', 'bin/vtkpython'],
'dirs': ['lib/python%(pyshortver)s/site-packages/', 'include/%(namelower)s-%(version_major_minor)s', 'lib/python%(pyshortver)s/site-packages'],
}

sanity_check_commands = [
('python', "-c 'import %(namelower)s'"),
"""if [ -n "$(find %(installdir)s/lib*/python*/site-packages -name '*.egg*')" ] ; then echo 'Found .egg file, please use pip. See https://github.com/ComputeCanada/software-stack/issues/137' ; exit 1; else exit 0; fi""",
]

modextrapaths = {'EBPYTHONPREFIXES': ['']}

moduleclass = 'vis'