mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-19 21:38:06 +00:00
Fix python bindings on macOS (#117)
* Fix python bindings on macOS * Update workflow * Remove unnecessary Makefile vars * Add src dir to include dirs * Fix phony
This commit is contained in:
parent
e487800529
commit
fd029a7d00
2
.github/workflows/python-bindings-test.yml
vendored
2
.github/workflows/python-bindings-test.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
- name: Build Python bindings
|
- name: Build Python bindings
|
||||||
run: |
|
run: |
|
||||||
cd bindings/python
|
cd bindings/python
|
||||||
make ckzg.so
|
make install
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
cd bindings/python
|
cd bindings/python
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
INCLUDE_DIRS = .. ../../src ../../inc
|
|
||||||
INCLUDE_PY = $(shell python3 -c 'import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))')
|
|
||||||
|
|
||||||
FIELD_ELEMENTS_PER_BLOB?=4096
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
all: install test ecc_test
|
||||||
|
|
||||||
all: test ecc_test
|
.PHONY: install
|
||||||
|
install: setup.py ckzg.c
|
||||||
|
python3 setup.py install
|
||||||
|
|
||||||
test: tests.py ckzg.so
|
.PHONY: test
|
||||||
|
test: tests.py
|
||||||
python3 $<
|
python3 $<
|
||||||
|
|
||||||
ecc_test: py_ecc_tests.py ckzg.so
|
.PHONY: ecc_test
|
||||||
|
ecc_test: py_ecc_tests.py
|
||||||
python3 $<
|
python3 $<
|
||||||
|
|
||||||
ckzg.so: ckzg.c ../../src/c_kzg_4844.o ../../lib/libblst.a
|
|
||||||
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -DFIELD_ELEMENTS_PER_BLOB=${FIELD_ELEMENTS_PER_BLOB} -o $@ $^
|
|
||||||
|
18
bindings/python/setup.py
Normal file
18
bindings/python/setup.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from distutils.core import setup, Extension
|
||||||
|
|
||||||
|
def main():
|
||||||
|
setup(
|
||||||
|
name="ckzg",
|
||||||
|
version="1.0.0",
|
||||||
|
description="Python interface for C-KZG-4844",
|
||||||
|
ext_modules=[
|
||||||
|
Extension(
|
||||||
|
"ckzg",
|
||||||
|
sources=["ckzg.c", "../../src/c_kzg_4844.c"],
|
||||||
|
include_dirs=["../../inc", "../../src"],
|
||||||
|
define_macros=[("FIELD_ELEMENTS_PER_BLOB", "4096")],
|
||||||
|
library_dirs=["../../lib"],
|
||||||
|
libraries=["blst"])])
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
x
Reference in New Issue
Block a user