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