diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..aed2a66383de9b6d54dc10127ebd9981c138ad7f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.so +binary_c_python_api.o + diff --git a/README.md b/README.md index 391801de4b4618778a8b0e6304fbcc4bad42008e..ae71ee394944e598675482f9d5ff0df7a6d308e9 100644 --- a/README.md +++ b/README.md @@ -9,36 +9,35 @@ r.izzard@surrey.ac.uk http://personal.ph.surrey.ac.uk/~ri0005/binary_c.html 09/06/2019 +Requirements +--------------------- +- Python3 +- binary_c version 2.1+ +- requirements.txt (no?) 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 - -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.) - +- 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: `LIBRARY_PATH` should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.) Build instructions --------------------- - -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: - +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: ``` make clean make ``` - Then to test the Python module: ``` 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). - ------------------------------------------------------------- +TODO +--------------------- +- ?Put the header and src files in a dedicated directory +- ?Have the compiled files be written into build diff --git a/build/temp.linux-x86_64-3.6/binary_c_python.o b/build/temp.linux-x86_64-3.6/binary_c_python.o index bba02037bc5f94be740eb94c38cedddff2d45a98..ca9e7c36ab4089a52d0b5498471952e18df97964 100644 Binary files a/build/temp.linux-x86_64-3.6/binary_c_python.o and b/build/temp.linux-x86_64-3.6/binary_c_python.o differ diff --git a/make_output.txt b/make_output.txt new file mode 100644 index 0000000000000000000000000000000000000000..f5c47eae0d6573ddba2b6445bebce381a1baad45 --- /dev/null +++ b/make_output.txt @@ -0,0 +1,8 @@ +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