Skip to content

Instantly share code, notes, and snippets.

@PrometheusPi
Last active February 11, 2021 09:30
Show Gist options
  • Select an option

  • Save PrometheusPi/3b873c754fbb0f0a2684480d0969410f to your computer and use it in GitHub Desktop.

Select an option

Save PrometheusPi/3b873c754fbb0f0a2684480d0969410f to your computer and use it in GitHub Desktop.
#!/bin/bash
module load gcc/6.3.0
module load cmake/3.18.4
module load openmpi/2.0.1
module load cuda/9.2
module load boost/1.69.0
export CXX=$(which g++)
export CC=$(which gcc)
export SRC=$HOME/src/
mkdir -p $SRC
# copy the next 2 lines into your configuration before any of the following (copy) lines
export LIB=$HOME/lib/
mkdir -p $LIB
# zlib
cd $SRC
wget https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz
tar -xvzf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=$HOME/tmp/lib/zlib
make && make install
# copy the next 3 lines also into your setup
export ZLIB_ROOT=$LIB/zlib
export LD_LIBRARY_PATH=$ZLIB_ROOT/lib:$LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH=$ZLIB_ROOT:$CMAKE_PREFIX_PATH
# libpng
cd $SRC
curl -Lo libpng-1.6.34.tar.gz ftp://ftp-osl.osuosl.org/pub/libpng/src/libpng16/libpng-1.6.34.tar.gz
tar -xf libpng-1.6.34.tar.gz
cd libpng-1.6.34
./configure CPPFLAGS=-I$LIB/zlib/include LDFLAGS=-L$LIB/zlib/lib --enable-static --enable-shared --prefix=$LIB/libpng
make
make install
# copy the next 3 lines also into your setup
export PNG_ROOT=$LIB/libpng
export CMAKE_PREFIX_PATH=$PNG_ROOT:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=$PNG_ROOT/lib:$LD_LIBRARY_PATH
# HDF5
cd $SRC
curl -Lo hdf5-1.8.20.tar.gz https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz
tar -xzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
./configure --enable-parallel --enable-shared --prefix $LIB/hdf5/ CC=mpicc CXX=mpic++
make
make install
# copy the next 2 lines also in your setup
export HDF5_ROOT=$LIB/hdf5
export LD_LIBRARY_PATH=$HDF5_ROOT/lib:$LD_LIBRARY_PATH
# libSplash
cd $SRC
git clone https://github.com/ComputationalRadiationPhysics/libSplash.git $SRC/splash/
mkdir -p build_libSplash
cd build_libSplash && rm -rf ../build_libSplash/*
cmake -DCMAKE_INSTALL_PREFIX=$LIB/splash -DSplash_USE_MPI=ON -DSplash_USE_PARALLEL=ON $SRC/splash
make install
# copy the next 2 lines also in your setup
export CMAKE_PREFIX_PATH=$LIB/splash:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=$LIB/splash/lib:$LD_LIBRARY_PATH
# c-blosc
cd $SRC
curl -Lo c-blosc-1.15.0.tar.gz https://github.com/Blosc/c-blosc/archive/v1.15.0.tar.gz
tar -xzf c-blosc-1.15.0.tar.gz
mkdir -p build_c-blosc
cd build_c-blosc && rm -rf ../build_c-blosc/*
cmake -DCMAKE_INSTALL_PREFIX=$LIB/c-blosc -DPREFER_EXTERNAL_ZLIB=ON $SRC/c-blosc-1.15.0/
make
make install
# copy the next 3 lines also in your setup
export BLOSC_ROOT=$LIB/c-blosc
export CMAKE_PREFIX_PATH=$BLOSC_ROOT:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=$BLOSC_ROOT/lib:$LD_LIBRARY_PATH
# ADIOS
cd $SRC
curl -Lo adios-1.13.1.tar.gz http://users.nccs.gov/~pnorbert/adios-1.13.1.tar.gz
tar -xzf adios-1.13.1.tar.gz
cd adios-1.13.1
./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --enable-static --enable-shared --prefix=$LIB/adios --with-mpi=$MPI_ROOT --with-zlib=$LIB/zlib --with-blosc=$LIB/c-blosc
make
make install
# copy the next 2 lines also in your setup
export ADIOS_ROOT=$LIB/adios
export LD_LIBRARY_PATH=$ADIOS_ROOT/lib:$LD_LIBRARY_PATH
# openPMD-api
cd $SRC
git clone https://github.com/openPMD/openPMD-api.git
cd openPMD-api
mkdir -p build_openPMD
cd build_openPMD && rm -rf ../build_openPMD/*
cmake .. -DopenPMD_USE_MPI=ON -DCMAKE_INSTALL_PREFIX=$LIB/openPMD-api
make install
# copy the next 2 lines also in your setup
export CMAKE_PREFIX_PATH="$LIB/openPMD-api:$CMAKE_PREFIX_PATH"
export LD_LIBRARY_PATH="$LIB/openPMD-api/lib:$LD_LIBRARY_PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment