Skip to content

Commit

Permalink
Try with clang@15
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhan12 committed Mar 28, 2024
1 parent 0351bac commit 1c2b63a
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 24 deletions.
15 changes: 14 additions & 1 deletion docker/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ spack:
view: false

compilers::
- compiler:
environment: {}
extra_rpaths: []
flags: {}
modules: []
operating_system: ubuntu22.04
paths:
cc: /usr/bin/clang-15
cxx: /usr/bin/clang++-15
f77: /usr/bin/gfortran-11
fc: /usr/bin/gfortran-11
spec: clang@15
target: x86_64
- compiler:
environment: {}
extra_rpaths: []
Expand Down Expand Up @@ -77,7 +90,7 @@ spack:
packages:
all:
target: [x86_64]
compiler: [gcc]
compiler: [gcc, clang]
providers:
blas: [netlib-blas]
lapack: [netlib-lapack]
Expand Down
91 changes: 68 additions & 23 deletions docker/tpl-ubuntu-clang.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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

0 comments on commit 1c2b63a

Please sign in to comment.