solver: don't give a penalty for compiler reuse on compilers#51744
Merged
becker33 merged 1 commit intoFeb 12, 2026
Merged
Conversation
Contributor
|
Thanks @alalazo! $ spack compiler list
==> Available compilers
-- gcc ubuntu24.04-x86_64 ---------------------------------------
[e] gcc@12.4.0 [+] gcc@14.3.0In a fresh concretization, the solver preferred to reuse the old (external) compiler: $ spack spec --fresh openblas
- openblas@0.3.29~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none platform=linux os=ubuntu24.04 target=skylake %c,cxx,fortran=gcc@12.4.0
[+] ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake
[e] ^gcc@12.4.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu24.04 target=x86_64
[+] ^gcc-runtime@12.4.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake
[e] ^glibc@2.39 build_system=autotools platform=linux os=ubuntu24.04 target=x86_64
- ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0With this PR, it will choose the newer one: $ spack spec --fresh openblas
- openblas@0.3.29~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none platform=linux os=ubuntu24.04 target=skylake %c,cxx,fortran=gcc@14.3.0
[+] ^compiler-wrapper@1.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake
[+] ^gcc@14.3.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^diffutils@3.10 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^libiconv@1.18 build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^gawk@5.3.1~nls build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^libsigsegv@2.14 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^readline@8.2 build_system=autotools patches:=1ea4349,24f587b,3d9885e,5911a5b,622ba38,6c8adf8,758e2ec,79572ee,a177edc,bbf97f1,c7b45ff,e0013d9,e065038 platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[e] ^gcc@12.4.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu24.04 target=x86_64
[+] ^gcc-runtime@12.4.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake
[-] ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[+] ^gmp@6.3.0+cxx build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^autoconf@2.72 build_system=autotools platform=linux os=ubuntu24.04 target=skylake
[-] ^automake@1.16.5 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^m4@1.4.20+sigsegv build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^libtool@2.4.7 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^findutils@4.10.0 build_system=autotools patches:=440b954 platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[+] ^mpc@1.3.1 build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[+] ^mpfr@4.2.1 build_system=autotools libs:=shared,static patches:=3ec29a6 platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^autoconf-archive@2023.02.20 build_system=autotools platform=linux os=ubuntu24.04 target=skylake
[-] ^perl@5.40.0+cpanm+opcode+open+shared+threads build_system=generic platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^bzip2@1.0.8~debug~pic+shared build_system=generic platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^gdbm@1.23 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^texinfo@7.1 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^gettext@0.23.1+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^libxml2@2.13.5~http+pic~python+shared build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^tar@1.35 build_system=autotools zip=pigz platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^pigz@2.8 build_system=makefile platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^xz@5.6.3~pic build_system=autotools libs:=shared,static platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[-] ^ncurses@6.5~symlinks+termlib abi=none build_system=autotools patches:=7a351bc platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[-] ^pkgconf@2.3.0 build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c=gcc@12.4.0
[+] ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
[+] ^zstd@1.5.7+programs build_system=makefile compression:=none libs:=shared,static platform=linux os=ubuntu24.04 target=skylake %c,cxx=gcc@12.4.0
- ^gcc-runtime@14.3.0 build_system=generic platform=linux os=ubuntu24.04 target=skylake
[e] ^glibc@2.39 build_system=autotools platform=linux os=ubuntu24.04 target=x86_64
- ^gmake@4.4.1~guile build_system=generic platform=linux os=ubuntu24.04 target=skylake %c=gcc@14.3.0 |
lorisercole
added a commit
to lorisercole/spack
that referenced
this pull request
Jan 27, 2026
…for-fresh-concretization' into eessi See PR: spack#51744
19b55fc to
ddf497a
Compare
In the solver we give a penalty if "reuse" introduces a node compiled with a compiler that is not used otherwise. This is to avoid that extraneous compilers are introduced in the DAG when reusing binaries. Here we make an exception if such a node is a compiler itself. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
ddf497a to
0bf6c74
Compare
becker33
approved these changes
Feb 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the solver we give a penalty if "reuse" introduces a node compiled with a compiler that is not used otherwise. This is to avoid that extraneous compilers are introduced in the DAG when reusing binaries.
Here we make an exception if such a node is a compiler itself.