llvm: add missing binutils and gcc-runtime dependency#3880
llvm: add missing binutils and gcc-runtime dependency#3880rbberger wants to merge 4 commits intospack:developfrom
Conversation
da05909 to
124ac4b
Compare
|
Seems similar to what I had to do in #3600 for the OneAPI toolchain. |
|
Yeah, we don't have |
Previously +gold pulled in binutils as dependency. That default was recently changed since gold is deprecated. See spack#3454. However, building a custom GCC will typically pull in a newer binutils than what is on the system. Using such a GCC for building LLVM then fails if the system binutils is too old. We therefore need to make sure that LLVM also uses the newer binutils.
Putting binutils in PATH isn't good enough due to LLVM lookup logic. Be explicit by adding -B<binutils-prefix>/bin to prefer this prefix for ld.
124ac4b to
055dfe0
Compare
|
@alalazo @haampie please take a closer look. I've needed to add |
|
I just tested this with a fresh Spack installation and can confirm that it fixes the problem I reported in #3817 \o/ |
|
Looks good to me, I'm gonna leave this to @alalazo to look at since he's doing very similar work right now. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fixrepos/spack_repo/builtin/build_systems/go.py
repos/spack_repo/builtin/build_systems/python.py
repos/spack_repo/builtin/packages/blis/package.py
repos/spack_repo/builtin/packages/cdo/package.py
repos/spack_repo/builtin/packages/dla_future/package.py
repos/spack_repo/builtin/packages/geant4/package.py
repos/spack_repo/builtin/packages/go/package.py
repos/spack_repo/builtin/packages/go_bootstrap/package.py
repos/spack_repo/builtin/packages/hdf5/package.py
repos/spack_repo/builtin/packages/llvm/package.py
repos/spack_repo/builtin/packages/llvm_amdgpu/package.py
repos/spack_repo/builtin/packages/octave_io/package.py
repos/spack_repo/builtin/packages/pika/package.py
repos/spack_repo/builtin/packages/py_tensorboard_data_server/package.py
repos/spack_repo/builtin/packages/rust/package.py
�[1;34m==> �[0mrunning flake8
repos/spack_repo/builtin/packages/llvm/package.py:357: [E501] line too long (104 > 99 characters)
�[1;34m==> �[0mrunning isort
�[1;34m==> �[0mrunning black
I've updated the branch with style fixes. |
## Proposed changes The installation and nightly scripts have been significantly updated for the modern era of spack where compilers mostly work as dependencies, environments are more functional, and the package repository is separate. Note that the compilers must be installed (concretized) ahead of use, so we install those first, relying on the system compiler being good enough. Several bugs are worked around, e.g. compilers are generally built with the system gcc. spack currently fails to inject newer binutils dependencies consistently so installing llvm using a spack built gcc is prone to failure. [ Solution is in progress spack/spack-packages#3880 ] I was not able to make a working llvm v22.1.1 for offload. v21 is used for now (NV, host CPU). Several packages need updating before we can make more use of them e.g. to avoid build failures with gcc@15 ## What type(s) of changes does this code introduce? - Testing changes (e.g. new unit/integration/performance tests) ### Does this introduce a breaking change? - No ## What systems has this change been tested on? nitrogen, nitrogen2, sulfur ## Checklist * * [X] I have read the pull request guidance and develop docs * * [X] This PR is up to date with the current state of 'develop' * * [ ] Code added or changed in the PR has been clang-formatted * * [ ] This PR adds tests to cover any new code, or to catch a bug that is being fixed * * [ ] Documentation has been added (if appropriate)
Previously +gold pulled in binutils as dependency. That default was recently changed since gold is deprecated. See #3454.
However, building a custom GCC will typically pull in a newer binutils than what is on the system. Using such a GCC for building LLVM then fails if the system binutils is too old. We therefore need to make sure that LLVM also uses the newer binutils.
Also adds an explicit
-B<binutils-prefix>/binto the LLVM configuration files to it prefers using those binaries over defaulting to a location such as/usr/bin. Just having the binutils prefix in PATH is not good enough.It further injects a gcc-runtime dependency for packages building with a llvm that is built with gcc.