Install EMAN2 » History » Version 53
Amber Herold, 03/13/2013 10:20 AM
1 | 1 | Neil Voss | h1. Install EMAN2/SPARX |
---|---|---|---|
2 | |||
3 | 53 | Amber Herold | *Before you begin:* |
4 | 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. The development trunk and future releases will require this software. |
||
5 | This documentation assumes you are using CentOS 6 (written as of CentOS 6.2) |
||
6 | 2 | Neil Voss | It is best to install EMAN2/SPARX from source, so that do not have 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 | h2. Install require pre-packages for EMAN2 compiling |
||
10 | |||
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 | 17 | Neil Voss | # Click on *"Current stable version - direct link"* |
33 | 3 | Neil Voss | # Go under the heading "Source" at bottom of page |
34 | # Click to download the *eman-source-2.xx.tar.gz* file (as of August 2012, 2.xx is 2.06) |
||
35 | |||
36 | h2. Work with the source |
||
37 | |||
38 | # go to the directory with the source code |
||
39 | # extract the archive: |
||
40 | <pre> |
||
41 | 4 | Neil Voss | tar zxvf eman-source-2.06.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 | * Download source: |
||
81 | 45 | Neil Voss | <pre>wget -O pydusa-1.15-sparx.tgz \ |
82 | 'http://sparx-em.org/sparxwiki/MPI-installation?action=AttachFile&do=get&target=pydusa-1.15-sparx.tgz'</pre> |
||
83 | 42 | Neil Voss | * Extract: |
84 | <pre>tar zxvf pydusa-1.15-sparx.tgz</pre> |
||
85 | * go into directory |
||
86 | <pre>cd pydusa-1.15-sparx</pre> |
||
87 | 34 | Neil Voss | <pre>nano configure</pre> |
88 | 1 | Neil Voss | <pre> |
89 | elif test -d ${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include; then |
||
90 | PY_HEADER_NUMPY="-I${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include" |
||
91 | </pre><pre> |
||
92 | elif test -d ${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include; then |
||
93 | PY_HEADER_NUMPY="-I${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include" |
||
94 | 46 | Neil Voss | </pre> |
95 | * Configure: |
||
96 | <pre> |
||
97 | setenv MPIROOT /usr/lib64/openmpi |
||
98 | setenv MPIINC /usr/include/openmpi-x86_64 |
||
99 | setenv MPILIB ${MPIROOT}/lib |
||
100 | setenv MPIBIN ${MPIROOT}/bin |
||
101 | 1 | Neil Voss | ./configure |
102 | </pre> |
||
103 | <pre> |
||
104 | export MPIROOT=/usr/lib64/openmpi |
||
105 | export MPIINC=/usr/include/openmpi-x86_64 |
||
106 | export MPILIB=${MPIROOT}/lib |
||
107 | 47 | Neil Voss | export MPIBIN=${MPIROOT}/bin |
108 | 46 | Neil Voss | ./configure |
109 | </pre> |
||
110 | * compile the source: |
||
111 | <pre>make</pre> |
||
112 | * copy the mpi.so to site-packages with a different name: |
||
113 | <pre> |
||
114 | 1 | Neil Voss | sudo mkdir /usr/lib64/python2.6/site-packages/mympi/ |
115 | 52 | Neil Voss | sudo touch /usr/lib64/python2.6/site-packages/mympi/__init__.py |
116 | 1 | Neil Voss | sudo cp -v src/mpi.so /usr/lib64/python2.6/site-packages/mympi/mpi.so |
117 | </pre> |
||
118 | 47 | Neil Voss | * create a wrapper around the wrapper: |
119 | 1 | Neil Voss | <pre>sudo nano /usr/lib64/python2.6/site-packages/mpi.py</pre> |
120 | <pre> |
||
121 | import ctypes |
||
122 | mpi = ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL) |
||
123 | from mympi.mpi import * |
||
124 | </pre> |
||
125 | 50 | Neil Voss | This needs to be done to avoid the error: |
126 | <pre> |
||
127 | python: symbol lookup error: |
||
128 | /usr/lib64/openmpi/lib/openmpi/mca_paffinity_hwloc.so: |
||
129 | undefined symbol: mca_base_param_reg_int |
||
130 | </pre> |
||
131 | 1 | Neil Voss | |
132 | * test 1: |
||
133 | <pre> |
||
134 | python -c 'import mpi' |
||
135 | python -c 'import sys; from mpi import mpi_init; mpi_init(len(sys.argv), sys.argv)' |
||
136 | </pre> |
||
137 | |||
138 | 50 | Neil Voss | * test 2: |
139 | <pre>sxisac.py start.hdf</pre> |
||
140 | (Note: start.hdf does not need to exist, if it does not exist then it should exit with file not found) |
||
141 | 42 | Neil Voss | |
142 | 50 | Neil Voss | h2. Test to see if code works |
143 | |||
144 | see http://blake.bcm.edu/emanwiki/EMAN2/FAQ/EMAN2_unittest |
||
145 | |||
146 | <pre> |
||
147 | cd EMAN2/test/rt |
||
148 | ./rt.py |
||
149 | </pre> |
||
150 | |||
151 | h2. Install MyMPI for MPI functions |
||
152 | |||
153 | see http://sparx-em.org/sparxwiki/MPI-installation |
||
154 | or https://www.nbcr.net/pub/wiki/index.php?title=MyMPI_Setup |
||
155 | |||
156 | This fixes this problem: |
||
157 | <pre> |
||
158 | from mpi import mpi_init |
||
159 | ImportError: No module named mpi |
||
160 | </pre> |
||
161 | |||
162 | 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. |
||
163 | 34 | Neil Voss | |
164 | 9 | Neil Voss | h2. Documentation |
165 | 3 | Neil Voss | |
166 | 1 | Neil Voss | * http://blake.bcm.edu/emanwiki/EMAN2/Install |
167 | 2 | Neil Voss | * http://blake.bcm.edu/emanwiki/EMAN2/FAQ/eman2BuildFAQ |
168 | 31 | Neil Voss | |
169 | 2 | Neil Voss | ______ |
170 | |||
171 | [[Install EMAN|< Install EMAN 1]] | [[Install SPIDER|Install SPIDER >]] |
||
172 | 1 | Neil Voss | |
173 | ______ |