From b950fecc89e11a8a362dd2b76dcd71ac78b97c38 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Sat, 23 Mar 2024 15:58:11 -0500 Subject: [PATCH] internet too slow to test nvhpc rn --- .github/workflows/run_docker.yml | 1 + docker/Dockerfile.nvhpc | 40 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docker/Dockerfile.nvhpc diff --git a/.github/workflows/run_docker.yml b/.github/workflows/run_docker.yml index 2f075ae151..a628ea60b7 100644 --- a/.github/workflows/run_docker.yml +++ b/.github/workflows/run_docker.yml @@ -15,6 +15,7 @@ jobs: matrix: dockerfile: - Dockerfile.intel + - Dockerfile.nvhpc steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/docker/Dockerfile.nvhpc b/docker/Dockerfile.nvhpc new file mode 100644 index 0000000000..b04d2fb3fd --- /dev/null +++ b/docker/Dockerfile.nvhpc @@ -0,0 +1,40 @@ +# 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 + +# Install necessary dependencies +RUN apt update -y && \ + apt install -y \ + bzip2 \ + cmake \ + libcurl4-openssl-dev \ + libhdf5-dev \ + git \ + m4 \ + make \ + unzip \ + wget \ + zlib1g-dev \ + && apt clean all + +# Set working directory +WORKDIR /usr/local/src + +COPY . netcdf-c + +# Set environment variables for nvidia compilers +ENV CXX=nvc++ +ENV CC=nvc +ENV FC=nvfortran + +# Build and install NetCDF +WORKDIR /usr/local/src/netcdf-c +RUN cmake -S . -B build && \ + cd build && make -j && \ + make install + +WORKDIR /usr/local/src/netcdf-c/build \ No newline at end of file