(parent_package='',top_path=None)
| 413 | return '' |
| 414 | |
| 415 | def configuration(parent_package='',top_path=None): |
| 416 | from numpy.distutils.misc_util import (Configuration, dot_join, |
| 417 | exec_mod_from_location) |
| 418 | from numpy.distutils.system_info import (get_info, blas_opt_info, |
| 419 | lapack_opt_info) |
| 420 | |
| 421 | config = Configuration('core', parent_package, top_path) |
| 422 | local_dir = config.local_path |
| 423 | codegen_dir = join(local_dir, 'code_generators') |
| 424 | |
| 425 | # Check whether we have a mismatch between the set C API VERSION and the |
| 426 | # actual C API VERSION. Will raise a MismatchCAPIError if so. |
| 427 | check_api_version(C_API_VERSION, codegen_dir) |
| 428 | |
| 429 | check_git_submodules() |
| 430 | |
| 431 | generate_umath_py = join(codegen_dir, 'generate_umath.py') |
| 432 | n = dot_join(config.name, 'generate_umath') |
| 433 | generate_umath = exec_mod_from_location('_'.join(n.split('.')), |
| 434 | generate_umath_py) |
| 435 | |
| 436 | header_dir = 'include/numpy' # this is relative to config.path_in_package |
| 437 | |
| 438 | cocache = CallOnceOnly() |
| 439 | |
| 440 | def generate_config_h(ext, build_dir): |
| 441 | target = join(build_dir, header_dir, 'config.h') |
| 442 | d = os.path.dirname(target) |
| 443 | if not os.path.exists(d): |
| 444 | os.makedirs(d) |
| 445 | |
| 446 | if newer(__file__, target): |
| 447 | config_cmd = config.get_config_cmd() |
| 448 | log.info('Generating %s', target) |
| 449 | |
| 450 | # Check sizeof |
| 451 | moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir) |
| 452 | |
| 453 | # Check math library and C99 math funcs availability |
| 454 | mathlibs = check_mathlib(config_cmd) |
| 455 | moredefs.append(('MATHLIB', ','.join(mathlibs))) |
| 456 | |
| 457 | check_math_capabilities(config_cmd, ext, moredefs, mathlibs) |
| 458 | moredefs.extend(cocache.check_complex(config_cmd, mathlibs)[0]) |
| 459 | |
| 460 | # Signal check |
| 461 | if is_npy_no_signal(): |
| 462 | moredefs.append('NPY_NO_SIGNAL') |
| 463 | |
| 464 | # Windows checks |
| 465 | if sys.platform == 'win32' or os.name == 'nt': |
| 466 | win32_checks(moredefs) |
| 467 | |
| 468 | # C99 restrict keyword |
| 469 | moredefs.append(('NPY_RESTRICT', config_cmd.check_restrict())) |
| 470 | |
| 471 | # Inline check |
| 472 | inline = config_cmd.check_inline() |
nothing calls this directly
no test coverage detected