Skip to content

Instantly share code, notes, and snippets.

@steindev
Last active July 12, 2022 13:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steindev/4cfd0e43ac4c4d6da1a5b474b317d458 to your computer and use it in GitHub Desktop.
Save steindev/4cfd0e43ac4c4d6da1a5b474b317d458 to your computer and use it in GitHub Desktop.
SPOCK@ORNL: Install PIConGPU dependencies to run 0.7.0-dev on the caar partition
#!/usr/bin/env bash
#
# Authors: Axel Huebl, Marco Garten, Klaus Steiniger
#
# last updated: 2022-03-02
PIC_BRANCH="dev"
# get PIConGPU profile
if [ ! -f "$PIC_PROFILE" ]; then
export PIC_PROFILE_NAME="$HOME/caar_picongpu.profile"
wget -O $PIC_PROFILE_NAME \
https://raw.githubusercontent.com/ComputationalRadiationPhysics/picongpu/dev/etc/picongpu/spock-ornl/caar_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
# Boost
if [ ! -d "$BOOST_ROOT" ]; then
cd $SOURCE_DIR
curl -L -s -o boost_1_74_0.tar.gz \
https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz
tar -xzf boost_1_74_0.tar.gz
cd boost_1_74_0/
./bootstrap.sh --with-libraries=atomic,chrono,context,date_time,fiber,filesystem,math,program_options,serialization,system,thread \
--prefix=$BOOST_ROOT
./b2 cxxflags="-std=c++17" -j4 && ./b2 install
fi
# c-blosc
if [ ! -d "$BLOSC_ROOT" ]; then
cd $SOURCE_DIR
git clone -b v1.21.1 https://github.com/Blosc/c-blosc.git \
$SOURCE_DIR/c-blosc
mkdir c-blosc-build
cd c-blosc-build
cmake -DCMAKE_INSTALL_PREFIX=$BLOSC_ROOT \
-DPREFER_EXTERNAL_ZLIB=ON \
$SOURCE_DIR/c-blosc
make install
fi
# PNGwriter
if [ ! -d "$PNGwriter_ROOT" ]; then
cd $SOURCE_DIR
git clone -b 0.7.0 https://github.com/pngwriter/pngwriter.git \
$SOURCE_DIR/pngwriter
mkdir pngwriter-build
cd pngwriter-build
cmake -DCMAKE_INSTALL_PREFIX=$PNGwriter_ROOT \
$SOURCE_DIR/pngwriter
make install
fi
# openPMD-api
if [ ! -d "OPENPMD_API_ROOT" ]; then
cd $SOURCE_DIR
git clone -b 0.14.4 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_PYTHON=ON \
-DCMAKE_INSTALL_PREFIX="$OPENPMD_API_ROOT"
make install
fi
cd $HOME
# get PIConGPU
if [ ! -d "$PICSRC" ]; then
git clone -b $PIC_BRANCH https://github.com/ComputationalRadiationPhysics/picongpu.git \
"$PICSRC"
fi
# 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