Last active
March 5, 2018 07:01
-
-
Save ax3l/080675215fdaf0c8bf0ad054ee8f7bc0 to your computer and use it in GitHub Desktop.
Octopus (Osaka U): PIConGPU 0.4.0-dev Quick-Start
This file contains 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 | |
# | |
# Author: Axel Huebl | |
# | |
# last updated: 2018-03-05 | |
# | |
# execute: | |
# curl https://gist.githubusercontent.com/ax3l/080675215fdaf0c8bf0ad054ee8f7bc0/raw/PIConGPU_040-dev_Octopus.sh | bash | |
PIC_BRANCH="dev" | |
# get PIConGPU profile | |
if [ ! -f $HOME/p100_picongpu.profile ]; then | |
wget -O $HOME/p100_picongpu.profile \ | |
https://raw.githubusercontent.com/ComputationalRadiationPhysics/picongpu/dev/etc/picongpu/octopus-ou/p100_picongpu.profile.example | |
fi | |
# load environment | |
source $HOME/picongpu.profile | |
export CXXFLAGS="-std=c++11" | |
set -euf -o pipefail | |
# build missing software | |
mkdir -p $HOME/src | |
mkdir -p $HOME/lib | |
mkdir -p $HOME/picInput | |
# CMake | |
if [ ! -d $CMAKE_ROOT ]; then | |
echo "Installing CMake..." | |
cd $HOME/src | |
curl -L -s -o cmake_3.10.2.tar.gz \ | |
https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz | |
tar -xf cmake_3.10.2.tar.gz | |
# pre-compiled binaries | |
mv cmake-3.10.2-Linux-x86_64 $CMAKE_ROOT | |
fi | |
# zlib | |
if [ ! -d $ZLIB_ROOT ]; then | |
echo "Installing Zlib..." | |
cd $HOME/src | |
wget -O zlib-1.2.11.tar.gz \ | |
https://github.com/madler/zlib/archive/v1.2.11.tar.gz | |
tar -xf zlib-1.2.11.tar.gz | |
cd zlib-1.2.11 | |
./configure \ | |
--prefix=$ZLIB_ROOT | |
make -j4 | |
make install | |
fi | |
# MPICH | |
if [ ! -d $MPI_ROOT ]; then | |
echo "Installing MPICH..." | |
cd $HOME/src | |
curl -L -s -o mpich-3.2.1.tar.gz \ | |
http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz | |
tar -xf mpich-3.2.1.tar.gz | |
cd mpich-3.2.1 | |
./configure --enable-fortran=no \ | |
--prefix=$MPI_ROOT | |
make | |
make install | |
fi | |
# Boost | |
if [ ! -d $BOOST_ROOT ]; then | |
echo "Installing Boost..." | |
cd $HOME/src | |
curl -L -s -o boost_1_65_1.tar.gz \ | |
https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz | |
tar -xf boost_1_65_1.tar.gz | |
cd boost_1_65_1 | |
./bootstrap.sh --with-libraries=atomic,chrono,context,date_time,fiber,filesystem,math,program_options,regex,serialization,system,thread \ | |
--prefix=$BOOST_ROOT | |
./b2 cxxflags="-std=c++11" -j4 | |
./b2 install | |
fi | |
# libpng | |
if [ ! -d $PNG_ROOT ]; then | |
echo "Installing libpng..." | |
cd $HOME/src | |
curl -L -s -o 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 | |
CPPFLAGS=-I$ZLIB_ROOT/include LDFLAGS=-L$ZLIB_ROOT/lib \ | |
./configure --enable-static --enable-shared \ | |
--prefix=$PNG_ROOT | |
make -j4 | |
make install | |
fi | |
# PNGwriter | |
if [ ! -d $PNGwriter_DIR ]; then | |
echo "Installing PNGwriter..." | |
cd $HOME/src | |
git clone -b 0.7.0 https://github.com/pngwriter/pngwriter.git \ | |
$HOME/src/pngwriter | |
mkdir pngwriter-build | |
cd pngwriter-build | |
cmake -DCMAKE_INSTALL_PREFIX=$PNGwriter_DIR \ | |
$HOME/src/pngwriter | |
make install | |
fi | |
# HDF5 | |
if [ ! -d $HDF5_ROOT ]; then | |
echo "Installing parallel HDF5..." | |
cd $HOME/src | |
curl -L -s -o 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 -xf hdf5_1.8.20.tar.gz | |
cd hdf5-1.8.20 | |
CC=$MPI_ROOT/bin/mpicc CXX=$MPI_ROOT/bin/mpic++ ./configure --enable-parallel --enable-shared --disable-fortran \ | |
--prefix=$HDF5_ROOT | |
CC=$MPI_ROOT/bin/mpicc CXX=$MPI_ROOT/bin/mpic++ make | |
make install | |
fi | |
# Splash | |
if [ ! -d $Splash_DIR ]; then | |
echo "Installing Splash..." | |
git clone -b v1.7.0 https://github.com/ComputationalRadiationPhysics/libSplash.git \ | |
$HOME/src/splash | |
mkdir $HOME/src/splash-build | |
cd $HOME/src/splash-build | |
cmake -DCMAKE_INSTALL_PREFIX=$Splash_DIR $HOME/src/splash | |
make install | |
fi | |
cd $HOME | |
# get PIConGPU | |
if [ ! -d $HOME/src/picongpu ]; then | |
echo "Installing PIConGPU (source)..." | |
git clone -b $PIC_BRANCH https://github.com/ComputationalRadiationPhysics/picongpu.git \ | |
$HOME/src/picongpu | |
fi | |
# message to user | |
echo '' | |
echo 'edit user & email within picongpu.profile, e.g. via:' | |
echo ' vi $HOME/picongpu.profile' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment