Bootstrap: debootstrap MirrorURL: http://us.archive.ubuntu.com/ubuntu/ OSVersion: bionic Include: apt wget sudo vim build-essential git sudo software-properties-common dirmngr gpg-agent curl %labels MAINTAINER_NAME Jafaruddin Lie MAINTAINER_EMAIL jafar.lie@monash.edu APPLICATION_NAME Simul-atrophy %environment CUDABINPATH=/usr/local/cuda/bin CUDALIBPATH=/usr/local/cuda/lib64/stubs:/usr/local/cuda/lib64/:/usr/local/cuda/lib export LD_LIBRARY_PATH=$CUDALIBPATH:$LD_LIBRARY_PATH export DEBIAN_FRONTEND=noninteractive export CC=/usr/bin/gcc-6 export CXX=/usr/bin/g++-6 export PETSC_VERSION=3.6.3 export PETSC_DIR=/petsc export PETSC_ARCH=arch-linux2-cxx-debug export ITK_VERSION=4.9.1 export ITK_DIR=/opt/itk/${ITK_VERSION} export SIMUL_ATROPHY_DIR=/simul-atrophy/build/src export PATH=$SIMUL_ATROPHY_DIR:$PATH:$CUDABINPATH %post echo "*********************************************************" echo "Setup and display environment" echo "*********************************************************" export LC_ALL=en_AU.UTF-8 export LANGUAGE=en_AU.UTF-8 export DEBIAN_FRONTEND=noninteractive echo $LC_ALL echo $LANGUAGE echo $DEBIAN_FRONTEND echo "*********************************************************" echo "Install repositories" echo "*********************************************************" apt-get install -y software-properties-common apt-add-repository -y 'deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted' apt-add-repository -y 'deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted' apt-add-repository -y 'deb http://us.archive.ubuntu.com/ubuntu/ bionic universe' apt-add-repository -y 'deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe' echo "*********************************************************" echo "Update repositories and install desktop" echo "*********************************************************" apt update apt upgrade -y apt install -y locales locale-gen en_AU.UTF-8 apt install -y wget ubuntu-desktop vim software-properties-common git cmake echo "*********************************************************" echo "Installing CUDA" echo "*********************************************************" #apt install -y cuda-9-0 #apt-get install -y g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev apt-get install -y gcc-6 g++-6 mkdir -p /mnt/cuda10 cd /mnt/cuda10 #wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/cuda_10.0.130_410.48_linux.run #wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/cudnn-10.0-linux-x64-v7.6.1.34.tgz #chmod +x cuda_10.0.130_410.48_linux.run #./cuda_10.0.130_410.48_linux.run --tmpdir=/mnt/cuda10/ --toolkitpath=/usr/local/cuda10/ --toolkit --samples --samplespath=/usr/local/cuda9/ --silent --override #ln -s /usr/local/cuda10 /usr/local/cuda #ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc #ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++ #tar -xzvf cudnn-10.0-linux-x64-v7.6.1.34.tgz #cp cuda/include/cudnn.h /usr/local/cuda/include #cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 #chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* #echo "*********************************************************" echo "Installing python dependencies" echo "*********************************************************" apt install -y python-pip python-pyqt5 pyqt5-dev python-tk echo "*********************************************************" echo "Installing vglrun and TurboVNC" echo "*********************************************************" #wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.1.2_amd64.deb #dpkg -i turbovnc_2.1.2_amd64.deb #wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.2_amd64.deb #dpkg -i virtualgl_2.6.2_amd64.deb apt update apt -y upgrade export LC_ALL=en_AU.UTF-8 export LANGUAGE=en_AU.UTF-8 export DEBIAN_FRONTEND=noninteractive apt update apt -y upgrade echo "install gfortran" apt-get install -y gfortran echo "*********************************************************" echo "dependency setup" echo "*********************************************************" export CC=$(which gcc-6) export CXX=$(which g++-6) export PETSC_VERSION=3.6.3 export PETSC_DIR=/petsc export PETSC_ARCH=arch-linux2-cxx-debug export ITK_VERSION=4.9.1 export ITK_DIR=/opt/itk/${ITK_VERSION} apt-get install -y libboost-all-dev apt-get install -y cmake echo "*********************************************************" echo "Installing PETSC" echo "*********************************************************" cd / # require 3.6.3.1, but this is the closest i can find git clone https://gitlab.com/petsc/petsc.git cd petsc # comment this line out to use petsc master. git checkout tags/v${PETSC_VERSION} ./configure --with-cc=gcc-6 --with-cxx=g++-6 --with-fc=gfortran --with-64-bit-indicies=yes --download-mpich=yes --download-fblaslapack --with-clanguage=cxx --prefix=/opt/petsc/${PETSC_VERSION} make all # ITK install echo "*********************************************************" echo "Installing ITK" echo "*********************************************************" cd / wget http://sourceforge.net/projects/itk/files/itk/4.9/InsightToolkit-${ITK_VERSION}.tar.gz/download -O InsightToolkit-${ITK_VERSION}.tar.gz tar -xf InsightToolkit-${ITK_VERSION}.tar.gz cd InsightToolkit-${ITK_VERSION} mkdir bin && cd bin cmake .. -DCMAKE_INSTALL_PREFIX=/opt/itk/${ITK_VERSION} make make install echo "*********************************************************" echo "Installing Simul-atrophy" echo "*********************************************************" cd / git clone https://github.com/Inria-Asclepios/simul-atrophy.git cd simul-atrophy mkdir build && cd build cmake .. make %runscript $*