Skip to content

update LLVM easyblock to fix build on RISC-V systems and ignore a bunch of tests#3676

Merged
Crivella merged 28 commits intoeasybuilders:developfrom
julianmorillo:llvm
Jul 31, 2025
Merged

update LLVM easyblock to fix build on RISC-V systems and ignore a bunch of tests#3676
Crivella merged 28 commits intoeasybuilders:developfrom
julianmorillo:llvm

Conversation

@julianmorillo
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread easybuild/easyblocks/l/llvm.py Outdated
Comment on lines +1004 to +1005
# glob_pattern = os.path.join(base_dir, 'lib', f'%s-{arch}')
glob_pattern = os.path.join(base_dir, 'lib', f'{arch}-*')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't look right, should this be arch-specific?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It worked for me in RISC-V.

I'm not sure what the original line does, but with the original code, glob_pattern was equal to /tmp/eb/easy build/build/LLVM/20.1.1/GCCcore-13.2.0/llvm.obj.1/lib/%s-riscv64. And with that, matches was null after matches = glob.glob(glob_pattern), so the ERROR "Could not find runtime library directory" was raised.

On the other hand, with my modification, matches[0] is /tmp/eb/easybuild/build/LLVM/20.1.1/GCCcore-13.2.0/llvm.obj.1/lib/riscv64-unknown-linux-gnu and the function finally returns lib/riscv64-unknown-linux-gnu

How does it work in other architectures?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Crivella would know better than me...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There was an error introduced in #3674 when replacing the old python2 formatting with f-strings.
This is also currently being fixed in #3675, but it might take a bit before merging as there is also a lot of device testing going on there.

Regarding the location, during compilation LLVM puts the runtimes (specific for the host target) in $ROOT/lib/<target_triple>.
I am not aware of it ever compiling more than one set of runtimes (maybe if you are cross-compiling LLVM itself?), but that was the easiest way i had to find the runtime library directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On my side i am ok with the glob pattern being fixed ASAP as it is a breaking change that will cause (probably) all multi-stage builds to fail using the current develop easyblock

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ocaisa

On second thought, should the get_arch_prefix introduced in #3674 be a framework function? (maybe renamed to get_compiler_arch_prefix)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Crivella I think that could indeed go into systemtools

@Crivella
Copy link
Copy Markdown
Contributor

@boegelbot please test @ jsc-zen3
EB_ARGS="LLVM-18.1.8-GCCcore-13.3.0-minimal.eb --installpath /tmp/$USER/ebpr-3676"

@boegelbot
Copy link
Copy Markdown

@Crivella: I noticed your comment, but I only dance when @akesandgren or @bartoldeman or @bedroge or @boegel or @branfosj or @casparvl or @jfgrimm or @lexming or @Micket or @migueldiascosta or @ocaisa or @SebastianAchilles or @smoors or @verdurin or @robert-mijakovic or @deniskristak or @ItIsI-Orient or @PetrKralCZ or @sassy-crick or @laraPPr or @pavelToman or @Louwrensth or @Thyre tells me (for now), I'm sorry...

Details

- notification for comment with ID 2841677283 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Apr 30, 2025

@boegelbot please test @ jsc-zen3
EB_ARGS="LLVM-18.1.8-GCCcore-13.3.0-minimal.eb --installpath /tmp/$USER/ebpr-3676"

@boegelbot
Copy link
Copy Markdown

@ocaisa: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=3676 EB_ARGS="LLVM-18.1.8-GCCcore-13.3.0-minimal.eb --installpath /tmp/$USER/ebpr-3676" EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_3676 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 6264

Test results coming soon (I hope)...

Details

- notification for comment with ID 2841691562 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@Crivella
Copy link
Copy Markdown
Contributor

As a note on the test, i do not think we have a test runner to properly test the arch string, but I do not see any particular exceptions looking at

https://github.com/llvm/llvm-project/blob/120e940356561035bf37bc4fcb6fab771e7a9b7d/llvm/cmake/config.guess#L1006-L1029

Maybe we can also add the string for 32bit systems, but this might be as discussed better moved to a framework implementation.

@julianmorillo Just in case you have the easybuild github integration installed would you mind running a minimal build uploading the report? EG eb LLVM-18.1.8-GCCcore-13.3.0-minimal.eb --include-easyblocks-from-pr 3676 --upload-test-report

@boegelbot
Copy link
Copy Markdown

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS LLVM-18.1.8-GCCcore-13.3.0-minimal.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.5, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.21
See https://gist.github.com/boegelbot/11a978ff93e236792718e4ef3f5ba170 for a full test report.

@Thyre
Copy link
Copy Markdown
Collaborator

Thyre commented May 1, 2025

We need to test a non-minimal build for this, as the arch prefix is only relevant if runtimes are built (or tests in a multi-stage build) IIRC.

The new LLVM-EasyConfig PRs would be ideal.

@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented May 1, 2025

Agree the test on RISCV should be on a full build uploaded the message and also retyping here:

