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