FROM neuronsimulator/neuron_wheel
LABEL authors="Pramod Kumbhar, Olli Lupton, Fernando Pereira, Alexandru Savulescu"

WORKDIR /root

# Install NVHPC from NVIDIA's repository.
RUN yum-config-manager --add-repo https://developer.download.nvidia.com/hpc-sdk/rhel/nvhpc.repo \
    && yum install -y nvhpc-22-1 nvhpc-2022-22.1 \
    && yum clean all

# setup nvhpc environment for building wheel and interactive usage
RUN yum install -y environment-modules && yum clean all \
    && echo "module use /opt/nvidia/hpc_sdk/modulefiles" >> ~/.bashrc \
    && /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/compilers/bin/makelocalrc -x \
        -gcc `which gcc` -gpp `which g++` -g77 `which gfortran` -cuda 11.5
