-
David Hendriks authoredDavid Hendriks authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
compile_script.txt 1.52 KiB
Jeff's instructions
please see README.md instead!
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
----
First, we need to compile binary_c_api.c into a shared library. We can do this by either the short way
make all
or the long way
gcc binary_c_api.c -c -lbinary_c -lm -lc -fpic
gcc -shared -o libbinary_c_api.so binary_c_api.o
####
export BINARY_C=...
export LD_LIBRARY_PATY=$BINARY_C/src
gcc `$BINARY_C/binary_c-config --flags` binary_c_api.c -c
####
Next, we need to make sure that the current directory (that containing libbinary_c_api.so) is included in $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=....
Next, we compile the python setup.py script:
python setup.py build_ext --inplace
Within python, you should be able to now run:
python python_API_test.py
Or access the python functions within an ipython notebook:
import binary_c
binary_c.function_name()
To remake, first, start by running
make clean