(parent_package='', top_path=None)
| 7 | |
| 8 | |
| 9 | def configuration(parent_package='', top_path=None): |
| 10 | from numpy.distutils.misc_util import Configuration, get_mathlibs |
| 11 | config = Configuration('random', parent_package, top_path) |
| 12 | |
| 13 | def generate_libraries(ext, build_dir): |
| 14 | config_cmd = config.get_config_cmd() |
| 15 | libs = get_mathlibs() |
| 16 | if sys.platform == 'win32': |
| 17 | libs.extend(['Advapi32', 'Kernel32']) |
| 18 | ext.libraries.extend(libs) |
| 19 | return None |
| 20 | |
| 21 | # enable unix large file support on 32 bit systems |
| 22 | # (64 bit off_t, lseek -> lseek64 etc.) |
| 23 | if sys.platform[:3] == 'aix': |
| 24 | defs = [('_LARGE_FILES', None)] |
| 25 | else: |
| 26 | defs = [('_FILE_OFFSET_BITS', '64'), |
| 27 | ('_LARGEFILE_SOURCE', '1'), |
| 28 | ('_LARGEFILE64_SOURCE', '1')] |
| 29 | |
| 30 | defs.append(('NPY_NO_DEPRECATED_API', 0)) |
| 31 | config.add_subpackage('tests') |
| 32 | config.add_data_dir('tests/data') |
| 33 | config.add_data_dir('_examples') |
| 34 | |
| 35 | EXTRA_LINK_ARGS = [] |
| 36 | EXTRA_LIBRARIES = ['npyrandom'] |
| 37 | if os.name != 'nt': |
| 38 | # Math lib |
| 39 | EXTRA_LIBRARIES.append('m') |
| 40 | # Some bit generators exclude GCC inlining |
| 41 | EXTRA_COMPILE_ARGS = ['-U__GNUC_GNU_INLINE__'] |
| 42 | |
| 43 | if sys.platform == 'cygwin': |
| 44 | # Export symbols without __declspec(dllexport) for using by cython. |
| 45 | # Using __declspec(dllexport) does not export other necessary symbols |
| 46 | # in Cygwin package's Cython environment, making it impossible to |
| 47 | # import modules. |
| 48 | EXTRA_LINK_ARGS += ['-Wl,--export-all-symbols'] |
| 49 | |
| 50 | # Use legacy integer variable sizes |
| 51 | LEGACY_DEFS = [('NP_RANDOM_LEGACY', '1')] |
| 52 | PCG64_DEFS = [] |
| 53 | # One can force emulated 128-bit arithmetic if one wants. |
| 54 | #PCG64_DEFS += [('PCG_FORCE_EMULATED_128BIT_MATH', '1')] |
| 55 | depends = ['__init__.pxd', 'c_distributions.pxd', 'bit_generator.pxd'] |
| 56 | |
| 57 | # npyrandom - a library like npymath |
| 58 | npyrandom_sources = [ |
| 59 | 'src/distributions/logfactorial.c', |
| 60 | 'src/distributions/distributions.c', |
| 61 | 'src/distributions/random_mvhg_count.c', |
| 62 | 'src/distributions/random_mvhg_marginals.c', |
| 63 | 'src/distributions/random_hypergeometric.c', |
| 64 | ] |
| 65 | |
| 66 | def lib_opts(build_cmd): |
nothing calls this directly
no test coverage detected