BootStrap: docker
From: quay.io/centos/centos:stream9


%help
    Development environment for CentOS Stream Linux 9 with Intel oneAPI installed


%setup


%post
    dnf -y update
    dnf -y install dnf-plugins-core

    dnf config-manager --set-enabled crb
    dnf -y install \
        https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
        https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

    dnf -y install \
        "@Development Tools" \
        gcc gcc-c++ \
        git cmake ccache ninja-build mold \
        ncurses-devel \
        Lmod openmpi-devel tbb-devel fftw-devel tcl-devel

    cat > /etc/yum.repos.d/oneAPI.repo << EOF
[oneAPI]
name=Intel® oneAPI repository
baseurl=https://yum.repos.intel.com/oneapi
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
EOF

    dnf -y install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mpi-devel #intel-basekit intel-hpckit
    cat > /etc/profile.d/oneapi.sh << EOF
if [ -z "\${ONEAPI_ROOT}" ] ; then
    echo "Usage of Intel oneAPI is subject to the license agreement at: https://www.intel.com/content/www/us/en/developer/articles/license/end-user-license-agreement.html" >&2
    source /opt/intel/oneapi/setvars.sh > /dev/null
fi
EOF
    chmod 644 /etc/profile.d/oneapi.sh
