From 2207309f8a527afac1ba52ee6cf57a64155c65a1 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Mon, 16 Oct 2023 18:38:24 -0400 Subject: [PATCH] Spack rules --- scripts/prequisites.sh | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 scripts/prequisites.sh diff --git a/scripts/prequisites.sh b/scripts/prequisites.sh new file mode 100755 index 00000000..c5bd9ed1 --- /dev/null +++ b/scripts/prequisites.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +if [ $1 = "install" ] +then + dir=`pwd` + cd $HOME + git clone -c feature.manyFiles=true https://github.com/spack/spack.git + source $HOME/spack/share/spack/setup-env.sh + + spack install autoconf + spack install automake + spack install c-lime cppflags=-fPIE + spack install fftw + spack install llvm + spack install gmp + spack install mpfr + spack install cuda@11.8 + spack install openmpi + spack install openssl + spack install hdf5 +else + source $HOME/spack/share/spack/setup-env.sh +fi + +spack load autoconf +spack load automake +spack load c-lime +spack load fftw +spack load llvm +spack load gmp +spack load mpfr +spack load cuda@11.8 +spack load openmpi +spack load openssl +spack load hdf5 + +export FFTW=`spack find --paths fftw | grep ^fftw | awk '{print $2}' ` +export HDF5=`spack find --paths hdf5 | grep ^hdf5 | awk '{print $2}' ` +export CLIME=`spack find --paths c-lime | grep ^c-lime | awk '{print $2}' ` +export MPFR=`spack find --paths mpfr | grep ^mpfr | awk '{print $2}' ` +export GMP=`spack find --paths gmp | grep ^gmp | awk '{print $2}' ` +export NVIDIA=$CUDA_HOME +export NVIDIALIB=$NVIDIA/targets/x86_64-linux/lib/ +export LD_LIBRARY_PATH=$NVIDIALIB:$FFTW/lib/:$MPFR/lib:$LD_LIBRARY_PATH