-
Notifications
You must be signed in to change notification settings - Fork 3
Fix spack images #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Fix spack images #35
Changes from 5 commits
f1ff66e
c03daa1
ea0fc3e
c176f6a
9c43f41
e7a1429
e449b3a
d96d6ab
cde58a9
c7ada36
f42369b
3f5a168
1a5b5fb
3eb932a
33b7e57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,12 @@ | ||||||
| ARG VERSION | ||||||
| ARG COMPILER | ||||||
| ARG IMAGE_TAG | ||||||
| ARG REGISTRY=ghcr.io/pdidev/test_env | ||||||
|
|
||||||
| FROM ghcr.io/pdidev/test_env/spackbase:${IMAGE_TAG} | ||||||
| FROM ${REGISTRY}/spackbase:${IMAGE_TAG} | ||||||
|
|
||||||
| LABEL "org.opencontainers.image.source"="https://github.com/pdidev/test_env" | ||||||
|
|
||||||
|
|
||||||
| ARG VERSION | ||||||
|
|
||||||
| # Download spack | ||||||
|
|
@@ -36,18 +36,24 @@ 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 @)" | ||||||
|
|
||||||
|
|
||||||
| COPY ${COMPILER}.lst compilerpkg.lst | ||||||
| RUN <<EORUN | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May quote all EORUN of this PR (also relevant for files not modified by this PR)
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we use quote, the ${expression}, inside the here document, will not be evaluated.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the quotes, Docker does not expand the expressions, but the shell still does |
||||||
| set -e | ||||||
| COMPILER_PKG="$(cat compilerpkg.lst)" | ||||||
|
JAuriac marked this conversation as resolved.
|
||||||
| SPACK_VERSION="$(spack compilers | tr ' ' '\n' | grep @)" | ||||||
|
JAuriac marked this conversation as resolved.
JAuriac marked this conversation as resolved.
|
||||||
| # Select the ~bootstrap gcc variant as the 3-stage bootstrap fails on latest spack | ||||||
| if [[ "$COMPILER_PKG" == gcc* ]] | ||||||
| then | ||||||
| BOOT="~bootstrap" | ||||||
|
iole-bolognesi marked this conversation as resolved.
Outdated
|
||||||
| else | ||||||
| BOOT="" | ||||||
| fi | ||||||
| spack install ${SPACK_INSTALL_ARGS} -U "${COMPILER_PKG}${BOOT}%${SPACK_VERSION}" | ||||||
| EORUN | ||||||
| # 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' | ||||||
|
|
||||||
|
|
||||||
| # 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 | ||||||
|
|
@@ -86,39 +92,42 @@ else | |||||
| fi | ||||||
| EORUN | ||||||
|
|
||||||
|
|
||||||
| # Install an environment with our base libraries using the compiler ref we just generated | ||||||
| # Create an environment with our base libraries using the compiler ref we just generated | ||||||
| COPY <<'EOCOPY' spack.yaml | ||||||
| spack: | ||||||
| view: false | ||||||
| definitions: | ||||||
| - buildeps: [] | ||||||
| - compiler: [] | ||||||
| - libs: [] | ||||||
| - mpi: [] | ||||||
| - mpilibs: [] | ||||||
| specs: | ||||||
| - '$buildeps' | ||||||
| - matrix: | ||||||
| - ['$%compiler'] | ||||||
| - - '$libs' | ||||||
| - '$mpi' | ||||||
| - matrix: | ||||||
| - ['$%compiler'] | ||||||
| - ['$^mpi'] | ||||||
| - ['$mpilibs'] | ||||||
| - $buildeps | ||||||
| - $libs | ||||||
| - $mpi | ||||||
| - $mpilibs | ||||||
| EOCOPY | ||||||
| RUN spack env create pdienv spack.yaml | ||||||
| COPY deps.sh deps.sh | ||||||
| RUN . deps.sh && spack -e pdienv add -l buildeps ${BASE_BUILDDEPS} | ||||||
| RUN . deps.sh && spack -e pdienv add -l libs ${BASE_LIBS} | ||||||
| RUN <<EORUN | ||||||
|
|
||||||
| # The toolchain is attached directly to each lib spec (string-parsed), which | ||||||
| # avoids the matrix that crashes in expand_toolchains on latest spack | ||||||
| RUN <<'EORUN' | ||||||
| set -e | ||||||
| if ( spack --version | grep -qs '^1\.' ) | ||||||
| then spack -e pdienv add -l compiler pditoolchain | ||||||
| else spack -e pdienv add -l compiler "$(spack compilers | tr ' ' '\n' | grep @)" | ||||||
| . deps.sh | ||||||
| if spack --version | grep -qs '^1\.' | ||||||
| then COMPILER_REF="%pditoolchain" | ||||||
| else COMPILER_REF="%$(spack compilers | tr ' ' '\n' | grep @)" | ||||||
|
JAuriac marked this conversation as resolved.
|
||||||
| fi | ||||||
| for p in ${BASE_BUILDDEPS}; do | ||||||
| spack -e pdienv add -l buildeps "$p ${COMPILER_REF}" | ||||||
|
JAuriac marked this conversation as resolved.
Outdated
|
||||||
| done | ||||||
| for p in ${BASE_LIBS}; do | ||||||
| spack -e pdienv add -l libs "$p ${COMPILER_REF}" | ||||||
| done | ||||||
| EORUN | ||||||
|
|
||||||
| # Concretize, fetch, install | ||||||
| RUN spack -e pdienv concretize --reuse | ||||||
| RUN spack -e pdienv fetch \ | ||||||
| || spack -e pdienv fetch \ | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| llvm+llvm_dylib+link_llvm_dylib~lldb | ||
| llvm+llvm_dylib+link_llvm_dylib~lldb+gold | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gold linker seems to be deprecated (search for a maintainer)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be clear, is it Gold itself that is deprecated, and not its Spack.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See failure Doxygen is built with link time optimization (LTO). Building with link time optimization requires cooperation from the system linker. LTO support on Linux systems is available via the gold linker which has a plugin interface. The LLVM gold plugin is an implementation of this interface. To avoid using the deprecated approach, it seems that the alternative is to use LLVM native linker (LLD). I am currently testing this approach but I still did not manage to make it work. |
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep this registry? It is relevant for example if we want to test in our fork.
@jbigot @benoitmartin88