easybuilders / easybuild-easyblocks

Collection of easyblocks that implement support for building and installing software with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
106 stars 285 forks source link

make sure that OpenFOAM's wmake can find MPFR and GMP if CGAL >= 5.0 (header-only) is used #3366

Closed bedroge closed 5 months ago

bedroge commented 5 months ago

With EESSI we ran into several undefined references to GMP and MPFR when building OpenFOAM v2312, see https://github.com/EESSI/software-layer/pull/563#issuecomment-2154947665

This seems related to CGAL, which is header-only since version 5.0. Apparently, here's still some kind of indirect dependency on GMP and MPFR (the Ubuntu installation instructions also have these packages listed: https://gitlab.com/openfoam/openfoam/-/blob/master/doc/Requirements.md#ubuntu-eg-2204), which are lacking in the EESSI build container.

Even though OpenFOAM's wmake scripts seems to contain functionality for handling these situations (there is a cgal-no-mpfr rule, for instance: https://gitlab.com/openfoam/openfoam/-/blob/master/wmake/rules/General/cgal-no-mpfr?ref_type=heads), there are lots of issues about the same topic, e.g. this one related to Spack: https://develop.openfoam.com/Development/openfoam/-/issues/3101. They even stick to CGAL 4.x: https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/openfoam/package.py#L372.

This PR fixes this by overriding some variables in the have_cgal script, which finds CGAL and MPFR, in case CGAL >= 5.0 is used and MPFR is listed as dependency in the easyconfig. For the latter I'll open an easyconfigs PR.

boegel commented 5 months ago

@bedroge CI problem not related to changes here is fixed via #3365, this PR needs a sync with develop

bedroge commented 5 months ago

@bedroge CI problem not related to changes here is fixed via #3365, this PR needs a sync with develop

@boegel done!

boegel commented 5 months ago

@boegelbot please test @ jsc-zen3 CORE_CNT=16 EB_ARGS="OpenFOAM-v2306-foss-2022b.eb OpenFOAM-v2312-foss-2023a.eb OpenFOAM-11-foss-2023a.eb"

boegelbot commented 5 months ago

@boegel: 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=3366 EB_ARGS="OpenFOAM-v2306-foss-2022b.eb OpenFOAM-v2312-foss-2023a.eb OpenFOAM-11-foss-2023a.eb" EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_3366 --ntasks="16" ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

Test results coming soon (I hope)...

*- notification for comment with ID 2176198762 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 commented 5 months ago

Test report by @boegelbot

Overview of tested easyconfigs (in order)

Build succeeded for 6 out of 6 (3 easyconfigs in total) jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.4, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.18 See https://gist.github.com/boegelbot/4c3df7bafdc01173936f5fa45d5da93c for a full test report.