Skip to content

Conversation

@Crivella
Copy link
Contributor

Check if libffi is a dependency, if not disable using it or if yes explicitly add the location for FFI_INCLUDE_DIR and FFI_LIBRARY_DIR

@Crivella
Copy link
Contributor Author

@boegelbot please test @ jsc-zen3
EB_ARGS="--installpath /tmp/$USER/ebpr-3849 --from-pr 23429"
CORE_CNT=16

@boegelbot
Copy link

@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=3849 EB_ARGS="--installpath /tmp/$USER/ebpr-3849 --from-pr 23429" EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_3849 --ntasks="16" ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

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

Test results coming soon (I hope)...

Details

- notification for comment with ID 3077544806 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
Contributor Author

Crivella commented Jul 16, 2025

Report for the build of 20.1.5 in the companion pr

@Crivella
Copy link
Contributor Author

@Thyre Thoughts on this, i think could lead to a similar problem we had for dlopening the CUDA/AMD libraries with offload.
In theory if libffi is not present and set to OFF i would expect to the offload to fall into the dlopen branch of the CMake logic, but this has not been tested (as we already bring libffi through other dependencies would require and ad-hoc build for it)
Not sure if there would ever be a case where you would want to compile LLVM without libffi and bring your own after?

@Thyre
Copy link
Collaborator

Thyre commented Jul 17, 2025

@Thyre Thoughts on this, i think could lead to a similar problem we had for dlopening the CUDA/AMD libraries with offload.

In theory if libffi is not present and set to OFF i would expect to the offload to fall into the dlopen branch of the CMake logic, but this has not been tested (as we already bring libffi through other dependencies would require and ad-hoc build for it)

Not sure if there would ever be a case where you would want to compile LLVM without libffi and bring your own after?

Not sure either, but I see a reason against it (for now): llvm/llvm-project#125449 (comment)

Seems like the whole libffi can be a bit brittle, and especially the dynamically loading part might be broken in recent versions. Would need to verify though.

If that would be fixed though, bringing in libffi dynamically should be just fine I think.

bartoldeman added a commit to ComputeCanada/easybuild-easyblocks that referenced this pull request Jul 17, 2025
@Crivella Crivella changed the title Add explicit enabling/disabling of libffi with custom paths LLVM: Add explicit enabling/disabling of libffi with custom paths Jul 24, 2025
Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

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

Testing done in easybuilders/easybuild-easyconfigs#23429

While there may be some lingering potential issues, they may only be realised in a scenario we don't have easyconfigs for.

@ocaisa ocaisa merged commit 4f9dddc into easybuilders:develop Jul 25, 2025
17 checks passed
@Crivella Crivella deleted the fix-LLVM_libffi branch July 25, 2025 13:42
@boegel boegel changed the title LLVM: Add explicit enabling/disabling of libffi with custom paths add explicit enabling/disabling of libffi with custom paths in LLVM easyblock Jul 30, 2025
@boegel boegel added the bug fix label Jul 30, 2025
@boegel boegel added this to the release after 5.1.1 milestone Jul 30, 2025
else:
self.general_opts['LLVM_ENABLE_LIBXML2'] = 'OFF'

libffi_root = get_software_root('libffi')
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should've probably checked if libffi is a dependency, right (via self.cfg.dependencies())?
I think the failure in easybuilders/easybuild-easyconfigs#23603 (comment) may well be caused by this change (though I don't know why not on jsc-zen3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLVM: Failures in building offload with ffi.h in non-standard location

5 participants