Skip to content

Commit

Permalink
adding nvhpc dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Mar 13, 2024
1 parent 9eeab76 commit fc69924
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- Dockerfile
- Dockerfile.fortran-intel
- Dockerfile.fortran-gcc
- Dockerfile.fortran-nvhpc
- Dockerfile.openmp
- Dockerfile.mpi
- Dockerfile.mpi_openmp
Expand Down
58 changes: 58 additions & 0 deletions docker/Dockerfile.fortran-nvhpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# nvidia rate limits requests. You can get around this by restarting docker if for
# some reason you have to build this image many times
# https://stackoverflow.com/a/75757516/5217293
#
# Container versions, and sizes, can be found at https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nvhpc/tags
#
FROM nvcr.io/nvidia/nvhpc:23.7-devel-cuda12.2-ubuntu22.04

RUN apt update \
&& apt -y install \
cmake \
curl \
gcc \
gfortran \
git \
lcov \
libcurl4-openssl-dev \
libhdf5-dev \
libnetcdff-dev \
m4 \
make \
nlohmann-json3-dev \
valgrind \
vim \
zlib1g-dev \
&& apt clean

# Set environment variables to install MUSICA using gcc
ENV FC=gfortran
ENV FFLAGS="-I/usr/include/"

# Copy the musica code
COPY . musica

# Build and install MUSICA
RUN cd musica \
&& cmake -S . \
-B build \
-D MUSICA_ENABLE_TESTS=ON \
-D MUSICA_ENABLE_TUVX=OFF \
-D CMAKE_BUILD_TYPE=Debug \
&& cd build \
&& make install

# Set environment variables to build MUSICA-Fortran using intel compilers
ENV CXX=nvc++
ENV CC=nvc
ENV FC=nvfortran

RUN cd musica/fortran/test/fetch_content_integration \
&& mkdir build && cd build \
&& cmake .. \
-D CMAKE_BUILD_TYPE=Debug \
&& make

RUN cp -r /musica/configs/chapman musica/fortran/test/fetch_content_integration/build

WORKDIR musica/fortran/test/fetch_content_integration/build

0 comments on commit fc69924

Please sign in to comment.