Skip to content

spack compiler info: show non-external compilers too#51718

Merged
alalazo merged 3 commits intospack:developfrom
alalazo:commands/spack-compiler-info
Dec 9, 2025
Merged

spack compiler info: show non-external compilers too#51718
alalazo merged 3 commits intospack:developfrom
alalazo:commands/spack-compiler-info

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Dec 9, 2025

fixes #51681

After this change, spack compiler info will start showing installed compilers and, on demand, compilers from buildcaches.

Before

$ spack compiler list
==> Available compilers
-- gcc ubuntu20.04-x86_64 ---------------------------------------
[e]  [email protected]  [e]  [email protected]  [e]  [email protected]  [+]  [email protected]

-- llvm ubuntu20.04-x86_64 --------------------------------------
[e]  [email protected]  [e]  [email protected]  [e]  [email protected]

$ spack compiler info gcc@10:
gcc@=10.5.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu20.04 target=x86_64:
  prefix: /usr
  compilers:
    c: /usr/bin/gcc-10
    cxx: /usr/bin/g++-10
    fortran: /usr/bin/gfortran-10

After

$ spack compiler list
==> Available compilers
-- gcc ubuntu20.04-x86_64 ---------------------------------------
[e]  [email protected]  [e]  [email protected]  [e]  [email protected]  [+]  [email protected]

-- llvm ubuntu20.04-x86_64 --------------------------------------
[e]  [email protected]  [e]  [email protected]  [e]  [email protected]

$ spack compiler info gcc@10:
[e]  gcc@=10.5.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu20.04 target=x86_64

  prefix: /usr
  compilers:
    cc: /usr/bin/gcc-10
    cxx: /usr/bin/g++-10
    fortran: /usr/bin/gfortran-10

[+]  gcc@=15.2.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu20.04 target=icelake

  prefix: /home/culpo/.local/spack/opt/linux-icelake/gcc-15.2.0-hf5qmg2xdqgxhnfhlqpn7djhjrat6max
  compilers:
    cc: /home/culpo/.local/spack/opt/linux-icelake/gcc-15.2.0-hf5qmg2xdqgxhnfhlqpn7djhjrat6max/bin/gcc
    cxx: /home/culpo/.local/spack/opt/linux-icelake/gcc-15.2.0-hf5qmg2xdqgxhnfhlqpn7djhjrat6max/bin/g++
    fortran: /home/culpo/.local/spack/opt/linux-icelake/gcc-15.2.0-hf5qmg2xdqgxhnfhlqpn7djhjrat6max/bin/gfortran

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the spack compiler info command to display information about installed compilers and compilers from registered buildcaches (when using the --remote flag), not just external compilers. Previously, compiler info only showed external compilers from YAML configuration files.

Key changes:

  • Added --remote flag to spack compiler info command to enable querying compilers from buildcaches
  • Refactored common compiler querying logic into a shared _all_available_compilers() helper function
  • Updated compiler_info() to display compiler information from multiple sources including installed packages

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lib/spack/spack/cmd/compiler.py Added --remote argument to info parser; refactored compiler querying logic into _all_available_compilers() helper function; updated compiler_info() to handle non-external compilers and display detailed information including compiler executables, flags, and environment settings
share/spack/spack-completion.bash Added --remote option to bash completion for compiler info command
share/spack/spack-completion.fish Added --remote option to fish shell completion for compiler info command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alalazo alalazo merged commit 15cdbdb into spack:develop Dec 9, 2025
30 of 31 checks passed
@alalazo alalazo deleted the commands/spack-compiler-info branch December 9, 2025 13:16
@alalazo alalazo added the v1.1.1 label Dec 9, 2025
becker33 pushed a commit that referenced this pull request Jan 10, 2026
@becker33 becker33 mentioned this pull request Jan 10, 2026
2 tasks
becker33 pushed a commit that referenced this pull request Jan 11, 2026
Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 15, 2026
Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
vjranagit pushed a commit to vjranagit/spack that referenced this pull request Jan 18, 2026
Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 22, 2026
Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 26, 2026
Signed-off-by: Massimiliano Culpo <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spack compiler info doesn't show non-external compilers

3 participants