BootStrap: docker
From: ubuntu:18.04

%post
    export DEBIAN_FRONTEND=noninteractive
    apt-get update
    apt-get install --no-install-recommends -y software-properties-common
    add-apt-repository ppa:openkim/latest
    apt-get update
    apt-get upgrade --no-install-recommends -y
    apt-get install --no-install-recommends -y \
        bc \
        build-essential \
        ccache \
        clang \
        cmake \
        cmake-curses-gui \
        curl \
        doxygen \
        enchant \
        g++ \
        gcc \
        gfortran \
        git \
        hdf5-tools \
        less \
        libblas-dev \
        libeigen3-dev \
        libenchant-dev \
        libfftw3-dev \
        libgsl-dev \
        libhdf5-serial-dev \
        libhwloc-dev \
        libjpeg-dev \
        liblapack-dev \
        libnetcdf-dev \
        libomp-dev \
        libopenblas-dev \
        libnuma-dev \
        libpng-dev \
        libproj-dev \
        libvtk6-dev \
        libyaml-dev \
        make \
        mpi-default-bin \
        mpi-default-dev \
        ninja-build \
        python-dev \
        python-pip \
        python-pygments \
        python-virtualenv \
        python3-dev \
        python3-pip \
        python3-pkg-resources \
        python3-setuptools \
        python3-virtualenv \
        rsync \
        ssh \
        texlive \
        texlive-latex-recommended \
        texlive-formats-extra \
        texlive-pictures \
        texlive-publishers \
        texlive-science \
        dvipng \
        vim-nox \
        virtualenv \
        voro++-dev \
        wget \
        xxd \
        valgrind \
        gdb \
        libkim-api-dev \
        openkim-models

    # clean cache
    rm -rf /var/lib/apt/lists/*

        # manually install Plumed
        mkdir plumed
        cd plumed
        version=2.6.0
        curl -L -o plumed.tar.gz https://github.com/plumed/plumed2/releases/download/v${version}/plumed-src-${version}.tgz
        tar -xzf plumed.tar.gz
        cd plumed-${version}
        ./configure --disable-doc --prefix=/usr
        make
        make install
        # fix up installation for CentOS and Fedora
        # mv -v /usr/lib/pkgconfig/plumed* /usr/share/pkgconfig/
        cd ../../
        rm -rvf plumed

    # set custom prompt indicating the container name
    CUSTOM_PROMPT_ENV=/.singularity.d/env/99-zz_custom_prompt.sh
    cat >$CUSTOM_PROMPT_ENV <<EOF
#!/bin/bash
PS1="[ubuntu18.04:\u@\h] \W> "
EOF
    chmod 755 $CUSTOM_PROMPT_ENV

%environment
    LC_ALL=C
    export LC_ALL
    export PATH=/usr/lib/ccache:$PATH
    # tell OpenMPI to not try using Infiniband
    OMPI_MCA_btl="^openib"
    # do not warn about unused components as this messes up testing
    OMPI_MCA_btl_base_warn_component_unused="0"
    export OMPI_MCA_btl OMPI_MCA_btl_base_warn_component_unused

%labels
    Author akohlmey, rbberger
