diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2021-03-17 10:46:14 +0000 |
---|---|---|
committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2021-03-17 14:25:41 +0000 |
commit | 4572e12e199c2032c159121ae9afd12c3d3d5a5a (patch) | |
tree | 56cf4de3e57adb2afeb3380cbdab6c2dab12b91c /numpy/random/setup.py | |
parent | 398b01f346116e7974ef9bacf0a2b29f1b3492e4 (diff) | |
download | numpy-4572e12e199c2032c159121ae9afd12c3d3d5a5a.tar.gz |
BUG: Use lop1p to improve numerical precision
Use log1p(-x) instead of log(1 - x)
Seperate legacy version from current
closes #17020
Diffstat (limited to 'numpy/random/setup.py')
-rw-r--r-- | numpy/random/setup.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/random/setup.py b/numpy/random/setup.py index bfd08e469..dce9a101e 100644 --- a/numpy/random/setup.py +++ b/numpy/random/setup.py @@ -23,7 +23,7 @@ def configuration(parent_package='', top_path=None): # enable unix large file support on 32 bit systems # (64 bit off_t, lseek -> lseek64 etc.) - if sys.platform[:3] == "aix": + if sys.platform[:3] == 'aix': defs = [('_LARGE_FILES', None)] else: defs = [('_FILE_OFFSET_BITS', '64'), @@ -116,7 +116,7 @@ def configuration(parent_package='', top_path=None): # gen.pyx, src/distributions/distributions.c config.add_extension(gen, sources=[f'{gen}.c'], - libraries=EXTRA_LIBRARIES, + libraries=EXTRA_LIBRARIES + ['npymath'], extra_compile_args=EXTRA_COMPILE_ARGS, include_dirs=['.', 'src'], extra_link_args=EXTRA_LINK_ARGS, @@ -124,13 +124,14 @@ def configuration(parent_package='', top_path=None): define_macros=defs, ) config.add_data_files('_bounded_integers.pxd') + mtrand_libs = ['m', 'npymath'] if os.name != 'nt' else ['npymath'] config.add_extension('mtrand', sources=['mtrand.c', 'src/legacy/legacy-distributions.c', 'src/distributions/distributions.c', ], include_dirs=['.', 'src', 'src/legacy'], - libraries=['m'] if os.name != 'nt' else [], + libraries=mtrand_libs, extra_compile_args=EXTRA_COMPILE_ARGS, extra_link_args=EXTRA_LINK_ARGS, depends=depends + ['mtrand.pyx'], |