Skip to content

Commit

Permalink
modify the build script with more explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslg committed Feb 20, 2024
1 parent 8e22875 commit 22dac91
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
29 changes: 26 additions & 3 deletions build_spack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,35 @@ git clone --depth=1 -b v0.20.1 https://github.com/spack/spack.git
# can be mandatory if you have already used spack on your computer
# delete the .spack directory in the home of the user
#==========================================
# our recipes
git clone https://github.com/LIHPC-Computational-Geometry/spack_recipes.git
#==========================================
# hard-coded modifications to spack configuration

# this is used to declare opengl as non buildable and use the system library
cp ./spack_recipes/config/packages.yaml ./spack/etc/spack/

# to register our recipes; it assumes that spack_recipes and spack are located at
# the same level. You can use the "spack repo add" commands instead of copying the repos.yaml file
#spack repo add ./spack_recipes/meshing
#spack repo add ./spack_recipes/meshing_supersede
cp spack_recipes/config/repos.yaml spack/etc/spack/defaults/repos.yaml

#==========================================
# configure spack; it modifies the .spack directory in the user home
source ./spack/share/spack/setup-env.sh
spack repo add ./spack_recipes/meshing
spack repo add ./spack_recipes/meshing_supersede
spack compiler find
spack clean -a
spack external find cmake

spack compiler find
# spack uses the highest version of the compiler found by default; if it is incomplete,
# for example the C compiler is installed but not the CXX one the installations will fail.
# Compilers found can be investigated by (see `spack help compiler` commands)
#spack compiler list
#spack compiler info gcc
# An undesirable version can be removed by editing ~/.spack/linux/compilers.yaml or using
#spack compiler remove gcc@12

#==========================================

# +mpi should actually be ok, but currently the default openmpi install fails
Expand All @@ -25,6 +44,10 @@ spack spec magix3d ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mp
git clone git@github.com:LIHPC-Computational-Geometry/magix3d.git
spack dev-build -d ./magix3d magix3d@2.2.7 ^vtk-maillage~opengl2+qt~mpi ^hdf5~mpi ^cgns~mpi ^mesquite~mpi

# to configure an IDE
# get the CMAKE_PREFIX_PATH with ';' as separators
#spack load --only dependencies --sh magix3d | grep CMAKE_PREFIX_PATH | awk -F "=" {'print $2'} | sed 's/:/;/g'

#==========================================
# testing the install
#export PYTHONPATH=spack/opt/spack/gmds/lib:$PYTHONPATH
Expand Down
16 changes: 16 additions & 0 deletions config/repos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -------------------------------------------------------------------------
# This is the default spack repository configuration. It includes the
# builtin spack package repository.
#
# Users can override these settings by editing the following files.
#
# Per-spack-instance settings (overrides defaults):
# $SPACK_ROOT/etc/spack/repos.yaml
#
# Per-user settings (overrides default and site settings):
# ~/.spack/repos.yaml
# -------------------------------------------------------------------------
repos:
- $spack/../spack_recipes/meshing
- $spack/../spack_recipes/meshing_supersede
- $spack/var/spack/repos/builtin

0 comments on commit 22dac91

Please sign in to comment.