For the RISCV test eb --from-pr 22517 --include-easyblocks-from-pr 3676 --upload-test-report

I tested the minimal as self._set_gcc_prefix() is still called during the configure step, but it would be ideal to test runtime builds on RISCV

@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented May 1, 2025

Now also considering the changes in #3706 I am starting to wonder if it would be better to have get_arch_prefix at the framework level in general, or for every toolchain, or possibly at the easyblock level ... 🤔

@jfgrimm
Copy link
Copy Markdown
Member

jfgrimm commented May 1, 2025

@boegel boegel changed the title Fix LLVM build on RISCV update LLVM easyblock to fix build on RISC-V systems Jun 10, 2025
@boegel boegel added this to the next release (5.1.1?) milestone Jun 10, 2025
@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 10, 2025

This looks really trivial now...

@julianmorillo Is there really all that's necessary to fix the installation of LLVM on RISC-V?

@julianmorillo
Copy link
Copy Markdown
Contributor Author

julianmorillo commented Jun 13, 2025

@boegel ,

eb --optarch=GENERIC -r LLVM-20.1.5-GCCcore-13.2.0.eb --from-commit a0e254bc8a04d20dcd97ded5e339214628074ff3 --include-easyblocks-from-pr=3676

Gives these results:

Testing Time: 11664.78s

Total Discovered Tests: 139851
  Skipped          :     32 (0.02%)
  Unsupported      :   5751 (4.11%)
  Passed           : 133367 (95.36%)
  Expectedly Failed:    269 (0.19%)
  Timed Out        :      1 (0.00%)
  Failed           :    431 (0.31%)

The build process works fine, but since only 10 failing tests are allowed in the easyconfig, it does not get finally installed. This is the complete log:
easybuild-LLVM-20.1.5-20250612.091751.cYUNa.log.zip

@Crivella
Copy link
Copy Markdown
Contributor

Many of the failing tests seems to be due to errors of the kind

# .---command stderr------------
# | error: OpenMP target is invalid: 'riscv64-unknown-linux-gnu'
# `-----------------------------

So i would guess just changing that is not enough of a fix.
It is possible is just a problem with the tests not recognizing differences in targets between stuff like -pc-linux- and -unknown-linux

We might have to add a different patch similar to https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/l/LLVM/LLVM-19.1.7_libomptarget_tests.patch or modify it to catch this case

julianmorillo and others added 18 commits July 14, 2025 17:23
…clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)"
…uption of mismatch, likely due to incomplete or buggy support in the LLVM runtime for RISC-V under '-std=c++26'
Comment thread easybuild/easyblocks/l/llvm.py Outdated
@julianmorillo
Copy link
Copy Markdown
Contributor Author

eb --optarch=GENERIC -r LLVM-20.1.5-GCCcore-13.2.0.eb --from-pr 22656 --include-easyblocks-from-pr=3676
Successfully builds on RISC-V. This is the log:
easybuild-LLVM-20.1.5-20250725.103240.log.zip

@Crivella
Copy link
Copy Markdown
Contributor

@boegelbot please test @ jsc-zen3
EB_ARGS="--installpath /tmp/$USER/ebpr-3676 LLVM-18.1.8-GCCcore-13.3.0.eb LLVM-19.1.7-GCCcore-13.3.0.eb LLVM-20.1.5-GCCcore-13.3.0.eb"
CORE_CNT=16

@boegelbot
Copy link
Copy Markdown

@Crivella: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=3676 EB_ARGS="--installpath /tmp/$USER/ebpr-3676 LLVM-18.1.8-GCCcore-13.3.0.eb LLVM-19.1.7-GCCcore-13.3.0.eb LLVM-20.1.5-GCCcore-13.3.0.eb" EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_3676 --ntasks="16" ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 7359

Test results coming soon (I hope)...

Details

- notification for comment with ID 3117641641 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegelbot
Copy link
Copy Markdown

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS LLVM-18.1.8-GCCcore-13.3.0.eb
  • SUCCESS LLVM-19.1.7-GCCcore-13.3.0.eb
  • SUCCESS LLVM-20.1.5-GCCcore-13.3.0.eb

Build succeeded for 3 out of 3 (3 easyconfigs in total)
jsczen3c2.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.5, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.21
See https://gist.github.com/boegelbot/31dde3dc21b118b07776e32c7d369f28 for a full test report.

Copy link
Copy Markdown
Contributor

@Crivella Crivella left a comment

Choose a reason for hiding this comment

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

LGTM

in the future we might want some way to also versioncontrol which tests are ignored, but that is a problem for another PR (or even a new feature in framework)

@Crivella
Copy link
Copy Markdown
Contributor

Going in, thanks @julianmorillo!

@Crivella Crivella merged commit faa1044 into easybuilders:develop Jul 31, 2025
17 checks passed
@julianmorillo julianmorillo deleted the llvm branch July 31, 2025 13:59
@boegel boegel changed the title update LLVM easyblock to fix build on RISC-V systems update LLVM easyblock to fix build on RISC-V systems and ignore a bunch of tests Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants