#!/bin/bash set -e set -x # sudo apt install python[spack] gcc g++ make[gcc] zip[gcc/java] # wget https://raw.githubusercontent.com/eschnett/spack-test/master/spacktest-ubuntu16.sh # bash ./spacktest-ubuntu16.sh 2>&1 | tee spacktest.out installflags="-v" # Prepare directory basedir="$HOME/spacktest" rm -rf "$basedir" mkdir -p "$basedir" cd "$basedir" # # Get updated SSL certificates # curl -O https://curl.haxx.se/ca/cacert.pem # export CURL_CA_BUNDLE="$(pwd)/cacert.pem" # Download rm -rf "$HOME/.spack" rm -rf "/tmp/$USER/spack-stage" git clone https://github.com/LLNL/spack.git cd spack # Output git version git rev-parse HEAD # git pull source share/spack/setup-env.sh # Apply patches patch -p1 <"$HOME/fontconfig.patch" # llvm/spack#1686 # Install gcc systemcc="gcc@5.4.0" # Why `~binutils`? spack spec gcc ~binutils %"$systemcc" # Fetching is unstable for i in $(seq 1 10); do echo "Fetching gcc, attempt #$i..." spack fetch -D gcc ~binutils %"$systemcc" && break || true done spack fetch -D gcc ~binutils %"$systemcc" spack install $installflags gcc ~binutils %"$systemcc" # Tell Spack about this gcc osname="Ubuntu16" gccpath=$(spack find -p 'gcc@6.2.0' | awk '/ gcc.*@/ { print $2; }') compiler="gcc@6.2.0-spacktest" spack compiler remove "$compiler" || true cat >> "$HOME/.spack/compilers.yaml" <"$umbrelladir/package.py" <&1 # module refresh -l 2>&1 # spack view # "spack view symlink" is broken #1293 # spack view -d true symlink "$basedir/view" umbrella spack view -d true hardlink "$basedir/view" umbrella # lmod lmoddir="$basedir/view" # source "$lmoddir/lmod/lmod/init/bash" # source "$lmoddir/lmod/*/init/bash" source "$lmoddir/lmod/6.4.5/init/bash" # "module" is broken (a path seems truncated) # module avail -l 2>&1 # module refresh -l 2>&1 # TODO: spack load # TODO: spack uninstall, including uninstall by hash # TODO: abort build, then restart Spack # TODO: Test packages echo 'Done.'