-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
192 lines (151 loc) · 8.07 KB
/
INSTALL
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
INSTALL instructions
====================
Pymcmc should build relatively easily under most linux/
unix platforms. For example, under ubuntu, to prepare,
running the commands:
sudo apt-get install python-scipy libatlas3gf-sse2
sudo python setup.py install
should be all you need to do.
For other platforms, we recommend you install the binary versions,
but if you need to build from source, see the instructions later
in this file.
Requirements:
=============
*Python*
Pymcmc was built using Python 2.6. You will also need
the following python packages:numpy, scipy, matplotlib.
Each of these should be relatively easy to install under
most platforms. See the web pages for more information.
*ATLAS*
Some functions require blas/lapack. We recommend installing
atlas for your platform to get the best performance. Most
distributions will have precompiled versions available,
but if you need to build your own, there are numerous web
pages with instructions. See, for example, the scipy wiki
at http://www.scipy.org/Installing_SciPy/Linux
If you install the windows or Mac binary of pymcmc, you
will not need to install atlas unless you want to create
new functions using fortran or f2py which require ATLAS.
See the windows build instructions further down for information
on building ATLAS on windows.
*optional packages*
The python package pysparse (http://pysparse.sourceforge.net/)
is used in one of the examples.
If you prefer to analyse the posterior samples in R, you will
need to install R. Rpy2 allows you to call R from within python,
and can be useful.
INSTALLING
==========
Most users should just need to run:
python setup.py install
If your ATLAS libraries are in places that aren't detected
by python, you may have to modify setup.py. See the comments
in that file for more information.
WINDOWS USERS
=============
The easiest way to get started using pymcmc is to install
python2.6, numpy, scipy, and matplotlib using windows binaries
(see the websites of each of these for information on this).
Then install the windows binary of pymcmc. If you need to
build pymcmc from source, here are some guidelines:
*building from source under windows*
Install python, numpy,scipy,matplotlib. For building ATLAS,
look at http://www.scipy.org/Installing_SciPy/Windows, and
follow http://nipy.sourceforge.net/nipy/stable/devel/install/windows_scipy_build.html
and also http://www.mingw.org/wiki/msys/.
I installed 1.0.11. The DTK provides everything you need (bzip2,
diffutils, gawk,make,binutils)
Install cygwin, and build atlas from there.
To use gfortran, you might have to change your path, for example:
export PATH=/usr/local/bin:/bin:/c/Program\ Files/gfortran/libexec/gcc/i586-pc-mingw32/4.6.0:/c/Program\ Files/gfortran/bin:/c/python26
Unpack the pymcmc archive, and modify the setup.py file to make sure
the library_dirs are set correctly for your system, for example
library_dirs = ["/d/tmp/pymcmc_win_install/BUILDS/lib/"].
Run
python setup.py build
This may fail, due to the order of some of the libraries, so you may
need to have the python linking first.
So, when it fails, you can manually do
## (modify the paths to suit your environment):
p1=build/temp.win32-2.6/Release/build/src.win32-2.6/
p2=build/temp.win32-2.6/Release/Src/
p3=build/lib.win32-2.6/
gfortran.exe -Wall -mno-cygwin -Wall -mno-cygwin -shared \
${p1}/stochsearchmodule.o \
${p1}/fortranobject.o ${p2}/stochsearch.o \
${p1}/stochsearch-f2pywrappers.o \
-L c:/python26/libs -lpython26 \
-L/d/tmp/pymcmc_win_install/BUILDS/lib/ \
-llapack -lcblas -lf77blas -latlas -lg2c -o ${p3}/stochsearch.pyd
python setup.py build
gfortran.exe -Wall -mno-cygwin -Wall -mno-cygwin -shared \
${p1}wishartmodule.o \
${p1}/fortranobject.o \
${p2}/wishart.o \
-L c:/python26/libs -lpython26 \
-L/d/tmp/pymcmc_win_install/BUILDS/lib/ \
-llapack -lcblas -lf77blas -latlas -lg2c -o ${p3}/wishart.pyd
python setup.py build
then
python setup.py bdist
or
python setup.py bdist --format=wininst
To run example ex_AR1.py, you will also need the python module pysparse.
To build a windows binary, modify the setup.py to include the library_dirs_list
as for pymcmc. You will also have the same compile problem as before.
p1=build/temp.win32-2.6/Release/src/
p2=build/lib.win32-2.6/pysparse/
dllwrap.exe -mno-cygwin -mdll -static --entry _DllMain@12 \
--output-lib ${p1}/libitsolvers.a \
--def ${p1}/itsolvers.def \
-s ${p1}/itsolversmodule.o \
${p1}/pcg.o ${p1}/gmres.o \
${p1}/minres.o \
${p1}/qmrs.o \
${p1}/bicgstab.o \
${p1}/cgs.o \
-L/c/python26/libs -lpython26 \
-L/d/tmp/pymcmc_win_install/BUILDS/lib/ \
-llapack -lcblas -lf77blas -latlas -lmsvcr90 -o ${p2}/itsolvers.pyd
dllwrap.exe -mno-cygwin -mdll -static --entry _DllMain@12 \
--output-lib ${p1}libprecon.a \
--def ${p1}/precon.def \
-s ${p1}/preconmodule.o \
-L/c/python26/libs -lpython26 \
-L/d/tmp/pymcmc_win_install/BUILDS/lib/ \
-llapack -lcblas -lf77blas -latlas -lmsvcr90 -o ${p2}/precon.pyd
dllwrap.exe -mno-cygwin -mdll -static --entry _DllMain@12 \
--output-lib ${p1}/libjdsym.a \
--def ${p1}jdsym.def \
-s ${p1}jdsymmodule.o \
-L/c/python26/libs -lpython26 \
-L/d/tmp/pymcmc_win_install/BUILDS/lib/ \
-llapack -lcblas -lf77blas -latlas -o ${p2}/jdsym.pyd -lg2c
python setup.py build --compiler mingw32
p3=build/temp.win32-2.6/Release/
dllwrap.exe -mno-cygwin -mdll -static --entry _DllMain@12 --output-lib ${p1}/libsuperlu.a --def ${p1}/superlu.def -s ${p1}/superlumodule.o ${p3}/superlu/dcolumn_bmod.o ${p3}/superlu/dcolumn_dfs.o ${p3}/superlu/dcomplex.o ${p3}/superlu/scomplex.o ${p3}/superlu/dcopy_to_ucol.o ${p3}/superlu/dgscon.o ${p3}/superlu/dgsequ.o ${p3}/superlu/dgsrfs.o ${p3}/superlu/dgssv.o ${p3}/superlu/dgssvx.o ${p3}/superlu/dgstrf.o ${p3}/superlu/dgstrs.o ${p3}/superlu/dlacon.o ${p3}/superlu/dlamch.o ${p3}/superlu/dlangs.o ${p3}/superlu/dlaqgs.o ${p3}/superlu/dmemory.o ${p3}/superlu/colamd.o ${p3}/superlu/dpanel_bmod.o ${p3}/superlu/dpanel_dfs.o ${p3}/superlu/dpivotl.o ${p3}/superlu/dpivotgrowth.o ${p3}/superlu/dprunel.o ${p3}/superlu/dreadhb.o ${p3}/superlu/dsnode_bmod.o ${p3}/superlu/dsnode_dfs.o ${p3}/superlu/dsp_blas2.o ${p3}/superlu/dsp_blas3.o ${p3}/superlu/superlu_timer.o ${p3}/superlu/dutil.o ${p3}/superlu/dzsum1.o ${p3}/superlu/get_perm_c.o ${p3}/superlu/icmax1.o ${p3}/superlu/izmax1.o ${p3}/superlu/lsame.o ${p3}/superlu/memory.o ${p3}/superlu/mmd.o ${p3}/superlu/relax_snode.o ${p3}/superlu/sp_coletree.o ${p3}/superlu/sp_ienv.o ${p3}/superlu/sp_preorder.o ${p3}/superlu/util.o ${p3}/superlu/xerbla.o -Lc:/python26/libs -lpython26 -L/d/tmp/pymcmc_win_install/BUILDS/lib/ -llapack -lcblas -lf77blas -latlas -lmsvcr90 -lg2c -o build/lib.win32-2.6/pysparse/superlu.pyd
python setup.py bdist --format=wininst
MAC Users:
=============
The easiest way to get started using pymcmc is to install
python2.6, numpy, scipy, matplotlib using mac binaries
(see the websites of each of these for information on this).
Then install the macintosh binary of pymcmc. This is a simple
zip file, and you should unzip it and move the archive to the
appropriate place. If you unzip it from / it will install into
./Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages.
*building from source*
If you need to build pymcmc from source, here are some guidelines:
Get a recent version of python, I used python2.6. It is generally
recommended to not use the mac inbuilt version of python. Then follow
the instructions to get scipy installed, including getting developer
tools. I'm using 10.5.8, so I downloaded 3.1.3 (994.6MB!)
You also need a fortran compiler, I got gfortran after following
links on building R for mac (http://r.research.att.com/tools/).
I couldn't get gfortran to link without using the dynamic version of
libgfortran. In the end, I temporarily moved the dynamic libs and
created a link from libgfortran.a to libgfortran_static.a and put libs
= ['libgfortran_static'] in setup.py
Then,
python setup.py bdist
and distribute.