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