Skip to content

Commit

Permalink
check for MPFR
Browse files Browse the repository at this point in the history
  • Loading branch information
bedroge committed Jun 17, 2024
1 parent 3601276 commit 7b0eb36
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions easybuild/easyblocks/o/openfoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,22 @@ def configure_step(self):
for dep in self.cfg.dependencies():
# CGAL >= 5.x is header-only, but when using it OpenFOAM still needs MPFR and GMP.
# It may fail to find them, so inject the right settings and paths into the "have_cgal" script.
if dep['name'] == 'CGAL' and LooseVersion(dep['version']) >= LooseVersion('5.0'):
have_cgal_script = os.path.join(self.builddir, self.openfoamdir, 'wmake', 'scripts', 'have_cgal')
eb_cgal_config = '''
# Injected by EasyBuild
HAVE_CGAL=true
HAVE_MPFR=true
CGAL_FLAVOUR=header
CGAL_INC_DIR=${EBROOTCGAL}/include
CGAL_LIB_DIR=${EBROOTCGAL}/lib
MPFR_INC_DIR=${EBROOTMPFR}/include
MPFR_LIB_DIR=${EBROOTMPFR}/lib
'''
apply_regex_substitutions(have_cgal_script, [(r"^(esac)$", r"\1\n" + eb_cgal_config)])
if dep['name'] == 'CGAL' and LooseVersion(dep['version']) >= LooseVersion('5.0')
if get_software_root('MPFR'):
have_cgal_script = os.path.join(
self.builddir, self.openfoamdir, 'wmake', 'scripts', 'have_cgal'
)
eb_cgal_config = '''
# Injected by EasyBuild
HAVE_CGAL=true
HAVE_MPFR=true
CGAL_FLAVOUR=header
CGAL_INC_DIR=${EBROOTCGAL}/include
CGAL_LIB_DIR=${EBROOTCGAL}/lib
MPFR_INC_DIR=${EBROOTMPFR}/include
MPFR_LIB_DIR=${EBROOTMPFR}/lib
'''
apply_regex_substitutions(have_cgal_script, [(r"^(esac)$", r"\1\n" + eb_cgal_config)])

def build_step(self):
"""Build OpenFOAM using make after sourcing script to set environment."""
Expand Down

0 comments on commit 7b0eb36

Please sign in to comment.