Project

General

Profile

Install EMAN2 » History » Version 62

Amber Herold, 11/22/2013 11:32 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
* Download source: 
81 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*.
82
Click on *Download MPI Support*
83
Click on *pydusa-1.15es.tgz*
84 42 Neil Voss
* Extract:
85 61 Amber Herold
<pre>tar zxvf pydusa-1.15es.tgz</pre>
86 42 Neil Voss
* go into directory
87 61 Amber Herold
<pre>cd pydusa-1.15es</pre>
88 54 Neil Voss
89 62 Amber Herold
If you are on a 64bit machine, you may have problems with the code finding the numpy headers:
90 54 Neil Voss
91 34 Neil Voss
<pre>nano configure</pre>
92 54 Neil Voss
93
find the line:
94 1 Neil Voss
<pre>
95
elif test -d ${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include; then
96
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include"
97 54 Neil Voss
</pre>
98
and replace it with:
99
100
<pre>
101 1 Neil Voss
elif test -d ${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include; then
102
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include"
103 46 Neil Voss
</pre>
104
* Configure:
105
<pre>
106
setenv MPIROOT /usr/lib64/openmpi
107
setenv MPIINC /usr/include/openmpi-x86_64
108
setenv MPILIB ${MPIROOT}/lib
109
setenv MPIBIN ${MPIROOT}/bin
110 1 Neil Voss
./configure
111
</pre>
112
<pre>
113
export MPIROOT=/usr/lib64/openmpi
114
export MPIINC=/usr/include/openmpi-x86_64
115
export MPILIB=${MPIROOT}/lib
116 47 Neil Voss
export MPIBIN=${MPIROOT}/bin
117 46 Neil Voss
./configure
118
</pre>
119
* compile the source:
120
<pre>make</pre>
121
* copy the mpi.so to site-packages with a different name:
122
<pre>
123 1 Neil Voss
sudo mkdir /usr/lib64/python2.6/site-packages/mympi/
124 52 Neil Voss
sudo touch /usr/lib64/python2.6/site-packages/mympi/__init__.py
125 1 Neil Voss
sudo cp -v src/mpi.so /usr/lib64/python2.6/site-packages/mympi/mpi.so
126
</pre>
127 47 Neil Voss
* create a wrapper around the wrapper:
128 1 Neil Voss
<pre>sudo nano /usr/lib64/python2.6/site-packages/mpi.py</pre>
129
<pre>
130
import ctypes
131
mpi = ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL)
132
from mympi.mpi import *
133
</pre>
134 50 Neil Voss
This needs to be done to avoid the error:
135
<pre>
136
python: symbol lookup error: 
137
  /usr/lib64/openmpi/lib/openmpi/mca_paffinity_hwloc.so: 
138
    undefined symbol: mca_base_param_reg_int
139
</pre>
140 1 Neil Voss
141
* test 1: 
142
<pre>
143
python -c 'import mpi'
144
python -c 'import sys; from mpi import mpi_init; mpi_init(len(sys.argv), sys.argv)'
145
</pre>
146
147 50 Neil Voss
* test 2: 
148
<pre>sxisac.py start.hdf</pre>
149
(Note: start.hdf does not need to exist, if it does not exist then it should exit with file not found)
150 42 Neil Voss
151 50 Neil Voss
h2. Test to see if code works
152
153
see http://blake.bcm.edu/emanwiki/EMAN2/FAQ/EMAN2_unittest
154
155
<pre>
156
cd EMAN2/test/rt
157
./rt.py
158
</pre>
159
160
h2. Install MyMPI for MPI functions
161
162
see http://sparx-em.org/sparxwiki/MPI-installation
163
or https://www.nbcr.net/pub/wiki/index.php?title=MyMPI_Setup
164
165
This fixes this problem:
166
<pre>
167
    from mpi import mpi_init
168
ImportError: No module named mpi
169
</pre>
170
171
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.
172 34 Neil Voss
173 9 Neil Voss
h2. Documentation
174 3 Neil Voss
175 1 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/Install
176 2 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/FAQ/eman2BuildFAQ
177 31 Neil Voss
178 2 Neil Voss
______
179
180
[[Install EMAN|< Install EMAN 1]] | [[Install SPIDER|Install SPIDER >]]
181 1 Neil Voss
182
______