Skip to content
Snippets Groups Projects
Commit 1077da26 authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Try to install enstools with pip.

parent bb1a44b1
No related branches found
No related tags found
No related merge requests found
......@@ -6,10 +6,9 @@ SPACK_URL=%spack.url%
SPACK_BRANCH=%spack.branch%
SPACK_COMPILER=%spack.compiler%
# If the workdir directory does not exist create it
if [ ! -d ${WORKDIR} ] ; then
mkdir -p ${WORKDIR}
if [ ! -d ${WORKDIR} ]; then
mkdir -p ${WORKDIR}
fi
# Go to the working directory
......@@ -17,7 +16,7 @@ cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV=spack/share/spack/setup-env.sh
if [ ! -f ${SPACK_ENV} ] ; then
if [ ! -f ${SPACK_ENV} ]; then
git clone ${SPACK_URL} -b ${SPACK_BRANCH}
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
fi
......@@ -25,16 +24,30 @@ fi
# Setup the environment
source ${SPACK_ENV}
if [ $( spack find py-enstools-compression &> /dev/null ; echo $? ) -ne 0 ]; then
echo "Installing enstools-compression."
# Compile openmpi with schedulers=slurm
spack install py-enstools-compression
# Use spack to get a recent enough version of python3
if [ $(
spack find python@3.8: &>/dev/null
echo $?
) -ne 0 ]; then
echo "Installing a version of python3"
# Compile openmpi with schedulers=slurm
spack install python3@3.8:
else
echo "py-enstools-compression already installed!"
echo "py-enstools-compression already installed!"
fi
# Link the python binary into the main folder so can be easily used later:
spack load py-enstools-compression
ln -sf $(which python3) ${WORKDIR}/python3
\ No newline at end of file
spack load python@3.8:
# Create virtual environment
python3 -m venv --prompt AS venv
# Load environment
source venv/bin/activate
# Create a link to the binary
ln -sf $(which python3) ${WORKDIR}/python3
# Install enstools-compression via pip
pip install enstools-compression
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment