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