Skip to content

Commit 85c7f95

Browse files
committed
additionnal comment in the build script
1 parent 620c946 commit 85c7f95

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

build_spack.sh

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@ git clone --depth=1 -b v0.20.1 https://github.com/spack/spack.git
55
# can be mandatory if you have already used spack on your computer
66
# delete the .spack directory in the home of the user
77
#==========================================
8-
# our recipes
8+
# get our recipes
99
git clone https://github.com/LIHPC-Computational-Geometry/spack_recipes.git
1010
#==========================================
11+
# modifying spack configuration
12+
#==========================================
1113
# hard-coded modifications to spack configuration
1214

15+
# Optionnal: modifying the install_tree variable to make it shorter and more human readable;
16+
# the HASH part in install directory names is removed which can lead to collisions.
17+
# The spack/etc/spack/defaults/config.yaml file can be modified by hand
18+
# - in spack version 0.19.2
19+
#sed -i 's#"${ARCHITECTURE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}"#"${PACKAGE}"#g' spack/etc/spack/defaults/config.yaml
20+
# - in spack version 0.20.1
21+
#sed -i 's#"{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}"#"{name}"#g' spack/etc/spack/defaults/config.yaml
22+
1323
# this is used to declare opengl as non buildable and use the system library
1424
cp ./spack_recipes/config/packages.yaml ./spack/etc/spack/
1525

@@ -19,12 +29,20 @@ cp ./spack_recipes/config/packages.yaml ./spack/etc/spack/
1929
#spack repo add ./spack_recipes/meshing_supersede
2030
cp spack_recipes/config/repos.yaml spack/etc/spack/defaults/repos.yaml
2131

32+
# Optionnal: the default tmpdir used to build is defined in spack/etc/spack/defaults/config.yaml
33+
# under the entry build_stage: $tempdir/$user/spack-stage
34+
# Should one prefer to use a tmpfs or has limited disk space in the temporary dir (Qt's build directory can require up to 6Go on my setup)
35+
# this entry can be modified
36+
2237
#==========================================
23-
# configure spack; it modifies the .spack directory in the user home
24-
source ./spack/share/spack/setup-env.sh
38+
# configure spack using spack commands; it modifies the .spack directory in the user home
39+
source spack/share/spack/setup-env.sh
2540
spack clean -a
41+
42+
# registering cmake
2643
spack external find cmake
2744

45+
# registering compilers
2846
spack compiler find
2947
# spack uses the highest version of the compiler found by default; if it is incomplete,
3048
# for example the C compiler is installed but not the CXX one the installations will fail.
@@ -35,19 +53,30 @@ spack compiler find
3553
#spack compiler remove gcc@12
3654

3755
#==========================================
56+
# for regular install
3857

3958
# +mpi should actually be ok, but currently the default openmpi install fails
40-
spack spec magix3d ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
41-
#spack install magix3d ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
59+
#spack spec magix3d+smooth3d+triton2+doc ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
60+
#spack install magix3d+smooth3d+triton2+doc ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
4261

43-
# to work on the main branch
62+
# install for dev purposes
4463
git clone [email protected]:LIHPC-Computational-Geometry/magix3d.git
45-
spack dev-build -d ./magix3d [email protected] ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
64+
# you will probably want build_type=Debug or RelWithDebInfo.
65+
# Choose the variants you need, you can check them using `spack info gmds`.
66+
# The dev_path option does not seem to handle relative paths.
67+
spack install magix3d+smooth3d+triton2+doc dev_path=$PWD/magix3d build_type=Debug ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi
4668

4769
# to configure an IDE
70+
# spack created files and directories named gmds/spack-* in the gmds source tree, where the necessary
71+
# options are set up
4872
# get the CMAKE_PREFIX_PATH with ';' as separators
73+
cat magix3d/spack-build-env.txt | grep CMAKE_PREFIX_PATH | awk -F "=" {'print $2'} | awk -F ";" {'print $1'} | sed 's/:/;/g'
4974
#spack load --only dependencies --sh magix3d | grep CMAKE_PREFIX_PATH | awk -F "=" {'print $2'} | sed 's/:/;/g'
5075

76+
# Note: I have issues building the doc this way, I guess other variables from spack-build-env.txt
77+
# are required. In this case -DWITH_DOC:BOOL=OFF can be specified
78+
cat gmds/spack-configure-args.txt
79+
5180
#==========================================
5281
# testing the install
5382
#export PYTHONPATH=spack/opt/spack/gmds/lib:$PYTHONPATH

0 commit comments

Comments
 (0)