Skip to content

Instantly share code, notes, and snippets.

@finnolec
Created February 8, 2022 10:04
Show Gist options
  • Select an option

  • Save finnolec/5cbf7b7f633c1c17c36b669a43c6b575 to your computer and use it in GitHub Desktop.

Select an option

Save finnolec/5cbf7b7f633c1c17c36b669a43c6b575 to your computer and use it in GitHub Desktop.
hemera@HZDR: Install openPMD to run PIConGPU
#!/usr/bin/env bash
#
# Authors: Axel Huebl, Marco Garten, Klaus Steiniger, Finn-Ole Carstens
#
# last updated: 2021-11-10
#
# Based on https://gist.github.com/steindev/86df43bef49586e2b33d2fb0a372f09c
# It is advisable to compile libraries on an interactive node
# > srun -p gpu2-interactive --gres=gpu:0 --ntasks=1 --pty --mem=8G -t 2:00:00 bash # get resources on a node
# > ./install_PIConGPU_0.6.0-dev_dependencies_taurus.sh | tee lib_inst.out 2>lib_inst.err # compile libraries
PIC_BRANCH="dev"
# get PIConGPU profile
if [ ! -f "$PIC_PROFILE" ]; then
export PIC_PROFILE_NAME="$HOME/k80_picongpu.profile"
wget -O $PIC_PROFILE_NAME \
https://raw.githubusercontent.com/ComputationalRadiationPhysics/picongpu/dev/etc/picongpu/taurus-tud/k80_picongpu.profile.example
# load modules
source "$PIC_PROFILE_NAME"
else
source "$PIC_PROFILE"
fi
set -euf -o pipefail
# create temporary directory for software source files
export SOURCE_DIR="$HOME/lib_temp"
mkdir -p $SOURCE_DIR
# openPMD-api
if [ ! -d "$OPENPMD_ROOT" ]; then
echo "Installing openPMD-api..."
cd $SOURCE_DIR
git clone -b 0.14.3 https://github.com/openPMD/openPMD-api.git \
$SOURCE_DIR/openpmd-api
mkdir $SOURCE_DIR/openpmd-api-build
cd $SOURCE_DIR/openpmd-api-build
cmake $SOURCE_DIR/openpmd-api \
-DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF \
-DopenPMD_USE_ADIOS2=ON \
-DopenPMD_USE_HDF5=ON \
-DopenPMD_USE_PYTHON=ON \
-DHDF5_BUILD_CPP_LIB=OFF -DHDF5_ENABLE_PARALLEL=ON \
-DCMAKE_INSTALL_PREFIX="$OPENPMD_ROOT"
make install
fi
cd $HOME
# message to user
echo ''
echo 'edit user & email within picongpu.profile, e.g. via:'
echo ' vim $PIC_PROFILE'
echo 'delete temporary folder for library compilation'
printf " rm -rf %s\n" $SOURCE_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment