MCPcopy Create free account
hub / github.com/numpy/numpy / check_mathlib

Function check_mathlib

numpy/core/setup.py:381–403  ·  view source on GitHub ↗
(config_cmd)

Source from the content-addressed store, hash-verified

379# NOTE: this isn't needed in the Meson build,
380# and we won't support a MATHLIB env var
381def check_mathlib(config_cmd):
382 # Testing the C math library
383 mathlibs = []
384 mathlibs_choices = [[], ["m"], ["cpml"]]
385 mathlib = os.environ.get("MATHLIB")
386 if mathlib:
387 mathlibs_choices.insert(0, mathlib.split(","))
388 for libs in mathlibs_choices:
389 if config_cmd.check_func(
390 "log",
391 libraries=libs,
392 call_args="0",
393 decl="double log(double);",
394 call=True
395 ):
396 mathlibs = libs
397 break
398 else:
399 raise RuntimeError(
400 "math library missing; rerun setup.py after setting the "
401 "MATHLIB env variable"
402 )
403 return mathlibs
404
405
406def visibility_define(config):

Callers 3

generate_config_hFunction · 0.85
generate_numpyconfig_hFunction · 0.85
get_mathlib_infoFunction · 0.85

Calls 3

check_funcMethod · 0.80
getMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected