Project

General

Profile

Install EMAN2 » History » Version 76

Neil Voss, 05/23/2016 02:21 PM

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 69 Neil Voss
This documentation assumes you are using CentOS 6 (written as of CentOS 6.5)
6
It is best to install EMAN2/SPARX from source to get MPI working on a cluster or 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 67 Neil Voss
sudo yum install fftw-devel gsl-devel boost-python numpy libjpeg-devel \
17 75 Neil Voss
 PyQt4-devel cmake ipython hdf5-devel libtiff-devel libpng-devel \
18
 PyOpenGL db4-devel python-argparse openmpi-devel python-pip
19 1 Neil Voss
</pre>
20 27 Neil Voss
21
22 76 Neil Voss
h3. FLTK
23
24
25
download
26
<pre>
27
wget 'http://fltk.org/pub/fltk/1.3.3/fltk-1.3.3-source.tar.gz'
28
</pre>
29
30
unzip
31
<pre>
32
tar zxvf fltk-1.3.3-source.tar.gz
33
</pre>
34
35
setup
36
<pre>
37
cd fltk-1.3.3
38
./configure
39
</pre>
40
41
compile
42
<pre>
43
make
44
</pre>
45
46
install
47
<pre>
48
sudo make install
49
</pre>
50
51
52 3 Neil Voss
h2. Download the source
53
54
# To download the source code go to the link:
55
#* http://blake.bcm.edu/emanwiki/EMAN2
56 56 Amber Herold
# Click on *"Main EMAN2 Download Page"*
57 66 Neil Voss
# Click on *"Download EMAN 2"*, whichever is the latest release of EMAN. 
58
# Scroll down to *Source* to download the *eman2.1beta3.source.tar.gz* 
59 3 Neil Voss
60
h2. Work with the source
61
62
# go to the directory with the source code
63
# extract the archive:
64
<pre>
65 71 Neil Voss
tar zxvf eman2.12.source.tar.gz
66 1 Neil Voss
</pre>
67 15 Neil Voss
# go into directory
68
<pre>cd EMAN2/src/build</pre>
69 19 Neil Voss
# start configure script:
70 1 Neil Voss
<pre>cmake ../eman2/</pre>
71 11 Neil Voss
#* Note: alternatively you can run @ccmake ../eman2/@ and configure all the parameters
72 75 Neil Voss
#* I had to disable ftgl (fonts in OpenGL) to get 2.12 to compile.
73 70 Neil Voss
<pre>
74
-- The C compiler identification is GNU 4.4.7
75
-- The CXX compiler identification is GNU 4.4.7
76
-- Check for working C compiler: /usr/bin/cc
77
-- Check for working C compiler: /usr/bin/cc -- works
78
-- Detecting C compiler ABI info
79
-- Detecting C compiler ABI info - done
80
-- Check for working CXX compiler: /usr/bin/c++
81
-- Check for working CXX compiler: /usr/bin/c++ -- works
82
-- Detecting CXX compiler ABI info
83
-- Detecting CXX compiler ABI info - done
84
-- Looking for fseek64
85
-- Looking for fseek64 - not found
86
-- Looking for fseeko
87
-- Looking for fseeko - found
88
-- Looking for ftell64
89
-- Looking for ftell64 - not found
90
-- Looking for ftello
91
-- Looking for ftello - found
92
-- Configuring done
93
-- Generating done
94
-- Build files have been written to: /emg/sw/EMAN2/src/build
95
</pre>
96 18 Neil Voss
# start compiling:
97
<pre>make</pre>
98 3 Neil Voss
# install to directory:
99 23 Neil Voss
<pre>sudo make install</pre>
100
101
h2. Set environmental variables
102
103
h3. bash
104
105
<pre>sudo nano /etc/profile.d/eman2.sh</pre>
106 24 Neil Voss
107
<pre>
108
export EMAN2DIR=/usr/local/EMAN2
109
export PATH=${EMAN2DIR}/bin:${PATH}
110 23 Neil Voss
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
111
export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin
112
</pre>
113 16 Neil Voss
114 51 Neil Voss
h3. c shell
115
116
<pre>sudo nano /etc/profile.d/eman2.csh</pre>
117
118
<pre>
119
setenv EMAN2DIR /usr/local/EMAN2
120
setenv PATH ${EMAN2DIR}/bin:${PATH}
121
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
122
setenv PYTHONPATH ${EMAN2DIR}/lib:${EMAN2DIR}/bin
123
</pre>
124
125
126 50 Neil Voss
h2. Install MyMPI
127 42 Neil Voss
128 63 Amber Herold
* First, add the openmpi module so that MyMPI can find it.
129
<pre>
130
module add openmpi-i386
131
-or-
132
module add openmpi-x86_64
133
</pre>
134
135 42 Neil Voss
* Download source: 
136 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*.
137
Click on *Download MPI Support*
138
Click on *pydusa-1.15es.tgz*
139 42 Neil Voss
* Extract:
140 61 Amber Herold
<pre>tar zxvf pydusa-1.15es.tgz</pre>
141 42 Neil Voss
* go into directory
142 61 Amber Herold
<pre>cd pydusa-1.15es</pre>
143 65 Amber Herold
&nbsp;
144 62 Amber Herold
If you are on a 64bit machine, you may have problems with the code finding the numpy headers:
145 65 Amber Herold
&nbsp;
146 34 Neil Voss
<pre>nano configure</pre>
147 65 Amber Herold
&nbsp;
148 54 Neil Voss
find the line:
149 1 Neil Voss
<pre>
150
elif test -d ${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include; then
151
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include"
152 54 Neil Voss
</pre>
153
and replace it with:
154 65 Amber Herold
&nbsp;
155 54 Neil Voss
<pre>
156 1 Neil Voss
elif test -d ${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include; then
157
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include"
158 46 Neil Voss
</pre>
159
* Configure:
160
<pre>
161
setenv MPIROOT /usr/lib64/openmpi
162
setenv MPIINC /usr/include/openmpi-x86_64
163
setenv MPILIB ${MPIROOT}/lib
164
setenv MPIBIN ${MPIROOT}/bin
165 1 Neil Voss
./configure
166
</pre>
167
<pre>
168
export MPIROOT=/usr/lib64/openmpi
169
export MPIINC=/usr/include/openmpi-x86_64
170
export MPILIB=${MPIROOT}/lib
171 47 Neil Voss
export MPIBIN=${MPIROOT}/bin
172 46 Neil Voss
./configure
173
</pre>
174 64 Amber Herold
Please ensure mpicc was found. If it is not found, a version of MPI will be installed that may cause errors. Look for the following error and correct this issue before moving on:
175
<pre>
176
configure: error: Unable to find mpicc! mpicc location can be specified with --with-mpicc
177
</pre>
178 65 Amber Herold
&nbsp;
179 46 Neil Voss
* compile the source:
180
<pre>make</pre>
181
* copy the mpi.so to site-packages with a different name:
182
<pre>
183 1 Neil Voss
sudo mkdir /usr/lib64/python2.6/site-packages/mympi/
184 52 Neil Voss
sudo touch /usr/lib64/python2.6/site-packages/mympi/__init__.py
185 1 Neil Voss
sudo cp -v src/mpi.so /usr/lib64/python2.6/site-packages/mympi/mpi.so
186
</pre>
187 47 Neil Voss
* create a wrapper around the wrapper:
188 1 Neil Voss
<pre>sudo nano /usr/lib64/python2.6/site-packages/mpi.py</pre>
189
<pre>
190
import ctypes
191
mpi = ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL)
192
from mympi.mpi import *
193
</pre>
194 50 Neil Voss
This needs to be done to avoid the error:
195
<pre>
196
python: symbol lookup error: 
197
  /usr/lib64/openmpi/lib/openmpi/mca_paffinity_hwloc.so: 
198
    undefined symbol: mca_base_param_reg_int
199
</pre>
200 1 Neil Voss
201
* test 1: 
202
<pre>
203
python -c 'import mpi'
204
python -c 'import sys; from mpi import mpi_init; mpi_init(len(sys.argv), sys.argv)'
205
</pre>
206
207 50 Neil Voss
* test 2: 
208
<pre>sxisac.py start.hdf</pre>
209
(Note: start.hdf does not need to exist, if it does not exist then it should exit with file not found)
210 42 Neil Voss
211 50 Neil Voss
h2. Test to see if code works
212
213
see http://blake.bcm.edu/emanwiki/EMAN2/FAQ/EMAN2_unittest
214
215
<pre>
216
cd EMAN2/test/rt
217
./rt.py
218
</pre>
219
220
h2. Install MyMPI for MPI functions
221
222
see http://sparx-em.org/sparxwiki/MPI-installation
223
or https://www.nbcr.net/pub/wiki/index.php?title=MyMPI_Setup
224
225
This fixes this problem:
226
<pre>
227
    from mpi import mpi_init
228
ImportError: No module named mpi
229
</pre>
230
231
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.
232 34 Neil Voss
233 9 Neil Voss
h2. Documentation
234 3 Neil Voss
235 1 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/Install
236 2 Neil Voss
* http://blake.bcm.edu/emanwiki/EMAN2/FAQ/eman2BuildFAQ
237 31 Neil Voss
238 2 Neil Voss
______
239
240
[[Install EMAN|< Install EMAN 1]] | [[Install SPIDER|Install SPIDER >]]
241 1 Neil Voss
242
______