Skip to content

Commit 96de0c3

Browse files
authored
Merge pull request easybuilders#23365 from sassy-crick/20250709151442_new_pr_LavaVu199
{devel,vis}[foss/2023b] LavaVu v1.9.9, Underworld v2.16.4
2 parents 4b33951 + 6177b8d commit 96de0c3

3 files changed

Lines changed: 191 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Thanks to Mikael Öhman, Alexandre Strube and Alex Domingo for helping with
2+
# the Python problem
3+
# Author: J. Saßmannshausen (Imperial College London / UK)
4+
# Use this version for any GUI installations you want to do
5+
6+
easyblock = 'PythonBundle'
7+
8+
name = 'LavaVu'
9+
version = '1.9.9'
10+
versionsuffix = '-egl'
11+
12+
homepage = 'https://lavavu.github.io/Documentation/'
13+
description = """
14+
A lightweight scientific visualisation tool with a python interface for fast
15+
and flexible visual analysis.
16+
17+
LavaVu provides access to OpenGL powered 3D rendering of point, line, surface
18+
and volume data with minimal setup and an interface focused on simple mapping
19+
of values to visual properties while abstracting all the intricacies of OpenGL.
20+
A scientific visualisation tool with a python interface for fast and flexible
21+
visual analysis.
22+
"""
23+
citing = """
24+
[1] Stegman, D.R., Moresi, L., Turnbull, R., Giordani, J., Sunter, P., Lo, A.
25+
and S. Quenette
26+
gLucifer: Next Generation Visualization Framework for High performance
27+
computational geodynamics, 2008, Visual Geosciences
28+
http://dx.doi.org/10.1007/s10069-008-0010-2
29+
[2] Ruijters, Daniel & ter Haar Romeny, Bart & Suetens, Paul. (2008).
30+
Efficient GPU-Based Texture Interpolation using Uniform B-Splines.
31+
J. Graphics Tools. 13. 61-69.
32+
http://dx.doi.org/10.1080/2151237X.2008.10129269
33+
34+
Zenodo: https://doi.org/10.5281/zenodo.2585376
35+
"""
36+
37+
toolchain = {'name': 'foss', 'version': '2023b'}
38+
39+
builddependencies = [
40+
('SWIG', '4.1.1'),
41+
]
42+
43+
dependencies = [
44+
('Python', '3.11.5'),
45+
('SciPy-bundle', '2023.11'),
46+
('Python-bundle-PyPI', '2023.10'),
47+
('X11', '20231019'),
48+
('FFmpeg', '6.0'),
49+
('libglvnd', '1.7.0'),
50+
('aiohttp', '3.9.5'),
51+
('jupyter-server-proxy', '4.1.2'),
52+
('matplotlib', '3.8.2'),
53+
('Mesa', '23.1.9'),
54+
]
55+
56+
# We need to run a post-install command, and that way it hopefully makes it
57+
# easier to maintain. Thanks to Davide Grassano for helping out here.
58+
_lavavu_dir = '%(installdir)s/lib/python%(pyshortver)s/site-packages/lavavu'
59+
_lavavu_postinstall_cmd = ' && '.join([
60+
f'rm -f {_lavavu_dir}/osmesa/LavaVuPython.py',
61+
f'cp -f {_lavavu_dir}/LavaVuPython.py {_lavavu_dir}/osmesa/',
62+
f'cd {_lavavu_dir}/osmesa/',
63+
'sed -i "9,11d" LavaVuPython.py',
64+
'sed -i "s/ import _LavaVuPython/import _LavaVuPython/" LavaVuPython.py',
65+
'cd -',
66+
])
67+
68+
exts_list = [
69+
('numpy_quaternion', '2024.0.9', {
70+
'modulename': 'quaternion',
71+
'checksums': ['de0125055bb2fed019c1afe8fe5a9844739a46196a1ee8838fa6b6b2a149aaad'],
72+
}),
73+
('lavavu', version, {
74+
# Possible choices: EGL, OSMESA or X11
75+
'prebuildopts': 'export LV_EGL=1 && ',
76+
# The original symlink leads to problems, so we are doing this dance to get that fixed:
77+
'postinstallcmds': [_lavavu_postinstall_cmd],
78+
'checksums': ['7e31c0d18b8bff3690101df3b12d883c2fdfdada3d88b15b082559b77d7c416d'],
79+
}),
80+
]
81+
82+
moduleclass = 'vis'
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Author: J. Saßmannshausen (Imperial College London/UK)
2+
3+
easyblock = 'PythonBundle'
4+
5+
name = 'Underworld'
6+
version = '2.16.4'
7+
versionsuffix = '-egl'
8+
9+
homepage = 'https://www.underworldcode.'
10+
description = """
11+
Underworld is a Python API (Application Programming Interface) which provides
12+
functionality for the modelling of geodynamics processes, and is designed to
13+
work (almost) seamlessly across PC, cloud and HPC infrastructure. Primarily
14+
the API consists of a set of Python classes from which numerical geodynamics
15+
models may be constructed. The API also provides the tools required for inline
16+
analysis and data management. For scalability across multiprocessor platforms,
17+
MPI (Message Passing Interface) is leveraged, and for performant operation all
18+
heavy computations are executed within a statically typed layer.
19+
Note: This version does not come with badlands.
20+
"""
21+
22+
citing = """
23+
Mansour, J., Giordani, J., Moresi, L., Beucher, R., Kaluza, O., Velic, M.,
24+
Farrington, R., Quenette, S., Beall, A., 2020, Underworld2:
25+
Python Geodynamics Modelling for Desktop, HPC and Cloud,
26+
Journal of Open Source Software, 5(47), 1797,
27+
https://doi.org/10.21105/joss.01797
28+
29+
Beucher et al., (2019). UWGeodynamics: A teaching and research tool for
30+
numerical geodynamic modelling.
31+
Journal of Open Source Software, 4(36), 1136,
32+
https://doi.org/10.21105/joss.01136
33+
34+
Zenodo: https://doi.org/10.5281/zenodo.1436039
35+
"""
36+
37+
toolchain = {'name': 'foss', 'version': '2023b'}
38+
39+
builddependencies = [
40+
('CMake', '3.27.6'),
41+
('Ninja', '1.11.1'),
42+
('SWIG', '4.1.1'),
43+
('pkgconf', '2.0.3'),
44+
('Xvfb', '21.1.9'), # for virtual display during tests
45+
('hatchling', '1.18.0'),
46+
('pytest', '8.2.2'), # required for testing, must be after hatchling to work
47+
]
48+
49+
dependencies = [
50+
('Python', '3.11.5'),
51+
('SciPy-bundle', '2023.11'),
52+
('Python-bundle-PyPI', '2023.10'),
53+
('PETSc', '3.22.5'),
54+
('HDF5', '1.14.3'),
55+
('libxml2', '2.11.5'),
56+
('LavaVu', '1.9.9', '-egl'), # more suited for graphical installations
57+
('h5py', '3.11.0'),
58+
('mpi4py', '3.1.5'),
59+
('Pint', '0.24'),
60+
]
61+
62+
exts_list = [
63+
('nbmake', '1.5.5', {
64+
'checksums': ['239dc868ea13a7c049746e2aba2c229bd0f6cdbc6bfa1d22f4c88638aa4c5f5c'],
65+
}),
66+
('underworld', version, {
67+
'patches': ['Underworld-2.16.4_ninja-job.patch'],
68+
'preinstallopts': "export UNDERWORLD_BUILD_PARALLEL=%(parallel)s && ",
69+
'source_urls': ['https://github.com/underworldcode/underworld2/archive'],
70+
'sources': ['v%(version)s.tar.gz'],
71+
'checksums': [
72+
{'v2.16.4.tar.gz': '70b2ccadc4917b82cf64819956acf2a0c8b69fcb3117188e801ef435da2c2f28'},
73+
{'Underworld-2.16.4_ninja-job.patch': 'e2bc7ce830b55ed88ff0ac58373b3b973e86a38f01809f54968ce4794c10bc1a'},
74+
],
75+
'testinstall': True,
76+
'runtest': 'xvfb-run pytest -vvv docs/pytests/tests.py '
77+
'docs/pytests/test_examples.py docs/pytests/test_user_guide.py '
78+
79+
}),
80+
]
81+
82+
postinstallcmds = ['cp -R docs %(installdir)s/']
83+
84+
moduleclass = 'geo'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Without that patch, Ninja is taken over the node and uses every available core
2+
The patch is using the UNDERWORLD_BUILD_PARALLEL variable, so set, else it is falling back to
3+
use 4 cores. The UNDERWORLD_BUILD_PARALLEL is either set in the EasyConfig file, or comes from
4+
an environment variable. The latter is what Kenneth Hoste suggested so it can be used upstream
5+
as well
6+
Author: J. Saßmannshausen (Imperial College London/UK)
7+
diff --git a/underworld2-2.16.4.orig/setup.py b/underworld2-2.16.4/setup.py
8+
index 4c09b49..43c259b 100755
9+
--- a/underworld2-2.16.4.orig/setup.py
10+
+++ b/underworld2-2.16.4/setup.py
11+
@@ -221,7 +221,13 @@ class BuildExtension(build_ext):
12+
['cmake', '-S', ext.source_dir, '-B', build_folder] + configure_args
13+
14+
# 2. Compose CMake build command
15+
- build_command = ['cmake', '--build', build_folder] + build_args
16+
+ env_var = 'UNDERWORLD_BUILD_PARALLEL'
17+
+ if env_var in os.environ:
18+
+ number_cpus = os.environ['UNDERWORLD_BUILD_PARALLEL']
19+
+ else:
20+
+ number_cpus = '4'
21+
+
22+
+ build_command = ['cmake', '--build', build_folder, '-j', str(number_cpus)] + build_args
23+
24+
# 3. Compose CMake install command
25+
install_command = ['cmake', '--install', build_folder]

0 commit comments

Comments
 (0)