mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-01-24 17:08:59 +00:00
Initial attempt to swig for python
This commit is contained in:
parent
67c6a61a18
commit
8eb99bcc96
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,3 +15,7 @@ inc/blst_aux.h*
|
|||||||
.vscode/
|
.vscode/
|
||||||
*.json
|
*.json
|
||||||
.clang-format
|
.clang-format
|
||||||
|
bindings/*/_*.so
|
||||||
|
bindings/python/*.py
|
||||||
|
bindings/python/*_wrap.c
|
||||||
|
__pycache__
|
||||||
|
9
bindings/c_kzg.swg
Normal file
9
bindings/c_kzg.swg
Normal file
@ -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"
|
8
bindings/python/Makefile
Normal file
8
bindings/python/Makefile
Normal file
@ -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…
x
Reference in New Issue
Block a user