2021-04-01 13:49:53 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ENV=$1
|
|
|
|
|
2021-04-09 17:21:31 +02:00
|
|
|
## Set Sherman-Morrison root dir
|
2021-04-01 13:49:53 +02:00
|
|
|
PWD=$(pwd)
|
|
|
|
SRCDIR=$(dirname $BASH_SOURCE)
|
|
|
|
case $SRCDIR in
|
2021-04-09 17:21:31 +02:00
|
|
|
/*) SMROOT=$SRCDIR ;;
|
|
|
|
*)
|
|
|
|
if [[ $SRCDIR = . ]]
|
2021-04-06 16:17:42 +02:00
|
|
|
then
|
|
|
|
SMROOT=$PWD
|
|
|
|
else
|
|
|
|
SMROOT=$PWD/$SRCDIR
|
|
|
|
fi
|
|
|
|
;;
|
2021-04-01 13:49:53 +02:00
|
|
|
esac
|
|
|
|
export SMROOT
|
|
|
|
|
2021-04-09 17:21:31 +02:00
|
|
|
## Set environment for hdf5-tools and Makefile
|
2021-04-01 13:49:53 +02:00
|
|
|
case $ENV in
|
|
|
|
intel)
|
|
|
|
export HDF5_CXX=icpc
|
|
|
|
export HDF5_CXXLINKER=icpc
|
|
|
|
export ENV=INTEL
|
|
|
|
;;
|
|
|
|
llvm)
|
|
|
|
export HDF5_CXX=clang++
|
|
|
|
export HDF5_CXXLINKER=clang++
|
|
|
|
export ENV=LLVM
|
|
|
|
;;
|
|
|
|
gnu)
|
|
|
|
export HDF5_CXX=g++
|
|
|
|
export HDF5_CXXLINKER=g++
|
|
|
|
export ENV=GNU
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown environment descriptor given."
|
|
|
|
echo "Usage: source smvars.sh {intel | llvm | gnu}"
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-04-09 17:21:31 +02:00
|
|
|
## Export path, but only once
|
2021-04-06 16:17:42 +02:00
|
|
|
if [[ -z $SMVARS ]]
|
2021-04-01 13:49:53 +02:00
|
|
|
then
|
|
|
|
export PATH=$SMROOT/bin:$PATH
|
|
|
|
export SMVARS=true
|
|
|
|
fi
|