Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/py-numpy/src/patches/04-random-no-lm.patch
1067 views
1
--- native/numpy/random/setup.py 2022-09-09 06:36:30.000000000 -0700
2
+++ wasm/numpy/random/setup.py 2022-09-19 21:32:55.000000000 -0700
3
@@ -38,8 +38,11 @@
4
EXTRA_LINK_ARGS = []
5
EXTRA_LIBRARIES = ['npyrandom']
6
if os.name != 'nt':
7
+ # python-wasm -- because we're explicitly using "zig wasm-ld" including -lm breaks, and isn't needed anyways, due to how
8
+ # we load dynamic libraries.
9
+ pass
10
# Math lib
11
- EXTRA_LIBRARIES.append('m')
12
+ # EXTRA_LIBRARIES.append('m')
13
# Some bit generators exclude GCC inlining
14
EXTRA_COMPILE_ARGS = ['-U__GNUC_GNU_INLINE__']
15
16
@@ -145,7 +148,11 @@
17
define_macros=defs,
18
)
19
config.add_data_files('_bounded_integers.pxd')
20
- mtrand_libs = ['m', 'npymath'] if os.name != 'nt' else ['npymath']
21
+ #mtrand_libs = ['m', 'npymath'] if os.name != 'nt' else ['npymath']
22
+
23
+ # python-wasm -- do not include -lm; see above comment.
24
+ mtrand_libs = ['npymath']
25
+
26
config.add_extension('mtrand',
27
sources=['mtrand.c',
28
'src/legacy/legacy-distributions.c',
29
30