-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.txt
82 lines (56 loc) · 3.09 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pytbeaglehon (pronounced "beagle in python") is a python wrapper around the
beaglelib library (http://code.google.com/p/beagle-lib/ )for likelihood
computations in the domain of phylogenetics.
pytbeaglehon is written by Mark T. Holder (see License), but it also provides
extensions to the beagle API. These extensions include code taken from PAML
(by Ziheng Yang) for calculations associated with gamma-distributed
rate-heterogeneity, and code taken from MrBayes (by John Huelsenbeck,
Fredrik Ronquist, and Paul van der Mark) and from David L. Swofford for
calculating eigensolutions.
The configure and Makefiles are for building a C library that wraps and augments
beaglelib.
To build for python see the setup.py file (and its notes). Below is an example
of a build script that demonstrates some of the environmental settings used
by the build.
################################################################################
# Example full_rebuild.sh script (for mac build)
################################################################################
set -x
rm -rf ./build/lib.macosx-10.4-x86_64-2.6
rm -rf ./build/temp.macosx-10.4-x86_64-2.6
find pytbeaglehon -name "*.pyc" -exec rm {} \;
rm ./pytbeaglehon/ccore/disc_state_cont_time_model.so
export BEAGLE_PREFIX=/home/joe.user/beagle-lib/buildcpu/installed
export NCL_PREFIX="/home/joe.user/ncl/branches/buildDynamic/installed"
export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${BEAGLE_PREFIX}/lib:${NCL_PREFIX}/lib/ncl"
export PYTBEAGLEHON_LOGGING_LEVEL=debug
export CFLAGS="$CFLAGS -arch x86_64"
export PYTHONPATH=`pwd`
python setup.py build --use-ncl || exit
cp build/lib.macosx-10.4-x86_64-2.6/pytbeaglehon/ccore/disc_state_cont_time_model.so pytbeaglehon/ccore/
################################################################################
# Generating C code from python execution
################################################################################
Occassionally (typically for debugging purposes), it is useful to generate the
C pytbeaglehon calls that the python code invokes (or the beagle calls). There is
some support for doing this.
If you use the invocation:
$ python setup.py build --debug --trace-printing
to build, then you can use the following shell script to create real_beagletrace.c
and real_pytbeaglehontrace.c in the c_example directory (at the time of writing
not all of the beagle calls are tracked, but the important pytbeaglehon calls are).
################################################################################
#!/bin/sh
set -x
if test -z $1
then
echo "Expecting a path to an example python script"
exit 1
fi
cp c_example/beagle_template.c c_example/real_beagletrace.c
python "$1" 2>&1 | grep '/\* BEAGLE_API' >> c_example/real_beagletrace.c
echo 'return 0;}' >> c_example/real_beagletrace.c
cp c_example/template.c c_example/real_pytbeaglehontrace.c
python "$1" 2>&1 | grep '/\* c' >> c_example/real_pytbeaglehontrace.c
echo 'return 0;}' >> c_example/real_pytbeaglehontrace.c
################################################################################