Skip to content

Commit 3d3600c

Browse files
committed
Added code so that cython plugins now link against libmetawards_random
(and that this is copied into prefix/lib)
1 parent cb0b77a commit 3d3600c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ __pycache__
2828
/.coverage
2929
.Rproj.user
3030
R/output_*
31+
/_cython_cython_iterator.pyx
32+
/_pyxbld

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,9 @@ def no_cythonize(extensions, **_ignore):
412412
data_files=[("share/metawards/requirements",
413413
["requirements.txt", "requirements-optional.txt"]),
414414
("include/metawards/ran_binomial",
415-
glob("src/metawards/ran_binomial/*.h"))]
415+
glob("src/metawards/ran_binomial/*.h")),
416+
("lib/",
417+
glob("build/*/libmetawards_random.a"))]
416418
)
417419

418420

src/metawards/utils/_import_module.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ def import_module(module):
100100
include_path = find_mw_include()
101101
Console.print(f"Include path: {include_path}")
102102

103+
ext_libraries = [['metawards_random', {}]]
104+
103105
pyximport.install(setup_args={
104-
"include_dirs": include_path},
106+
"include_dirs": include_path,
107+
"libraries": ext_libraries
108+
},
105109
language_level=3)
106110
m = pyximport.load_module(module, pyfile,
107111
language_level=3)

0 commit comments

Comments
 (0)