Project

General

Profile

Install EMAN2 » History » Version 63

Amber Herold, 11/25/2013 10:41 AM

1 1 Neil Voss
h1. Install EMAN2/SPARX
2
3 53 Amber Herold
*Before you begin:*
4 55 Amber Herold
Please note that Appion 2.2, Appion 2.2-redux and any earlier releases do not include any features that require EMAN2/SPARX to be installed. Appion 3.0, the development trunk and future releases will require this software.
5
This documentation assumes you are using CentOS 6 (written as of CentOS 6.4)
6
It is best to install EMAN2/SPARX from source, to avoid conflicts with having two different versions of python on your system. Binaries of EMAN2/SPARX all come with their own python pre-installed.
7 6 Neil Voss
8
9 55 Amber Herold
h2. Install pre-requisite packages for EMAN2 compiling
10 6 Neil Voss
11 27 Neil Voss
h3. yum based packages
12
13 7 Neil Voss
* Make sure EPEL is install, if not go here: [[Download additional Software (CentOS Specific)]]
14
* Use yum to install devel libraries:
15
<pre>
16 10 Neil Voss
sudo yum install fftw-devel gsl-devel boost-python numpy \
17 12 Neil Voss
 PyQt4-devel cmake ipython hdf5-devel libtiff-devel libpng-devel \
18 8 Neil Voss
 PyOpenGL ftgl-devel db4-devel python-argparse openmpi-devel
19 1 Neil Voss
</pre>
20 27 Neil Voss
21
h3. bsddb3
22
23
Additionally you need to install the python-bsddb3 library (not available via YUM). I just use the pypi easy_installer, yum will never know.
24 26 Neil Voss
<pre>
25 1 Neil Voss
sudo easy_install bsddb3
26
</pre>
27 27 Neil Voss
28 3 Neil Voss
h2. Download the source
29
30
# To download the source code go to the link:
31
#* http://blake.bcm.edu/emanwiki/EMAN2
32 56 Amber Herold
# Click on *"Main EMAN2 Download Page"*
33 57 Amber Herold
# Click on *"Download EMAN 2.0x"*, whichever is the latest minor release of 2.0. 
34 60 Amber Herold
# Scroll down to *Source* to download the *eman2.07.source.tar.gz* 
35 3 Neil Voss
36
h2. Work with the source
37
38
# go to the directory with the source code
39
# extract the archive:
40
<pre>
41 60 Amber Herold
tar zxvf eman2.07.source.tar.gz
42 1 Neil Voss
</pre>
43 15 Neil Voss
# go into directory
44
<pre>cd EMAN2/src/build</pre>
45 19 Neil Voss
# start configure script:
46 11 Neil Voss
<pre>cmake ../eman2/</pre>
47 15 Neil Voss
#* Note: alternatively you can run @ccmake ../eman2/@ and configure all the parameters
48 18 Neil Voss
# start compiling:
49
<pre>make</pre>
50 3 Neil Voss
# install to directory:
51 23 Neil Voss
<pre>sudo make install</pre>
52
53
h2. Set environmental variables
54
55
h3. bash
56
57
<pre>sudo nano /etc/profile.d/eman2.sh</pre>
58 24 Neil Voss
59
<pre>
60
export EMAN2DIR=/usr/local/EMAN2
61
export PATH=${EMAN2DIR}/bin:${PATH}
62 23 Neil Voss
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
63
export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin
64
</pre>
65 16 Neil Voss
66 51 Neil Voss
h3. c shell
67
68
<pre>sudo nano /etc/profile.d/eman2.csh</pre>
69
70
<pre>
71
setenv EMAN2DIR /usr/local/EMAN2
72
setenv PATH ${EMAN2DIR}/bin:${PATH}
73
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
74
setenv PYTHONPATH ${EMAN2DIR}/lib:${EMAN2DIR}/bin
75
</pre>
76
77
78 50 Neil Voss
h2. Install MyMPI
79 42 Neil Voss
80 63 Amber Herold
* First, add the openmpi module so that MyMPI can find it.
81
<pre>
82
module add openmpi-i386
83
-or-
84
module add openmpi-x86_64
85
</pre>
86
87 42 Neil Voss
* Download source: 
88 61 Amber Herold
From the main software page: http://ncmi.bcm.tmc.edu/ncmi/software/software_details?selected_software=counter_222 scroll to *MPI Support*.
89
Click on *Download MPI Support*
90
Click on *pydusa-1.15es.tgz*
91 42 Neil Voss
* Extract:
92 61 Amber Herold
<pre>tar zxvf pydusa-1.15es.tgz</pre>
93 42 Neil Voss
* go into directory
94 61 Amber Herold
<pre>cd pydusa-1.15es</pre>
95 54 Neil Voss
96 62 Amber Herold
If you are on a 64bit machine, you may have problems with the code finding the numpy headers:
97 54 Neil Voss
98 34 Neil Voss
<pre>nano configure</pre>
99 54 Neil Voss
100
find the line:
101 1 Neil Voss
<pre>
102
elif test -d ${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include; then
103
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include"
104 54 Neil Voss
</pre>
105
and replace it with:
106
107
<pre>
108 1 Neil Voss
elif test -d ${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include; then
109
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include"
110 46 Neil Voss
</pre>
111
* Configure:
112
<pre>
113
setenv MPIROOT /usr/lib64/openmpi
114
setenv MPIINC /usr/include/openmpi-x86_64
115
setenv MPILIB ${MPIROOT}/lib
116
setenv MPIBIN ${MPIROOT}/bin
117 1 Neil Voss
./configure
118
</pre>
119
<pre>
120
export MPIROOT=/usr/lib64/openmpi
121
export MPIINC=/usr/include/openmpi-x86_64
122
export MPILIB=${MPIROOT}/lib
123 47 Neil Voss
export MPIBIN=${MPIROOT}/bin
124 46 Neil Voss
./configure
125
</pre>
126
* compile the source:
127
<pre>make</pre>
128
* copy the mpi.so to site-packages with a different name:
129
<pre>
130 1 Neil Voss
sudo mkdir /usr/lib64/python2.6/site-packages/mympi/
131 52 Neil Voss
sudo touch /usr/lib64/python2.6/site-packages/mympi/__init__.py
132 1 Neil Voss
sudo cp -v src/mpi.so /usr/lib64/python2.6/site-packages/mympi/mpi.so
133
</pre>
134 47 Neil Voss
* create a wrapper around the wrapper:
135 1 Neil Voss
<pre>sudo nano /usr/lib64/python2.6/site-packages/mpi.py</pre>
136
<pre>
137
import ctypes
138
mpi = ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL)
139
from mympi.mpi import *
140
</pre>
141 50 Neil Voss
This needs to be done to avoid the error:
142
<pre>
143
python: symbol lookup error: 
144
  /usr/lib64/openmpi/lib/openmpi/mca_paffinity_hwloc.so: 
145
    undefined symbol: mca_base_param_reg_int
146
</pre>
147 1 Neil Voss
148
* test 1: 
149
<pre>
150
python -c 'import mpi'
151
python -c 'import sys; from mpi import mpi_init; mpi_init(len(sys.argv), sys.argv)'
152
</pre>
153
154 50 Neil Voss
* test 2: 
155
<pre>sxisac.py start.hdf</pre>
156
(Note: start.hdf does not need to exist, if it does not exist then it should exit with file not found)
157 42 Neil Voss
158 50 Neil Voss
h2. Test to see if code works
159
160
see http://blake.bcm.edu/emanwiki/EMAN2/FAQ/EMAN2_unittest
161
162
<pre>
163
cd EMAN2/test/rt
164
./rt.py
165
</pre>
166
167
h2. Install MyMPI for MPI functions
168
169
see http://sparx-em.org/sparxwiki/MPI-installation
170
or https://www.nbcr.net/pub/wiki/index.php?title=MyMPI_Setup
171
172
This fixes this problem:
173
<pre>
174
    from mpi import mpi_init
175
ImportError: No module named mpi
176
</pre>
177
178
This module was very difficult to get working, it seems to be a poorly supported python wrapper for MPI. So, what we are going to do is compile the module, rename it, and create a wrapper. So, essentially we are creating a wrapper around the wrapper. We can only hope they switch to [http://mpi4py.scipy.org/ mpi4py] in the future.
179 34 Neil Voss
180 9 Neil Voss
h2. Documentation
181 3 Neil Voss
182 1 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/Install
183 2 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/FAQ/eman2BuildFAQ
184 31 Neil Voss
185 2 Neil Voss
______
186
187
[[Install EMAN|< Install EMAN 1]] | [[Install SPIDER|Install SPIDER >]]
188 1 Neil Voss
189
______