Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch '3-convert-the-basic-installation-instructions-from-the-…
Browse files Browse the repository at this point in the history
…readmemd-file-to-the-first-section-of-the-getting-started-section-of-the-documentation' into oblate_coord_rot
  • Loading branch information
daminton committed Feb 29, 2024
2 parents 91e2f3e + 259314b commit 05dc8a0
Show file tree
Hide file tree
Showing 11 changed files with 574 additions and 712 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ _dependencies
!.readthedocs.yaml
!docs/
!docs/**/*
docs/_build/
!docs/_build/
docs/_build/**/*
docs/generated/
docs/generated/**/*
docs/**/*.DS_Store
docs/**/*.swp
docs/
!docs/_static/**/*.png
!docs/_static/**/*.svg
**/*.ai
Expand All @@ -77,4 +76,4 @@ actions-runner*
env/**
venv/**

sandbox/**
sandbox/**
67 changes: 15 additions & 52 deletions Dockerfile.GNU-Linux
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# dynamically.

# This build target compiles all dependencies and the swiftest driver itself
FROM continuumio/miniconda3:23.5.2-0 as build-deps
FROM ubuntu:focal-20240123 as build-deps
SHELL ["/bin/bash", "--login", "-c"]
ENV PATH="/opt/conda/bin:${PATH}"
WORKDIR /swiftest

ENV INSTALL_DIR=/usr/local
Expand All @@ -29,69 +28,29 @@ ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib"
ENV LDFLAGS="-L${INSTALL_DIR}/lib"
ENV CPPFLAGS="-I${INSTALL_DIR}/include"

COPY ./buildscripts/swiftest-build-env.yml ./
COPY ./buildscripts/fetch_dependencies.sh ./
RUN ./fetch_dependencies.sh -d ./
COPY ./buildscripts/ ./buildscripts/
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
m4 && \
rm -rf /var/lib/apt/lists/* && \
buildscripts/build_dependencies.sh -p ${INSTALL_DIR}

# Get the HDF5, NetCDF-C, and NetCDF-Fortran libraries
RUN conda update --all -y && \
conda install conda-libmamba-solver -y && \
conda config --set solver libmamba && \
conda env create --file swiftest-build-env.yml --name swiftest-build-env && \
conda init bash && \
echo "conda activate swiftest-build-env" >> ~/.bashrc

RUN cd zlib-* && \
./configure \
--prefix=${INSTALL_DIR} \
--static && \
make && make install && \
cd ../hdf5-* && \
./configure \
--prefix=${INSTALL_DIR} \
--disable-shared \
--enable-build-mode=production \
--disable-fortran \
--disable-java \
--disable-cxx \
--with-zlib=${INSTALL_DIR} && \
make && make install && \
cd ../netcdf-c-* && \
./configure \
--prefix=${INSTALL_DIR} \
--disable-shared \
--disable-dap \
--disable-libxml2 \
--disable-byterange && \
make && make install && \
cd ../netcdf-fortran-* && \
export CFLAGS="-fPIC" && \
export FCFLAGS="${CFLAGS}" && \
export FFLAGS=${CFLAGS} && \
export LIBS=$(${INSTALL_DIR}/bin/nc-config --libs --static) && \
./configure --disable-shared --prefix=${NFDIR} && \
make && make install

FROM continuumio/miniconda3:23.5.2-0 as build-swiftest
FROM ubuntu:focal-20240123 as build-swiftest
SHELL ["/bin/bash", "--login", "-c"]
ENV SHELL="/bin/bash"
WORKDIR /swiftest

# Copy build artifacts over to the swiftest package builder stage
ENV INSTALL_DIR=/usr/local
COPY --from=build-deps ${INSTALL_DIR}/ ${INSTALL_DIR}/
COPY --from=build-deps /opt/conda/envs/ /opt/conda/envs/
COPY --from=build-deps /root/.bashrc /root/

# Compile the Swiftest project
COPY ./cmake/ ./cmake/
COPY ./pyproject.toml ./
COPY ./src/ ./src/
COPY ./swiftest/ ./swiftest/
COPY ./tests/ ./tests/
COPY ./CMakeLists.txt ./
COPY ./setup.py ./
COPY ./environment.yml ./
COPY ./pyproject.toml ./
COPY ./requirements.txt ./
COPY ./version.txt ./

# Generate the build environment in conda
Expand All @@ -107,4 +66,8 @@ RUN export NFCFG="${INSTALL_DIR}/bin/nf-config" && \

#Export the generated wheel file to the host machine
FROM scratch as export-wheel
COPY --from=build-swiftest /swiftest/dist/ ./
COPY --from=build-swiftest /swiftest/dist/ ./

FROM scratch as export-driver
COPY --from=build-swiftest /swiftest/build/bin/swiftest_driver ./
COPY --from=build-swiftest /swiftest/build/bin/libswiftest.so ./
47 changes: 8 additions & 39 deletions Dockerfile.Intel
Original file line number Diff line number Diff line change
Expand Up @@ -34,44 +34,12 @@ ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib"
ENV LDFLAGS="-L${INSTALL_DIR}/lib"
ENV CPPFLAGS="-I${INSTALL_DIR}/include"

COPY ./buildscripts/fetch_dependencies.sh ./
COPY ./buildscripts/ ./buildscripts/
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
m4 && \
rm -rf /var/lib/apt/lists/* && \
./fetch_dependencies.sh -d ./

# Get the HDF5, NetCDF-C, and NetCDF-Fortran libraries
RUN cd zlib-* && \
./configure \
--prefix=${INSTALL_DIR} \
--static && \
make && make install && \
cd ../hdf5-* && \
./configure \
--prefix=${INSTALL_DIR} \
--disable-shared \
--enable-build-mode=production \
--disable-fortran \
--disable-java \
--disable-cxx \
--with-zlib=${INSTALL_DIR} && \
make && make install && \
cd ../netcdf-c-* && \
./configure \
--prefix=${INSTALL_DIR} \
--disable-shared \
--disable-dap \
--disable-libxml2 \
--disable-byterange && \
make && make install
RUN cd netcdf-fortran-* && \
export CFLAGS="-fPIC" && \
export FCFLAGS="${CFLAGS} -standard-semantics" && \
export FFLAGS=${CFLAGS} && \
export LIBS=$(${INSTALL_DIR}/bin/nc-config --libs --static) && \
./configure --disable-shared --prefix=${NFDIR} && \
make && make install
buildscripts/build_dependencies.sh -p ${INSTALL_DIR}

FROM intel/oneapi-hpckit:2023.1.0-devel-ubuntu20.04 as build-swiftest
ENV SCRIPT_DIR="buildscripts"
Expand All @@ -98,18 +66,15 @@ ENV LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
COPY --from=build-deps ${INSTALL_DIR}/ ${INSTALL_DIR}/

# Compile the Swiftest project
COPY ./requirements.txt ./
COPY ./environment.yml ./
COPY ./cmake/ ./cmake/
COPY ./pyproject.toml ./
COPY ./setup.py ./
COPY ./src/ ./src/
COPY ./swiftest/ ./swiftest/
COPY ./tests/ ./tests/
COPY ./CMakeLists.txt ./
COPY ./version.txt ./
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install python3-pip python3.8-venv -y

# Generate the build environment in conda
ENV PIP_ROOT_USER_ACTION=ignore
ENV LDFLAGS="-L${INSTALL_DIR}/lib"
ENV CFLAGS="-fPIC"
Expand All @@ -123,4 +88,8 @@ RUN export NFCFG="${INSTALL_DIR}/bin/nf-config" && \

#Export the generated wheel file to the host machine
FROM scratch as export-wheel
COPY --from=build-swiftest /swiftest/dist/ ./
COPY --from=build-swiftest /swiftest/dist/ ./

FROM scratch as export-driver
COPY --from=build-swiftest /swiftest/build/bin/swiftest_driver ./
COPY --from=build-swiftest /swiftest/build/bin/libswiftest.so ./
Loading

0 comments on commit 05dc8a0

Please sign in to comment.