Skip to content

Specs depending on zlib-api or zstd fail to build with spack-installed gcc+binutils. #3505

@harshula

Description

@harshula

[Updated: 25/02/2026: Reproducer v2 & Added Workaround 3]

Some HPCs are still using RHEL 8.x. Spack concretization behaviour with GCC has changed since commit e6d347d from PR #3106

Platforms impacted

spack debug report (Rocky Linux 8.10)

spack debug report (openSUSE Leap 15.6)

spack debug report (Debian Trixie)

Reproducer v2

$ docker pull rockylinux/rockylinux:8.10

$ docker run -it --rm rockylinux/rockylinux:8.10

[root@35da6031d476 /]# dnf update -y  && dnf -y install     autoconf     automake     binutils     bison     bzip2     csh     flex     curl     file     findutils     gcc     gcc-c++     gcc-gfortran     git     glibc-devel     jq     libtool     gnupg2     hg     hostname     iproute     make     patch     patchutils     perl     pkgconf     pkgconf-m4     pkgconf-pkg-config     python3     python3-pip     python3-setuptools     svn     unzip     vim     which     xz     zstd  && rm -rf /var/cache/dnf  && dnf clean all

[root@35da6031d476 /]# cd /opt/ && git clone --depth=2 https://github.com/spack/spack.git --branch releases/v1.1

[root@35da6031d476 opt]# cd spack/ && . share/spack/setup-env.sh
[root@35da6031d476 spack]# spack config add concretizer:targets:granularity:generic
[root@35da6031d476 spack]# spack config add concretizer:compiler_mixing:false
[root@35da6031d476 spack]# spack config add packages:all:target:[x86_64]
[root@35da6031d476 spack]# spack config blame repos
---                                               repos:
/opt/spack/etc/spack/defaults/base/repos.yaml:14    builtin:
/opt/spack/etc/spack/defaults/base/repos.yaml:15      git: https://github.com/spack/spack-packages.git
/opt/spack/etc/spack/defaults/base/repos.yaml:16      branch: develop

[root@35da6031d476 spack]# spack repo update
remote: Enumerating objects: 20001, done.
remote: Counting objects: 100% (20001/20001), done.
remote: Compressing objects: 100% (10814/10814), done.
remote: Total 20001 (delta 1326), reused 13923 (delta 1161), pack-reused 0 (from 0)
==> builtin: Updated sucessfully.

[root@35da6031d476 spack]# spack install gcc@13.4.0 target=x86_64 %gcc@8.5.0

[root@35da6031d476 spack]# spack spec netcdf-fortran target=x86_64 %gcc@13.4.0
==> Error: failed to concretize `netcdf-fortran target=x86_64 %gcc@13.4.0` for the following reasons:
     1. Only external, or concrete, compilers are allowed for the fortran language
     2. Only external, or concrete, compilers are allowed for the cxx language
     3. Only external, or concrete, compilers are allowed for the c language

[root@35da6031d476 spack]# spack spec netcdf-fortran target=x86_64_v4 %gcc@13.4.0
==> Error: failed to concretize `netcdf-fortran target=x86_64_v4 %gcc@13.4.0` for the following reasons:
     1. Only external, or concrete, compilers are allowed for the fortran language
     2. Only external, or concrete, compilers are allowed for the cxx language
     3. Only external, or concrete, compilers are allowed for the c language

Reproducer v1

$ docker pull rockylinux/rockylinux:8.10

$ docker run -it --rm rockylinux/rockylinux:8.10

$ dnf update -y  && dnf -y install     autoconf     automake     binutils     bison     bzip2     csh     flex     curl     file     findutils     gcc     gcc-c++     gcc-gfortran     git     glibc-devel     jq     libtool     gnupg2     hg     hostname     iproute     make     patch     patchutils     perl     pkgconf     pkgconf-m4     pkgconf-pkg-config     python3     python3-pip     python3-setuptools     svn     unzip     vim     which     xz     zstd  && rm -rf /var/cache/dnf  && dnf clean all

$ cd /opt/

$ git clone https://github.com/spack/spack.git --branch releases/v1.1

$ cd spack/

$ . share/spack/setup-env.sh 

$ spack compiler find

remote: Enumerating objects: 19701, done.
remote: Counting objects: 100% (19701/19701), done.
remote: Compressing objects: 100% (10553/10553), done.
remote: Total 19701 (delta 1338), reused 13774 (delta 1224), pack-reused 0 (from 0)
==> Added 1 new compiler to /root/.spack/packages.yaml
    gcc@8.5.0
==> Compilers are defined in the following files:
    /root/.spack/packages.yaml


$ spack compiler info gcc

[e]  gcc@=8.5.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky8 target=x86_64

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


$ spack compiler list

==> Available compilers
-- gcc rocky8-x86_64 --------------------------------------------
[e]  gcc@8.5.0

$ spack config blame repos
---                                               repos:
/opt/spack/etc/spack/defaults/base/repos.yaml:14    builtin:
/opt/spack/etc/spack/defaults/base/repos.yaml:15      git: https://github.com/spack/spack-packages.git
/opt/spack/etc/spack/defaults/base/repos.yaml:16      branch: develop

$ spack repo update
remote: Enumerating objects: 500650, done.
remote: Counting objects: 100% (500650/500650), done.
remote: Compressing objects: 100% (148497/148497), done.
remote: Total 491954 (delta 211058), reused 490287 (delta 209692), pack-reused 0 (from 0)
==> builtin: Updated sucessfully.


