diff --git a/.github/workflows/spack_docker_images.yml b/.github/workflows/spack_docker_images.yml index a5683ce..83a52e0 100644 --- a/.github/workflows/spack_docker_images.yml +++ b/.github/workflows/spack_docker_images.yml @@ -141,3 +141,4 @@ jobs: LIBS=${{ matrix.level }} tags: | ${{ steps.info.outputs.fullspack }} + \ No newline at end of file diff --git a/spack/3-baselibs/Dockerfile b/spack/3-baselibs/Dockerfile index 11af49c..4085f9a 100644 --- a/spack/3-baselibs/Dockerfile +++ b/spack/3-baselibs/Dockerfile @@ -36,22 +36,37 @@ ARG COMPILER ARG SPACK_INSTALL_ARGS="--show-log-on-error --fail-fast" # Install the spack compiler with our latest system compiler -COPY ${COMPILER}.lst compilerpkg.lst -RUN spack solve -I -U \ - "$(cat compilerpkg.lst)%$(spack compilers | tr ' ' '\n' | grep @)" \ - && spack install ${SPACK_INSTALL_ARGS} -U \ - "$(cat compilerpkg.lst)%$(spack compilers | tr ' ' '\n' | grep @)" - - -# Prevent building any new compiler -RUN spack config --scope site add 'packages:llvm:buildable: false' -RUN spack config --scope site add 'packages:gcc:buildable: false' +COPY ${COMPILER}.lst compilerpkg.lst +RUN <<'EORUN' +set -e +COMPILER_PKG="$(cat compilerpkg.lst)" +SPACK_VERSION="$(spack compilers | tr ' ' '\n' | grep @)" +# Select the ~bootstrap gcc variant as the 3-stage bootstrap fails on latest spack +if [[ "$COMPILER_PKG" == gcc* ]] +then + COMPILER_SPECIFIC_VARIANTS="~bootstrap" +else + COMPILER_SPECIFIC_VARIANTS="" +fi +spack solve -I -U ${COMPILER_PKG}${COMPILER_SPECIFIC_VARIANTS}%${SPACK_VERSION} \ + && spack install ${SPACK_INSTALL_ARGS} -U "${COMPILER_PKG}${COMPILER_SPECIFIC_VARIANTS}%${SPACK_VERSION}" +EORUN +# Prevent building any new compiler and set compiler flags for doxygen to support LTO +RUN <<'EORUN' +set -e +spack config --scope site add "packages:llvm:buildable:false" +spack config --scope site add "packages:gcc:buildable:false" +if spack --version | grep -qs '^1\.' && spack find llvm &>/dev/null +then + spack config --scope site add "packages:doxygen:require:ldflags=-fuse-ld=lld" +fi +EORUN # Generate a compiler ref # * before 1.0, rely on the compilers section and generate a mixed compiler for llvm # * from spack 1.0 on, define a toolchain -RUN <