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