Skip to content
Snippets Groups Projects
README.md 2.03 KiB
Newer Older
David Hendriks's avatar
David Hendriks committed
# Python module for binary_c

Based on a original work by Jeff Andrews, updated and extended
for Python3 by Robert Izzard

David Hendriks's avatar
David Hendriks committed
**THIS CODE IS VERY EXPERIMENTAL AND PROBABLY WILL NOT WORK**

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.)
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:
David Hendriks's avatar
David Hendriks committed
```
David Hendriks's avatar
David Hendriks committed
```
Then to test the Python module:
David Hendriks's avatar
David Hendriks committed
```
David Hendriks's avatar
David Hendriks committed
```
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).

If you want to be able to import the binary_c module correctly for child directories (or anywhere for that matter), execute or put the following code in your .bashrc/.zshrc: 
```
export LD_LIBRARY_PATH=<full path to directory containing libbinary_c_api.so>
```

- ?Put the header and src files in a dedicated directory. 
- Use sphinx for auto generation of docs
- Use queueing system/asynchronous task queue
- Make some parse-data that can be easily used
- Make some simple script to assign probabilities