Skip to content

External packages with compiler-specific prefixes are broken? #51001

@vanderwb

Description

@vanderwb

Steps to reproduce

I first grabbed a fresh clone of Spack using the develop branch. Then, on our Cray system, I added the following packages.yaml settings to add the system compiler and the cray-mpich package:

$ cat packages.yaml 
packages:
  gcc:
    externals:
    - spec: [email protected] languages:='c,c++,fortran'
      prefix: /usr
      extra_attributes:
        compilers:
          c: /usr/bin/gcc
          cxx: /usr/bin/g++
          fortran: /usr/bin/gfortran
  cray-mpich:
    externals:
    - spec: [email protected] %gcc
      prefix: /opt/cray/pe/mpich/8.1.29/ofi/gnu/12.3
    - spec: [email protected] %cce
      prefix: /opt/cray/pe/mpich/8.1.29/ofi/cray/17.0
    - spec: [email protected] %nvhpc
      prefix: /opt/cray/pe/mpich/8.1.29/ofi/nvidia/23.3
    - spec: [email protected] %oneapi
      prefix: /opt/cray/pe/mpich/8.1.29/ofi/intel/2022.1
    buildable: false

The cray-mpich package, out of the box, concretizes with no compiler request, but does not if I ask for GCC:

$ spack spec -l cray-mpich
==> Compilers have been configured automatically from PATH inspection
[e]  hy7vgd6  [email protected]~cuda~rocm+wrappers build_system=generic arch=linux-sles15-zen 
                                                                             
$ spack spec -l cray-mpich %g^C

$ spack compiler list                                                                                                                                                                                                                                                                                   
==> Available compilers         
-- gcc sles15-x86_64 --------------------------------------------                                                                                                                                                                                                                                                    
[e]  [email protected]

$ spack spec -l [email protected] %[email protected]
==> Error: '[email protected] %[email protected]' cannot depend on gcc

From some reading on Slack, it looked like I may need to add depends_on("c") (and cxx and fortran) to the package for this to work. But after doing this, the concretizer fails:

$ spack spec -l [email protected] %[email protected]
==> Error: internal solver error: the following specs were concretized, but do not satisfy the input:
    - input: [email protected] %[email protected]
      output: [email protected]~cuda~rocm+wrappers build_system=generic arch=linux-sles15-zen 
                                                                             
                                                                             
    Please report a bug at https://github.com/spack/spack/issues and attach the following files:
    - /tmp/spack-asp-dd6qqrqa/input-1.json
    - /tmp/spack-asp-dd6qqrqa/output-1.json

Error message

