Skip to content

Commit b5b502e

Browse files
committed
Started on pyfaasm native build
1 parent afaba32 commit b5b502e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

pyfaasm/pyfaasm/cfaasm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#define PY_SSIZE_T_CLEAN
2+
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
27
#include <Python.h>
38

49
// Must make sure resulting wasm imports the Faasm interface funcs
@@ -346,3 +351,7 @@ PyMODINIT_FUNC
346351
PyInit_cfaasm(void) {
347352
return PyModule_Create(&cfaasmmodule);
348353
}
354+
355+
#ifdef __cplusplus
356+
}
357+
#endif

pyfaasm/setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
]
2424

2525
FAASM_INSTALL = "/usr/local/faasm/native"
26+
FAASM_INSTALL_LIB_DIR = join(FAASM_INSTALL, "lib")
27+
28+
RUNTIME_LIBS = [
29+
join(FAASM_INSTALL_LIB_DIR, "libpistache.so"),
30+
]
2631

2732

2833
def main():
@@ -43,8 +48,10 @@ def main():
4348
extension_kwargs.update(
4449
{
4550
"libraries": FAASM_LIBS,
46-
"library_dirs": [join(FAASM_INSTALL, "lib")],
51+
"library_dirs": [FAASM_INSTALL_LIB_DIR],
4752
"include_dirs": [join(FAASM_INSTALL, "include")],
53+
"runtime_library_dirs": [FAASM_INSTALL_LIB_DIR],
54+
"extra_objects": RUNTIME_LIBS,
4855
}
4956
)
5057

tasks/pyfaasm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def test(ctx):
3636
shell_env = copy(environ)
3737
shell_env.update(
3838
{
39-
"LD_LIBRARY_PATH": NATIVE_LIBS,
4039
"PYTHON_LOCAL_CHAINING": "1",
4140
}
4241
)

0 commit comments

Comments
 (0)