Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions easybuild/easyblocks/n/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ def get_libs_for_mkl(varname):
'includes': includes,
}

numpy_version = LooseVersion(self.version)

if numpy_version < '1.26':
# NumPy detects the required math by trying to link a minimal code containing a call to `log(0.)`.
# The first try is without any libraries, which works with `gcc -fno-math-errno` (our optimization default)
# because the call gets removed due to not having any effect. So it concludes that `-lm` is not required.
# This then fails to detect availability of functions such as `acosh` which do not get removed in the same
# way and so less exact replacements are used instead which e.g. fail the tests on PPC.
# This variable makes it try `-lm` first and is supported until the Meson backend is used in 1.26+.
env.setvar('MATHLIB', 'm')

super(EB_numpy, self).configure_step()

if LooseVersion(self.version) < LooseVersion('1.21'):
Expand Down