lib/spack/spack/config.py:1190 ==> [2025-07-14-20:21:48.408082] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/config.yaml
lib/spack/spack/cmd/__init__.py:126 ==> [2025-07-14-20:21:48.449161] Imported spec from built-in commands
lib/spack/spack/cmd/__init__.py:126 ==> [2025-07-14-20:21:48.450119] Imported spec from built-in commands
lib/spack/spack/database.py:612 ==> [2025-07-14-20:21:48.786434] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:182 ==> [2025-07-14-20:21:48.786934] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:21:48.791612] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/database.py:612 ==> [2025-07-14-20:21:48.843796] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:182 ==> [2025-07-14-20:21:48.844044] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:21:48.845731] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:21:48.905819] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/packages.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:21:48.955128] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/repos.yaml
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:10.680101] [spack.solver.input_analysis] msvc is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:10.866234] [spack.solver.input_analysis] apple-clang is not for this platform
lib/spack/spack/database.py:612 ==> [2025-07-14-20:22:11.138430] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:182 ==> [2025-07-14-20:22:11.138711] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:11.167856] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/mirrors.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.314243] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/config.py:128 ==> [2025-07-14-20:22:12.332245] [BOOTSTRAP CONFIG SCOPE] name=_builtin
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.333213] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/config.py:137 ==> [2025-07-14-20:22:12.340835] [BOOTSTRAP CONFIG SCOPE] name=defaults, path=/glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults
lib/spack/spack/bootstrap/config.py:137 ==> [2025-07-14-20:22:12.341095] [BOOTSTRAP CONFIG SCOPE] name=bootstrap, path=/glade/u/home/vanderwb/.spack/bootstrap/config
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.341719] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/include.yaml
lib/spack/spack/config.py:867 ==> [2025-07-14-20:22:12.344244] Creating DirectoryConfigScope defaults:linux for '/glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/linux'
lib/spack/spack/config.py:867 ==> [2025-07-14-20:22:12.344656] Creating DirectoryConfigScope defaults:base for '/glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/base'
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.347842] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/config.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.374859] Reading config from file /glade/u/home/vanderwb/.spack/bootstrap/config/config.yaml
lib/spack/spack/database.py:612 ==> [2025-07-14-20:22:12.389025] DATABASE LOCK TIMEOUT: 60s
lib/spack/spack/store.py:182 ==> [2025-07-14-20:22:12.389481] PACKAGE LOCK TIMEOUT: No timeout
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.424593] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.479425] Reading config from file /glade/u/home/vanderwb/.spack/bootstrap/config/packages.yaml
lib/spack/spack/bootstrap/_common.py:240 ==> [2025-07-14-20:22:12.542177] [BOOTSTRAP ROOT SPEC] clingo-bootstrap@spack+python platform=linux target=x86_64
lib/spack/spack/bootstrap/core.py:359 ==> [2025-07-14-20:22:12.542551] [BOOTSTRAP MODULE clingo] Try importing from Python
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.543209] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/bootstrap.yaml
lib/spack/spack/bootstrap/_common.py:98 ==> [2025-07-14-20:22:12.644323] [BOOTSTRAP MODULE clingo] The installed spec "clingo-bootstrap@spack+python platform=linux target=x86_64 ^[email protected]/a4oyom2bc4go3floq7jlymc2l745w7vl" provides the "clingo" Python module
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.655905] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/base/packages.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.706436] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/packages.yaml
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:12.963804] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/concretizer.yaml
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:13.022849] [spack.solver.input_analysis] msvc is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:13.063997] [spack.solver.input_analysis] apple-clang is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:13.276084] [spack.solver.input_analysis] apple-libuuid is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:14.184977] [spack.solver.input_analysis] wgl is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:14.193674] [spack.solver.input_analysis] apple-gl is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:14.307492] [spack.solver.input_analysis] msmpi is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:16.415665] [spack.solver.input_analysis] nvpl-blas is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:16.420919] [spack.solver.input_analysis] veclibfort is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:16.470859] [spack.solver.input_analysis] nvpl-lapack is not for this platform
lib/spack/spack/solver/input_analysis.py:95 ==> [2025-07-14-20:22:21.334779] [spack.solver.input_analysis] apple-libunwind is not for this platform
lib/spack/spack/config.py:1190 ==> [2025-07-14-20:22:39.646534] Reading config from file /glade/derecho/scratch/vanderwb/experiment/spack-mpich/spack/etc/spack/defaults/config.yaml
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.692853] UNKNOWN SYMBOL: attr("external_build_requirement", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node","nvhpc"))
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.693169] UNKNOWN SYMBOL: attr("external_build_requirement", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node","cce"))
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.693371] UNKNOWN SYMBOL: attr("variant_value", NodeArgument(id='0', pkg='cray-mpich'), rocm, False)
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.693568] UNKNOWN SYMBOL: attr("external_build_requirement", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node","intel-oneapi-compilers"))
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.693781] UNKNOWN SYMBOL: attr("variant_value", NodeArgument(id='0', pkg='cray-mpich'), wrappers, True)
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.694134] UNKNOWN SYMBOL: attr("variant_value", NodeArgument(id='0', pkg='cray-mpich'), build_system, generic)
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.694384] UNKNOWN SYMBOL: attr("variant_value", NodeArgument(id='0', pkg='cray-mpich'), cuda, False)
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.694576] UNKNOWN SYMBOL: attr("direct_dependency", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node","gcc"))
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.694809] UNKNOWN SYMBOL: attr("external_build_requirement", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node","gcc"))
lib/spack/spack/solver/asp.py:4159 ==> [2025-07-14-20:22:46.694997] UNKNOWN SYMBOL: attr("direct_dependency", NodeArgument(id='0', pkg='cray-mpich'), node_requirement("node_version_satisfies","gcc","7.5.0"))
lib/spack/spack/main.py:1158 ==> [2025-07-14-20:22:46.779708] Error: internal solver error: the following specs were concretized, but do not satisfy the input:
    - input: [email protected] %[email protected]
      output: [email protected]~cuda~rocm+wrappers build_system=generic arch=linux-sles15-zen


    Please report a bug at https://github.com/spack/spack/issues and attach the following files:
    - /tmp/spack-asp-y4dfy7px/input-1.json
    - /tmp/spack-asp-y4dfy7px/output-1.json

input-1.json
output-1.json

Information on your system

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingimpact-mediumv1.0.1PRs to backport for v1.0.1

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions