Initial attempt to swig for python
This commit is contained in:
parent
67c6a61a18
commit
8eb99bcc96
|
@ -15,3 +15,7 @@ inc/blst_aux.h*
|
|||
.vscode/
|
||||
*.json
|
||||
.clang-format
|
||||
bindings/*/_*.so
|
||||
bindings/python/*.py
|
||||
bindings/python/*_wrap.c
|
||||
__pycache__
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
%module ckzg
|
||||
%include "stdint.i"
|
||||
%{
|
||||
#include <stdbool.h>
|
||||
#include "c_kzg.h"
|
||||
%}
|
||||
%rename(alloc_poly) new_poly;
|
||||
%rename(alloc_poly_l) new_poly_l;
|
||||
%include "../src/c_kzg.h"
|
|
@ -0,0 +1,8 @@
|
|||
INCLUDE_DIRS = .. ../../src ../../inc
|
||||
INCLUDE_PY = $(shell python -c 'import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))')
|
||||
|
||||
_ckzg.so: c_kzg_wrap.c ../../src/libckzg.a ../../lib/libblst.a
|
||||
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -o $@ $^
|
||||
|
||||
c_kzg_wrap.c ckzg.py: ../c_kzg.swg
|
||||
swig -O -python -outcurrentdir $<
|
Loading…
Reference in New Issue