It is strongly recommended you bundle all your build process in a job script that you can submit in batch requesting additional cpus so that you can exploit . That way you can request additional cpus and speed up your compilation exploiting build parallelism with make -j If you would like a starting point for such a job, you can start from the following example, adding and amending the necessary bits as needed: Code Block |
---|
language | bash |
---|
title | build_cdo.sh |
---|
collapse | true |
---|
| #!/bin/bash
#SBATCH -J build_cdo
#SBATCH -o %x.out
#SBATCH -n 8
set -x
set -e
set -u
set -o pipefail
# Get the URL and VERSION for the latest CDO available
URL=$(curl -s https://code.mpimet.mpg.de/projects/cdo/files | grep attachments/download | sed -e "s:.*href=\"\(.*\)\".*:https\://code.mpimet.mpg.de\1:" | head -n 1)
VERSION=$(echo $URL | sed -e "s:.*/cdo-\(.*\).tar.gz:\1:")
# TODO: Define installation prefix and Build directory
# Hint: Use somewhere in your PERM for installation.
PREFIX=
BUILDDIR=
# Move to our BUILD DIRECTORY
mkdir -p $BUILDDIR
cd $BUILDDIR
# Download source
[ -f cdo-$VERSION.tar.gz ] || wget $URL
[ -d cdo-$VERSION ] || tar xvf cdo-$VERSION.tar.gz
cd cdo-$VERSION
# TODO: Define the environment for the build
# TODO: Configure the build
# Build
make -j $SLURM_NTASKS
# Install
make install
# Check installed binary
$PREFIX/bin/cdo -V |
|