Project

General

Profile

Actions

Install EMAN2 » History » Revision 57

« Previous | Revision 57/87 (diff) | Next »
Amber Herold, 11/22/2013 10:14 AM


Install EMAN2/SPARX

Before you begin:
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.
This documentation assumes you are using CentOS 6 (written as of CentOS 6.4)
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.

Install pre-requisite packages for EMAN2 compiling

yum based packages

  • Make sure EPEL is install, if not go here: Download additional Software (CentOS Specific)
  • Use yum to install devel libraries:
    sudo yum install fftw-devel gsl-devel boost-python numpy \
     PyQt4-devel cmake ipython hdf5-devel libtiff-devel libpng-devel \
     PyOpenGL ftgl-devel db4-devel python-argparse openmpi-devel
    

bsddb3

Additionally you need to install the python-bsddb3 library (not available via YUM). I just use the pypi easy_installer, yum will never know.

sudo easy_install bsddb3

Download the source

  1. To download the source code go to the link:
  2. Click on "Main EMAN2 Download Page"
  3. Click on "Download EMAN 2.0x", whichever is the latest minor release of 2.0.
  4. Click to download the eman-source-2.xx.tar.gz file (as of November 2013, 2.xx is 2.07)

Work with the source

  1. go to the directory with the source code
  2. extract the archive:
    tar zxvf eman-source-2.06.tar.gz
    
  3. go into directory
    cd EMAN2/src/build
  4. start configure script:
    cmake ../eman2/
    • Note: alternatively you can run ccmake ../eman2/ and configure all the parameters
  5. start compiling:
    make
  6. install to directory:
    sudo make install

Set environmental variables

bash

sudo nano /etc/profile.d/eman2.sh
export EMAN2DIR=/usr/local/EMAN2
export PATH=${EMAN2DIR}/bin:${PATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
export PYTHONPATH=${EMAN2DIR}/lib:${EMAN2DIR}/bin

c shell

sudo nano /etc/profile.d/eman2.csh
setenv EMAN2DIR /usr/local/EMAN2
setenv PATH ${EMAN2DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${EMAN2DIR}/lib
setenv PYTHONPATH ${EMAN2DIR}/lib:${EMAN2DIR}/bin

Install MyMPI

  • Download source:
    wget -O pydusa-1.15-sparx.tgz \
     'http://sparx-em.org/sparxwiki/MPI-installation?action=AttachFile&do=get&target=pydusa-1.15-sparx.tgz'
  • Extract:
    tar zxvf pydusa-1.15-sparx.tgz
  • go into directory
    cd pydusa-1.15-sparx

I had problems with the code finding the numpy headers:

nano configure

find the line:

elif test -d ${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include; then
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib/python$PY_VERSION/site-packages/numpy/core/include" 

and replace it with:

elif test -d ${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include; then
   PY_HEADER_NUMPY="-I${PY_PREFIX}/lib64/python$PY_VERSION/site-packages/numpy/core/include" 
* Configure:
setenv MPIROOT /usr/lib64/openmpi
setenv MPIINC /usr/include/openmpi-x86_64
setenv MPILIB ${MPIROOT}/lib
setenv MPIBIN ${MPIROOT}/bin
./configure

export MPIROOT=/usr/lib64/openmpi
export MPIINC=/usr/include/openmpi-x86_64
export MPILIB=${MPIROOT}/lib
export MPIBIN=${MPIROOT}/bin
./configure
* compile the source:
make
* copy the mpi.so to site-packages with a different name:
sudo mkdir /usr/lib64/python2.6/site-packages/mympi/
sudo touch /usr/lib64/python2.6/site-packages/mympi/__init__.py
sudo cp -v src/mpi.so /usr/lib64/python2.6/site-packages/mympi/mpi.so
* create a wrapper around the wrapper:
sudo nano /usr/lib64/python2.6/site-packages/mpi.py

import ctypes
mpi = ctypes.CDLL('libmpi.so.1', ctypes.RTLD_GLOBAL)
from mympi.mpi import *

This needs to be done to avoid the error:
python: symbol lookup error: 
  /usr/lib64/openmpi/lib/openmpi/mca_paffinity_hwloc.so: 
    undefined symbol: mca_base_param_reg_int
  • test 1:
    python -c 'import mpi'
    python -c 'import sys; from mpi import mpi_init; mpi_init(len(sys.argv), sys.argv)'
    
  • test 2:
    sxisac.py start.hdf

    (Note: start.hdf does not need to exist, if it does not exist then it should exit with file not found)

Test to see if code works

see http://blake.bcm.edu/emanwiki/EMAN2/FAQ/EMAN2_unittest

cd EMAN2/test/rt
./rt.py

Install MyMPI for MPI functions

see http://sparx-em.org/sparxwiki/MPI-installation
or https://www.nbcr.net/pub/wiki/index.php?title=MyMPI_Setup

This fixes this problem:

    from mpi import mpi_init
ImportError: No module named mpi

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.

Documentation


< Install EMAN 1 | Install SPIDER >


Updated by Amber Herold about 11 years ago · 57 revisions