# set env variable storing the path to the work directory export WORK=/afs/cern.ch/work/${USER:0:1}/$USER/ # clone warpx if [ ! -d "$WORK/warpx" ] then git clone https://github.com/ECP-WarpX/WarpX.git $WORK/warpx fi # activate the compiler source /cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-ad950/x86_64-centos7/setup.sh # download and activate spack if [ ! -d "$WORK/spack" ] then git clone -c feature.manyFiles=true https://github.com/spack/spack.git $WORK/spack source $WORK/spack/share/spack/setup-env.sh # add the compiler to spack spack compiler find /cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-ad950/x86_64-centos7/bin # create and activate the spack environment export SPACK_STACK_USE_PYTHON=1 export SPACK_STACK_USE_CUDA=1 spack env create warpx-lxplus-cuda-py $WORK/WarpX/Tools/machines/lxplus-cern/spack.yaml spack env activate warpx-lxplus-cuda-py spack install else # activate the spack environment source $WORK/spack/share/spack/setup-env.sh spack env activate warpx-lxplus-cuda-py fi export AMREX_CUDA_ARCH="7.0;7.5" # compiler environment hints export CC=$(which gcc) export CXX=$(which g++) export FC=$(which gfortran) export CUDACXX=$(which nvcc) export CUDAHOSTCXX=$(which g++)