Repository navigation
Description
Steps to reproduce
# add following line to current gem5 spec
# version("25.0.0.0", tag="v25.0.0.0", commit="d22064c1c05f5857431219da888de7e29a268c16")
spack edit gem5
# try to install
spack install gem5I have attached the updated gem5 package.py here as well.
Error message
==> Installing gem5-25.0.0.0-ebb2jl3ocl3yqn3ojobrphobr3mrnwns [76/76]
==> Fetching https://github.com/gem5/gem5/archive/refs/tags/v25.0.0.0.tar.gz
[100%] 16.07 MB @ 944.4 KB/s
==> Ran patch() for gem5
==> gem5: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
'/spack/opt/spack/linux-skylake/scons-4.9.1-4bp2l32qcptxg7ytqoagdontsohmaul2/bin/scons' 'build/ALL/gem5.opt' '-j4' '--ignore-style'
See build log for details:
/tmp/USER/spack-stage/spack-stage-gem5-25.0.0.0-ebb2jl3ocl3yqn3ojobrphobr3mrnwns/spack-build-out.txtcat /tmp/USER/spack-stage/spack-stage-gem5-25.0.0.0-ebb2jl3ocl3yqn3ojobrphobr3mrnwns/spack-build-out.txt
==> gem5: Executing phase: 'build'
==> [2025-11-17-17:26:50.151572] '/spack/opt/spack/linux-skylake/scons-4.9.1-4bp2l32qcptxg7ytqoagdontsohmaul2/bin/scons' 'build/ALL/gem5.opt' '-j4' '--ignore-style'
scons: Reading SConscript files ...
AttributeError: 'tuple' object has no attribute 'find':
File "/tmp/USER/spack-stage/spack-stage-gem5-25.0.0.0-ebb2jl3ocl3yqn3ojobrphobr3mrnwns/spack-src/SConstruct", line 472:
if bin_target_arch.find("Target: x86_64") != -1The portion of the SConstruct that is causing this error is:
grep -A 7 ^bin_target_arch /tmp/USER/spack-stage/spack-stage-gem5-25.0.0.0-ebb2jl3ocl3yqn3ojobrphobr3mrnwns/spack-src/SConstruct
bin_target_arch = readCommand([main['CXX'], '--verbose'], exception=False)
main["BIN_TARGET_ARCH"] = (
"x86_64"
if bin_target_arch.find("Target: x86_64") != -1
else "aarch64"
if bin_target_arch.find("Target: aarch64") != -1
else "unknown"
)What is happening is $CXX --verbose is being run then parsed to find Target: x86_64 or Target: aarch64 to determine the target. However, the gcc wrapper does not implement the --verbose flag. To see this in action:
spack cd gem5
spack build-env gem5 bash
echo $CXX
/spack/opt/spack/linux-skylake/compiler-wrapper-1.0-t6blrefhztiomsijda43rpjs2ncp7zwc/libexec/spack/gcc/g++So it is $CXX is pointing to the g++ wrapper. Running $CXX --help | grep verbose shows no verbose flag and if one runs $CXX --verbose, the verbose flag is ignored and $CXX attempts to compile and errors, NOT producing the Target definitions SCons was looking for.
However, $SPACK_CXX is just my system g++ and supports --verbose and defines the Target:
echo $SPACK_CXX
/usr/bin/g++
$SPACK_CXX --verbose
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 13.3.0-6ubuntu2~24.04' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-13-fG75Ri/gcc-13-13.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-13-fG75Ri/gcc-13-13.3.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04) I have a workaround in place in my gem5 package.py file that substitute $CXX with $SPACK_CXX for this check, but figured this should be looked at in the gcc wrapper.
Information on your system
- Spack: 1.1.0.dev0 (spack/spack@dd20263)
- Builtin repo: spack/spack-packages@559789f
- Python: 3.12.3
- Platform: linux-ubuntu24.04-skylake
General information
- I have run
spack debug reportand 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
Activity