Skip to content
Snippets Groups Projects
Commit cf9141f7 authored by David Hendriks's avatar David Hendriks
Browse files

updated readme. Built and tested. So far so good. updated gitignore to ignore compiled files

parent be82d9c5
No related branches found
No related tags found
No related merge requests found
*.so
binary_c_python_api.o
...@@ -9,36 +9,35 @@ r.izzard@surrey.ac.uk ...@@ -9,36 +9,35 @@ r.izzard@surrey.ac.uk
http://personal.ph.surrey.ac.uk/~ri0005/binary_c.html http://personal.ph.surrey.ac.uk/~ri0005/binary_c.html
09/06/2019 09/06/2019
Requirements
---------------------
- Python3
- binary_c version 2.1+
- requirements.txt (no?)
Environment variables Environment variables
--------------------- ---------------------
Before compilation you should set the following environment variables: Before compilation you should set the following environment variables:
required: `BINARY_C` should point to the root directory of your binary_c installation - required: `BINARY_C` should point to the root directory of your binary_c installation
- recommended: `LD_LIBRARY_PATH` should include $BINARY_C/src and whatever directories are required to run binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)
recommended: `LD_LIBRARY_PATH` should include $BINARY_C/src and whatever directories are required to run binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.) - recommended: `LIBRARY_PATH` should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)
recommended: `LIBRARY_PATH` should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)
Build instructions Build instructions
--------------------- ---------------------
To build the module, make sure you have built binary_c (with `make` in the binary_c root directory), its shared library (with `make libbinary_c.so` in the binary_c root directory), and set environment variables as described above, then run the following code in t:
To build the module, make sure you have built binary_c (with "make" in the binar_c root directory), its shared library (with "make libbinary_c.so" in the binary_c root directory), and set environment variables as described above, then run:
``` ```
make clean make clean
make make
``` ```
Then to test the Python module: Then to test the Python module:
``` ```
python3 ./python_API_test.py python3 ./python_API_test.py
``` ```
You will require whatever libraries with which binary_c was compiled, as well as the compiler with which Python was built (usually gcc, which is easily installed on most systems). You will require whatever libraries with which binary_c was compiled, as well as the compiler with which Python was built (usually gcc, which is easily installed on most systems).
TODO
------------------------------------------------------------ ---------------------
- ?Put the header and src files in a dedicated directory
- ?Have the compiled files be written into build
No preview for this file type
gcc -fPIC `/vol/ph/astro_code/dhendriks/binaryc/binary_c/binary_c-config --flags` -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/ -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/API -c -o binary_c_python_api.o binary_c_python_api.c
gcc -DBINARY_C=/vol/ph/astro_code/dhendriks/binaryc/binary_c -fPIC `/vol/ph/astro_code/dhendriks/binaryc/binary_c/binary_c-config --flags` -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/ -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/API binary_c_python_api.c -c -lbinary_c `/vol/ph/astro_code/dhendriks/binaryc/binary_c/binary_c-config --libs`
gcc -DBINARY_C=/vol/ph/astro_code/dhendriks/binaryc/binary_c -shared -o libbinary_c_api.so binary_c_python_api.o
python3 setup.py build_ext --inplace
running build_ext
building 'binary_c' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DALIGNSIZE=16 -DCPUFREQ=3600 -DLINUX -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__HAVE_PERF_EVENTS__ -DGIT_REVISION=1:20190808:97d7029f -DGIT_URL=gitlab@gitlab.eps.surrey.ac.uk:ri0005/binary_c.git -DGIT_BRANCH=branch_david -D__HAVE_AVX__ -D__HAVE_DRAND48__ -D__HAVE_GSL__ -DUSE_GSL -D__HAVE_LIBBSD__ -D__HAVE_MALLOC_H__ -D__HAVE_PKG_CONFIG__ -D__HAVE_VALGRIND__ -D__SHOW_STARDATA__ -DBINARY_C_API_H=/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/API/binary_c_API.h -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src -I/vol/ph/astro_code/dhendriks/binaryc/binary_c/src/API -I/vol/ph/astro_code/dhendriks/binaryc/binary_c -I/usr/include -I/user/HS128/dh00601/gsl/include -I/user/HS128/dh00601/.pyenv/versions/binaryc_py3.6.4/include -I/user/HS128/dh00601/.pyenv/versions/3.6.4/include/python3.6m -c binary_c_python.c -o build/temp.linux-x86_64-3.6/binary_c_python.o
gcc -pthread -shared -L/user/HS128/dh00601/.pyenv/versions/3.6.4/lib -L/user/HS128/dh00601/.pyenv/versions/3.6.4/lib build/temp.linux-x86_64-3.6/binary_c_python.o -L/vol/ph/astro_code/dhendriks/binaryc/binary_c/src -L./ -L-L/vol/ph/astro_code/dhendriks/binaryc/binary_c -L-L/user/HS128/dh00601/gsl/lib -Wl,--enable-new-dtags,-R/vol/ph/astro_code/dhendriks/binaryc/binary_c/src -Wl,--enable-new-dtags,-R./ -Wl,--enable-new-dtags,-R-L/vol/ph/astro_code/dhendriks/binaryc/binary_c -Wl,--enable-new-dtags,-R-L/user/HS128/dh00601/gsl/lib -lbinary_c -lgsl -lgslcblas -lm -lbsd -lc -lm -ldl -lbinary_c_api -o /vol/ph/astro_code/dhendriks/binaryc/binary_c-python/binary_c.cpython-36m-x86_64-linux-gnu.so
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment