|
54 | 54 |
|
55 | 55 | EXTRA_INCLUDE_DIRS = []
|
56 | 56 | EXTRA_LINK_ARGS = []
|
| 57 | +EXTRA_LIBRARIES = ['m'] if os.name != 'nt' else [] |
57 | 58 | # Undef for manylinux
|
58 | 59 | EXTRA_COMPILE_ARGS = [] if os.name == 'nt' else [
|
59 | 60 | '-std=c99', '-U__GNUC_GNU_INLINE__']
|
|
64 | 65 | EXTRA_COMPILE_ARGS += ["-Zi", "/Od"]
|
65 | 66 | if sys.version_info < (3, 0):
|
66 | 67 | EXTRA_INCLUDE_DIRS += [join(MOD_DIR, 'src', 'common')]
|
| 68 | + |
67 | 69 | PCG64_DEFS = []
|
68 | 70 | if sys.maxsize < 2 ** 32 or os.name == 'nt':
|
69 | 71 | # Force emulated mode here
|
|
100 | 102 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
101 | 103 | join(MOD_DIR, 'src',
|
102 | 104 | 'entropy')],
|
| 105 | + libraries=EXTRA_LIBRARIES, |
103 | 106 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
104 | 107 | extra_link_args=EXTRA_LINK_ARGS
|
105 | 108 | ),
|
|
111 | 114 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
112 | 115 | join(MOD_DIR, 'src',
|
113 | 116 | 'dsfmt')],
|
| 117 | + libraries=EXTRA_LIBRARIES, |
114 | 118 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
115 | 119 | extra_link_args=EXTRA_LINK_ARGS,
|
116 | 120 | define_macros=DSFMT_DEFS,
|
|
122 | 126 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
123 | 127 | join(MOD_DIR, 'src',
|
124 | 128 | 'mt19937')],
|
| 129 | + libraries=EXTRA_LIBRARIES, |
125 | 130 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
126 | 131 | extra_link_args=EXTRA_LINK_ARGS
|
127 | 132 | ),
|
|
131 | 136 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
132 | 137 | join(MOD_DIR, 'src',
|
133 | 138 | 'philox')],
|
| 139 | + libraries=EXTRA_LIBRARIES, |
134 | 140 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
135 | 141 | extra_link_args=EXTRA_LINK_ARGS
|
136 | 142 | ),
|
|
140 | 146 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
141 | 147 | join(MOD_DIR, 'src',
|
142 | 148 | 'pcg64')],
|
| 149 | + libraries=EXTRA_LIBRARIES, |
143 | 150 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
144 | 151 | define_macros=PCG64_DEFS,
|
145 | 152 | extra_link_args=EXTRA_LINK_ARGS
|
|
150 | 157 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
151 | 158 | join(MOD_DIR, 'src',
|
152 | 159 | 'pcg32')],
|
| 160 | + libraries=EXTRA_LIBRARIES, |
153 | 161 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
154 | 162 | extra_link_args=EXTRA_LINK_ARGS
|
155 | 163 | ),
|
|
159 | 167 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
160 | 168 | join(MOD_DIR, 'src',
|
161 | 169 | 'threefry')],
|
| 170 | + libraries=EXTRA_LIBRARIES, |
162 | 171 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
163 | 172 | extra_link_args=EXTRA_LINK_ARGS
|
164 | 173 | ),
|
|
168 | 177 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
169 | 178 | join(MOD_DIR, 'src',
|
170 | 179 | 'threefry32')],
|
| 180 | + libraries=EXTRA_LIBRARIES, |
171 | 181 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
172 | 182 | extra_link_args=EXTRA_LINK_ARGS
|
173 | 183 | ),
|
|
179 | 189 | join(
|
180 | 190 | MOD_DIR, 'src',
|
181 | 191 | 'xoroshiro128')],
|
| 192 | + libraries=EXTRA_LIBRARIES, |
182 | 193 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
183 | 194 | extra_link_args=EXTRA_LINK_ARGS
|
184 | 195 | ),
|
|
189 | 200 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include(),
|
190 | 201 | join(MOD_DIR, 'src',
|
191 | 202 | 'xorshift1024')],
|
| 203 | + libraries=EXTRA_LIBRARIES, |
192 | 204 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
193 | 205 | extra_link_args=EXTRA_LINK_ARGS
|
194 | 206 | ),
|
195 | 207 | Extension("randomgen.generator",
|
196 | 208 | ["randomgen/generator.pyx",
|
197 | 209 | join(MOD_DIR, 'src', 'distributions',
|
198 | 210 | 'distributions.c')],
|
| 211 | + libraries=EXTRA_LIBRARIES, |
199 | 212 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include()],
|
200 | 213 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
201 | 214 | extra_link_args=EXTRA_LINK_ARGS
|
202 | 215 | ),
|
203 | 216 | Extension("randomgen.common",
|
204 | 217 | ["randomgen/common.pyx"],
|
| 218 | + libraries=EXTRA_LIBRARIES, |
205 | 219 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include()],
|
206 | 220 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
207 | 221 | extra_link_args=EXTRA_LINK_ARGS
|
|
210 | 224 | ["randomgen/bounded_integers.pyx",
|
211 | 225 | join(MOD_DIR, 'src', 'distributions',
|
212 | 226 | 'distributions.c')],
|
| 227 | + libraries=EXTRA_LIBRARIES, |
213 | 228 | include_dirs=EXTRA_INCLUDE_DIRS + [np.get_include()],
|
214 | 229 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
215 | 230 | extra_link_args=EXTRA_LINK_ARGS
|
|
219 | 234 | join(MOD_DIR, 'src', 'legacy',
|
220 | 235 | 'distributions-boxmuller.c'),
|
221 | 236 | join(MOD_DIR, 'src', 'distributions', 'distributions.c')],
|
| 237 | + libraries=EXTRA_LIBRARIES, |
222 | 238 | include_dirs=EXTRA_INCLUDE_DIRS +
|
223 | 239 | [np.get_include()] + [join(MOD_DIR, 'legacy')],
|
224 | 240 | extra_compile_args=EXTRA_COMPILE_ARGS,
|
|
0 commit comments