Skip to content
Snippets Groups Projects
FEDORALATEST 1.43 KiB
Bootstrap: docker
From: fedora:latest

%post
yum -y update && yum -y upgrade

# CentOS repo
yum -y groupinstall "Development Tools"
yum -y install python gcc gcc-c++ gcc-gfortran make wget vim mc procps tcl pkg-config lua tolua++ lua-posix lua-sql lua-socket lua-filesystem lua-sec lua-json lua-term

# Fedora repo
yum -y install bash-completion pigz tmux

cd /tmp

# OpenMPI
#wget https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.4.tar.gz
#tar xvf openmpi-3.1.4.tar.gz && cd openmpi-3.1.4
#./configure --prefix=/usr/local --with-hwloc=internal
#make -j 16
#make install

wget https://github.com/TACC/Lmod/archive/8.5.tar.gz
tar xvf 8.5.tar.gz
cd Lmod-8.5
./configure --prefix=/opt/apps
make install
ln -s /apps/all/Lmod/8.5/lmod/etc /opt/apps/lmod/etc

# pip
curl -s -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install setuptools --upgrade

%environment
source /opt/apps/lmod/8.5/init/profile
export LMOD_PACKAGE_PATH=/opt/apps/lmod/

if [ "$(id -u)" -ne 0 ]; then
    MODULEPATH=""

    for dir in /apps/modules/*
    do
        # Exclude following directories
        if [[ (${dir##*/} == "all") ]]; then
            continue
        fi
        # In case that it's directory
        if [ -d "$dir" ]; then
            if [ -z "$MODULEPATH" ]; then
                MODULEPATH="$dir"
            else
                MODULEPATH="$MODULEPATH:$dir"
            fi
        fi
    done

    # export
    export MODULEPATH
fi

ml purge