Skip to content

Commit 41e09f6

Browse files
committed
New hybrid approach to paraview install using cmake directly
Install dependencies using spack, but check out custom branches of paraview / VTK / vtkm to work around compilation issues with the default spack available branches. Compile using cmake and a build-env generated by creating a fake package with all the dependencies we need added into it and concretized with the original spack/stackinator generated environment
1 parent 2708f81 commit 41e09f6

File tree

6 files changed

+367
-23
lines changed

6 files changed

+367
-23
lines changed

recipes/paraview/gh200/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: prgenv-gnu
22
spack:
3-
commit: h5hut
3+
commit: jb-develop
44
repo: /bret/scratch/cscs/biddisco/spack-santis
55
store: /user-environment
66
description: ParaView + assorted other tools
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# read a yaml file and convert it to a spack package
2+
# usage: python env-to-package.py <env.yaml> <package-name>
3+
# example: python env-to-package.py paraview-env.yaml paraview
4+
5+
# load a yaml file
6+
import yaml
7+
import sys
8+
import os
9+
10+
packagename = "temppackage"
11+
packagenameU = packagename[0].upper() + packagename[1:]
12+
13+
# read the yaml file
14+
filename = sys.argv[1]
15+
with open(filename, 'r') as stream:
16+
try:
17+
env = yaml.safe_load(stream)
18+
except yaml.YAMLError as exc:
19+
print(exc)
20+
21+
# change the following generation of the file to a string with the same contents
22+
output = f"# This file was auto-generated from {filename}\n"
23+
output += "\n"
24+
output += "import itertools, os, sys\n"
25+
output += "from spack import *\n"
26+
output += "\n"
27+
output +=f"class {packagenameU}(CMakePackage):\n"
28+
output += " homepage = \"https://www.dummy.org/\"\n"
29+
output += " url = \"https://www.dummy.org/\"\n"
30+
output += " git = \"https://www.dummy.org/\"\n"
31+
output += "\n"
32+
output += " version(\"develop\", branch=\"main\")\n"
33+
34+
# extract the dependencies from the yaml specs section, assume 'spec' is one level down from top level key
35+
# doign this allows us to import an env from stackinator, or a regular env yaml file
36+
try:
37+
specs = env[list(env.keys())[0]]['specs']
38+
except KeyError:
39+
print("No specs found in the yaml file - is 'spec' a top level key?")
40+
sys.exit(1)
41+
42+
dependencies = []
43+
for spec in specs:
44+
output += f" depends_on(\"{spec}\")\n"
45+
#
46+
print(output)
47+
48+
# get SPACK_ROOT by executing shell command
49+
spack_package_root = os.popen('spack location -r').read().strip() + "/var/spack/repos/builtin/packages"
50+
51+
# create a subdir named after the package if the subdir doesn't already exist
52+
tempdir = os.path.join(spack_package_root, packagename)
53+
if not os.path.exists(tempdir):
54+
os.makedirs(tempdir)
55+
print('Writing temp package to ' + os.path.join(tempdir, 'package.py'))
56+
57+
# create a temp file in the directory
58+
tempfile = os.path.join(tempdir, 'package.py')
59+
with open(tempfile, 'w') as f:
60+
f.write(output)
61+
f.close()
62+
print(f"Temporary file {tempfile} has been created")
63+
64+
print(f'spackgen {packagename} "{packagename} %gcc" --reuse')
65+
66+
67+
# call spack to install the package - print error if it fails
68+
69+
#os.system(f"spack info {packagename}")
70+
#os.system(f'. /home/biddisco/opt/spack.git/share/spack/setup-env.sh ; /home/biddisco/src/_env/devenv/spackgen.sh temp "{packagename}%gcc" --reuse')
71+
72+
# rewrite /home/biddisco/src/_env/bash/devenv/spackgen.sh as a python script
73+
Lines changed: 107 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gcc-env:
1+
pv-egl-cuda:
22
compiler:
33
- toolchain: gcc
44
spec: gcc
@@ -7,37 +7,128 @@ gcc-env:
77
gpu: cuda
88
unify: true
99
specs:
10+
# Build tools
11+
- git-lfs
1012
- cmake
1113
- ninja
1214
- direnv
13-
- fftw
14-
- fmt
15-
- stdexec
16-
- boost +atomic +chrono +container +context +coroutine +date_time +filesystem +graph +json +mpi +multithreaded +program_options +regex +serialization +shared +system +test +thread
17-
- hdf5 +mpi
18-
- h5hut
1915
- ninja
20-
- openblas threads=openmp
16+
- llvm@14 ~gold ~cuda
17+
# maths
2118
- blaspp
19+
- eigen
20+
- fftw
2221
- lapackpp
23-
24-
22+
- openblas
23+
- proj
24+
# c++ helperrs
25+
- fmt
26+
- stdexec@main
27+
- boost +atomic +chrono +container +context +coroutine +date_time +filesystem +graph +json +mpi +multithreaded +program_options +regex +serialization +shared +system +test +thread
28+
# IO and parallelism
29+
- hdf5 +mpi +cxx +hl +threadsafe +shared ~java
30+
- netcdf-c +mpi
31+
- h5hut@master
32+
- lz4
33+
# cuda
2534
26-
- py-pandas
27-
- py-matplotlib
35+
# memory management
36+
- jemalloc
37+
- mimalloc
38+
# system
39+
- numactl
40+
# profiling/testing
41+
- gperftools
42+
- googletest
43+
# multithreading
2844
- tbb
45+
# in-situ support
46+
- libcatalyst +mpi
47+
# vtk external deps
48+
49+
50+
- gl2ps
51+
- glew gl=egl
52+
- jpeg
53+
- jsoncpp
54+
- libharu
55+
- libtiff
56+
- nlohmann-json
2957
- libtheora@master
58+
- pugixml
59+
# [email protected] - 3.21 to prevent abseil being pulled in @3.22:
60+
- protobuf@:3.21
61+
- seacas
62+
- utf8cpp
63+
# python
64+
65+
- py-pandas
66+
- py-matplotlib
67+
- py-mpi4py
68+
#- [email protected] +cuda cuda_arch=90
69+
#- vtk@master +egl +mpi +opengl2 +python +cuda
70+
# paraview@master +vtk +mpi +opengl2 +egl +catalyst ~raytracing +python use_vtkm=off +development_files build_edition=rendering
71+
72+
#- openimagedenoise@master
73+
#- ispc@main
3074
# - ospray
31-
# We turn off hdf5 because vtk::hdf5 needs the internal hdf5 not the external one
32-
- [email protected] +cuda +mpi ~hdf5 +opengl2 +tbb +raytracing +python use_vtkm=on +development_files build_edition=rendering
3375
variants:
76+
- build_type=Release
3477
- +mpi
3578
- +cuda
3679
- cuda_arch=90
3780
- ~fortran
38-
- build_type=Release
39-
- cxxstd=20
81+
- ~x11
4082
- ~examples
4183
views:
4284
default:
4385
link: roots
86+
87+
# pv-osmesa:
88+
# compiler:
89+
# - toolchain: gcc
90+
# spec: gcc
91+
# mpi:
92+
93+
# gpu: cuda
94+
# unify: true
95+
# specs:
96+
# - cmake
97+
# - ninja
98+
# - direnv
99+
# - fftw
100+
# - fmt
101+
# - stdexec
102+
# - boost +atomic +chrono +container +context +coroutine +date_time +filesystem +graph +json +mpi +multithreaded +program_options +regex +serialization +shared +system +test +thread
103+
# - hdf5 +mpi
104+
# - h5hut@master
105+
# - ninja
106+
# - llvm@14 ~gold ~cuda
107+
# - openblas
108+
# - blaspp
109+
# - lapackpp
110+
111+
112+
# - py-pandas
113+
# - py-matplotlib
114+
# - tbb
115+
# - libtheora@master
116+
# - [email protected] +cuda cuda_arch=90
117+
# - vtk@master +egl +mpi +opengl2 +python +cuda
118+
# - paraview@master +vtk +mpi +opengl2 +osmesa +tbb +raytracing +python use_vtkm=on +development_files build_edition=rendering
119+
120+
# #- openimagedenoise@master
121+
# #- ispc@main
122+
# # - ospray
123+
# # We turn off hdf5 because vtk::hdf5 needs the internal hdf5 not the external one
124+
# variants:
125+
# - +mpi
126+
# - +cuda
127+
# - cuda_arch=90
128+
# - ~fortran
129+
# - build_type=Release
130+
# - cxxstd=20
131+
# - ~examples
132+
# views:
133+
# default:
134+

recipes/paraview/gh200/packages.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
packages:
2+
all:
3+
providers:
4+
gl: [egl]
5+
egl:
6+
externals:
7+
8+
prefix: /usr
9+
buildable: false
10+
llvm:
11+
require: llvm ~gold ~cuda

0 commit comments

Comments
 (0)