-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ RUN apt-get update | |
RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ | ||
apt-get install -y --no-install-recommends \ | ||
clang-$CLANG_MAJOR_VERSION \ | ||
libomp-$CLANG_MAJOR_VERSION-dev \ | ||
ca-certificates \ | ||
curl \ | ||
libtbb2 \ | ||
|
@@ -27,29 +28,31 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ | |
zlib1g-dev \ | ||
openmpi-bin \ | ||
libopenmpi-dev \ | ||
python3 | ||
|
||
python3 \ | ||
python3-pip \ | ||
python3-sphinx \ | ||
doxygen \ | ||
pkg-config \ | ||
xz-utils \ | ||
unzip \ | ||
libmpfr-dev \ | ||
lbzip2 \ | ||
virtualenv | ||
|
||
# Install clingo for Spack | ||
RUN python3 -m pip install --upgrade pip && \ | ||
python3 -m pip install clingo | ||
|
||
# Install CMake | ||
RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-cmake.sh | ||
|
||
ENV CC=/usr/bin/clang-$CLANG_MAJOR_VERSION \ | ||
CXX=/usr/bin/clang++-$CLANG_MAJOR_VERSION \ | ||
MPICC=/usr/bin/mpicc \ | ||
MPICXX=/usr/bin/mpicxx \ | ||
MPIEXEC=/usr/bin/mpirun | ||
ENV OMPI_CC=$CC \ | ||
OMPI_CXX=$CXX | ||
|
||
# Installing TPLs | ||
FROM tpl_toolchain_intersect_geosx_toolchain AS tpl_toolchain | ||
ARG SRC_DIR | ||
ARG BLD_DIR | ||
|
||
ARG GCC_MAJOR_VERSION | ||
|
||
ENV FC=/usr/bin/gfortran-$GCC_MAJOR_VERSION \ | ||
MPIFC=/usr/bin/mpifort | ||
ENV OMPI_FC=$FC | ||
|
||
RUN apt-get install -y --no-install-recommends \ | ||
gfortran-$GCC_MAJOR_VERSION \ | ||
libtbb-dev \ | ||
|
@@ -58,21 +61,54 @@ RUN apt-get install -y --no-install-recommends \ | |
file \ | ||
bison \ | ||
flex \ | ||
patch | ||
|
||
ARG HOST_CONFIG | ||
|
||
RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/configure-tpl.sh | ||
WORKDIR $BLD_DIR | ||
RUN --mount=src=.,dst=$SRC_DIR make | ||
# GEOS patches some tpl. Remove when it's not the case anymore. | ||
patch \ | ||
# `ca-certificates` needed by `git` to download GEOS repo. | ||
ca-certificates \ | ||
git | ||
|
||
# Clone branch with spack configs | ||
# TODO decide landing place of spack recipes | ||
RUN git clone --branch feature/han12/spack_cleanup_recipes \ | ||
--depth 1 \ | ||
--single-branch \ | ||
https://github.com/GEOS-DEV/GEOS.git | ||
|
||
#COPY docker/spack.yaml / | ||
# Run uberenv | ||
# Have to create install directory first for uberenv | ||
# -k flag is to ignore SSL errors | ||
# Remove generated host-config for lvarray | ||
RUN --mount=src=.,dst=$SRC_DIR cd GEOS && \ | ||
mkdir -p ${GEOSX_TPL_DIR} && \ | ||
git submodule init scripts/uberenv && \ | ||
git submodule update && \ | ||
./scripts/uberenv/uberenv.py \ | ||
#--spec "%clang@${CLANG_MAJOR_VERSION} +docs ^[email protected]~gotcha~sampler~libunwind~libdw~papi" \ | ||
--spec "%clang@${CLANG_MAJOR_VERSION} +docs" \ | ||
--spack-env-file=${SRC_DIR}/docker/spack.yaml \ | ||
--project-json=.uberenv_config.json \ | ||
--prefix ${GEOSX_TPL_DIR} \ | ||
-k && \ | ||
# Remove host-config generated for LvArray | ||
rm lvarray* && \ | ||
# Rename and copy spack-generated host-config to root directory | ||
cp *.cmake /spack-generated.cmake && \ | ||
# Remove extraneous spack files | ||
cd ${GEOSX_TPL_DIR} && \ | ||
rm -rf bin/ build_stage/ misc_cache/ spack/ spack-env/ .spack-db/ | ||
|
||
# Extract only TPLs from previous stage | ||
FROM tpl_toolchain_intersect_geosx_toolchain AS geosx_toolchain | ||
ARG SRC_DIR | ||
|
||
COPY --from=tpl_toolchain $GEOSX_TPL_DIR $GEOSX_TPL_DIR | ||
|
||
RUN apt-get install -y --no-install-recommends \ | ||
# Extract the generated host-config | ||
COPY --from=tpl_toolchain /spack-generated.cmake / | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles \ | ||
apt-get install -y --no-install-recommends \ | ||
openssh-client \ | ||
ca-certificates \ | ||
curl \ | ||
|
@@ -83,7 +119,16 @@ RUN apt-get install -y --no-install-recommends \ | |
libxml2-utils \ | ||
git \ | ||
ghostscript \ | ||
ninja-build | ||
ninja-build \ | ||
## Necessary dependencies for pygeosx unit tests | ||
python3-dev \ | ||
python3-sphinx \ | ||
python3-mpi4py \ | ||
python3-scipy \ | ||
python3-virtualenv \ | ||
python3-matplotlib \ | ||
python3-venv \ | ||
python3-pytest | ||
|
||
RUN --mount=src=.,dst=$SRC_DIR $SRC_DIR/docker/install-sccache.sh | ||
ENV SCCACHE=/opt/sccache/bin/sccache |