Created
November 10, 2021 11:50
-
-
Save finnolec/3004deeb6251d1e76f2250f99a8a2170 to your computer and use it in GitHub Desktop.
taurus@TUD: Install PIConGPU dependencies to run on the partition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| # c-blosc | |
| if [ ! -d "$BLOSC_ROOT" ]; then | |
| echo "Installing Blosc..." | |
| 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 | |
| echo "Installing PNGwriter..." | |
| 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 | |
| # ADIOS2 | |
| if [ ! -d "$ADIOS2_ROOT" ]; then | |
| echo "Installing Adios2..." | |
| cd $SOURCE_DIR | |
| git clone -b v2.7.1 https://github.com/ornladios/ADIOS2.git \ | |
| $SOURCE_DIR/adios2 | |
| mkdir $SOURCE_DIR/adios2-build | |
| cd $SOURCE_DIR/adios2-build | |
| export CXXFLAGS="-fPIC" | |
| export CFLAGS="-fPIC" | |
| cmake $SOURCE_DIR/adios2 -DADIOS2_BUILD_EXAMPLES=OFF -DADIOS2_BUILD_TESTING=OFF \ | |
| -DCMAKE_INSTALL_PREFIX="$ADIOS2_ROOT" -DADIOS2_USE_Fortran=OFF \ | |
| -DADIOS2_USE_BZip2=OFF -DADIOS2_USE_PNG=OFF \ | |
| -DADIOS2_USE_Python=OFF | |
| make install | |
| fi | |
| # HDF5 | |
| if [ ! -d "$HDF5_ROOT" ]; then | |
| echo "Installing parallel HDF5..." | |
| cd $SOURCE_DIR | |
| curl -L -s -o hdf5_1.12.1.tar.gz \ | |
| https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.gz | |
| tar -xf hdf5_1.12.1.tar.gz | |
| cd hdf5-1.12.1 | |
| ./configure --build=`uname -p` --enable-parallel --enable-shared --disable-fortran \ | |
| --prefix=$HDF5_ROOT CC=mpicc CXX=mpic++ | |
| export CXXFLAGS="-fPIC" | |
| export CFLAGS="-fPIC" | |
| make CC=mpicc CXX=mpic++ | |
| make install | |
| fi | |
| # 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 | |
| # Boost | |
| if [ ! -d "$BOOST_ROOT" ]; then | |
| echo "Installing Boost..." | |
| cd $SOURCE_DIR | |
| wget -O boost_1_74_0.tar.gz \ | |
| https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.gz/download | |
| echo "Extracting Boost, this takes a while! Patience you must have." | |
| tar -xf 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,regex,serialization,system,thread \ | |
| --with-toolset=gcc --prefix=$BOOST_ROOT | |
| ./b2 cxxflags="-std=c++11" -j4 | |
| ./b2 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