$ spack install gcc@13.4.0


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

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

[+]  gcc@=13.4.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' patches:=8b79314 platform=linux os=rocky8 target=x86_64_v4

  prefix: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn
  compilers:
    cc: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gcc
    cxx: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/g++
    fortran: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gfortran


$ spack spec netcdf-fortran target=x86_64 %gcc@13.4.0 
==> Error: failed to concretize `netcdf-fortran target=x86_64 %gcc@13.4.0` for the following reasons:
     1. Only external, or concrete, compilers are allowed for the fortran language
     2. Only external, or concrete, compilers are allowed for the cxx language
     3. Only external, or concrete, compilers are allowed for the c language


[root@3f4d4f3ec5b3 test]# spack spec netcdf-fortran target=x86_64 %gcc@8.5.0
 -   netcdf-fortran@4.6.2~doc+pic+shared build_system=autotools platform=linux os=rocky8 target=x86_64 %c,fortran=gcc@8.5.0

Workaround 1

$ git -C ~/.spack/package_repos/fncqgg4/ revert e6d347de0cecc04e9837ae1e90a42f99354501b7
Auto-merging stacks/tutorial/spack.yaml
[develop 73389f394c] Revert "gcc: default to +binutils (#3106)"
 2 files changed, 14 insertions(+), 2 deletions(-)


$ spack uninstall gcc@13.4.0
    -- linux-rocky8-x86_64_v4 / %c,cxx=gcc@8.5.0 --------------------
    avqaqh3 gcc@13.4.0

==> 1 packages will be uninstalled. Do you want to proceed? [y/N] y
==> Successfully uninstalled gcc@13.4.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' patches:=8b79314 platform=linux os=rocky8 target=x86_64_v4/avqaqh3


$ spack install gcc@13.4.0
...
==> gcc: Successfully installed gcc-13.4.0-7mbv6a7khuafo2xn3ks4u3ztl7bjwfvu
  Stage: 2.12s.  Autoreconf: 0.00s.  Configure: 2.26s.  Build: 15m 10.04s.  Install: 4.81s.  Post-install: 0.98s.  Total: 15m 20.40s


$ spack spec netcdf-fortran target=x86_64 %gcc@13.4.0
...
 -   netcdf-fortran@4.6.2~doc+pic+shared build_system=autotools platform=linux os=rocky8 target=x86_64 %c,fortran=gcc@13.4.0


$ spack compiler list
==> Available compilers
-- gcc rocky8-x86_64 --------------------------------------------
[e]  gcc@8.5.0  [+]  gcc@13.4.0

$ spack compiler info gcc

[e]  gcc@=8.5.0~binutils+bootstrap~graphite+libsanitizer~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky8 target=x86_64

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

[+]  gcc@=13.4.0~binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' patches:=8b79314 platform=linux os=rocky8 target=x86_64_v4

  prefix: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-7mbv6a7khuafo2xn3ks4u3ztl7bjwfvu
  compilers:
    cc: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-7mbv6a7khuafo2xn3ks4u3ztl7bjwfvu/bin/gcc
    cxx: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-7mbv6a7khuafo2xn3ks4u3ztl7bjwfvu/bin/g++
    fortran: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-7mbv6a7khuafo2xn3ks4u3ztl7bjwfvu/bin/gfortran

Workaround 2

$ spack load gcc@13.4.0

$ spack compiler find
==> Added 1 new compiler to /root/.spack/packages.yaml
    gcc@13.4.0
==> Compilers are defined in the following files:
    /root/.spack/packages.yaml

$ spack compiler list
==> Available compilers
-- gcc rocky8-x86_64 --------------------------------------------
[e]  gcc@8.5.0  [e]  gcc@13.4.0  [+]  gcc@13.4.0

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

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

[e]  gcc@=13.4.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=rocky8 target=x86_64

  prefix: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn
  compilers:
    cc: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gcc
    cxx: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/g++
    fortran: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gfortran

[+]  gcc@=13.4.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' patches:=8b79314 platform=linux os=rocky8 target=x86_64_v4

  prefix: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn
  compilers:
    cc: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gcc
    cxx: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/g++
    fortran: /opt/spack/opt/spack/linux-x86_64_v4/gcc-13.4.0-avqaqh3ii6nyo3x4e365zv4hy3o2wqsn/bin/gfortran

$ spack spec netcdf-fortran target=x86_64 %gcc@13.4.0 
 -   netcdf-fortran@4.6.2~doc+pic+shared build_system=autotools platform=linux os=rocky8 target=x86_64 %c,fortran=gcc@13.4.0

Workaround 3

[root@c598a39ab94a spack]# spack install gcc@13.4.0 ~binutils target=x86_64 %gcc@8.5.0

[root@c598a39ab94a spack]# spack spec netcdf-fortran target=x86_64 %gcc@13.4.0
 -   netcdf-fortran@4.6.2~doc+pic+shared build_system=autotools platform=linux os=rocky8 target=x86_64 %c,fortran=gcc@13.4.0

[root@c598a39ab94a spack]# spack spec netcdf-fortran target=x86_64_v4 %gcc@13.4.0
 -   netcdf-fortran@4.6.2~doc+pic+shared build_system=autotools platform=linux os=rocky8 target=x86_64_v4 %c,fortran=gcc@13.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions