Installing EMAN2.2 on OSX from source with Anaconda

These instructions have been verified to work for several different people on several recent versions of OSX. Strongly encourage using this approach since it is compatible with the new binary approach.

This approach uses a Python distribution called Anaconda for all of the messy dependencies EMAN2 requires, including the Python interpreter itself. In addition, this means that if you want to use EMAN2 from Python with other Python libraries, you have a rich Anaconda environment where you can install any additional packages you like. Anaconda is cross-platform and we have found it to be a MUCH better choice than Mac-specific package managers like MacPorts.

PLEASE report any problems or update the page!

  1. Completely remove any previous eman2 source folders, and check out a fresh copy of the source from GitHub:

    mkdir src
    cd src
    git clone https://github.com/cryoem/eman2.git

    Note: on the Mac it is important that you not clone eman2 directly into your home directory, since Mac filenames are normally not case-sensitive. EMAN2 is normally installed in $HOME/EMAN2. If you clone from GitHub into your home folder then $HOME/eman2 will also become the installation folder, and things will be hopelessly confused!

  2. Install current Python2.x Anaconda from https://www.continuum.io/downloads (remember EMAN is Python2 not Python3).

    • Download the command-line installer, not the graphical installer, since this gives you a choice of where to put the installed folder.
    • Install Anaconda to $HOME/anaconda2
    • If you use a different location, you will need to update that in all of the subsequent instructions.
  3. XCode is required!
    • If you can successfully run g++ --version from the command line, you should be all set and can skip to the next step.

    • XCode is free and available from the App Store. It includes the command-line C++ compiler for the Mac.
    • The first time you ever try and use the C++ compiler from the command-line it will complain if you have not run the XCode GUI, since it requires a click-through user agreement.
    • You may need to download additional tools from within XCode to get the command-line compiler working. See: http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

  4. configure account to use this anaconda. I have a "useconda2" alias which does this (I just reset the entire PATH to avoid building up redundancies):
    useconda2='export PYTHONPATH=$HOME/EMAN2/lib:$HOME/EMAN2/bin; export EMAN2DIR=$HOME/EMAN2; export PATH=.:$HOME/anaconda2/bin:$HOME/EMAN2/bin:$HOME/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Developer/usr/bin:/Applications/Chimera.app/Contents/MacOS'
  5. Install other necessary Anaconda modules. This includes specific versions for a few. I don't recall how many of these were already installed and how many I had to do. Note that some need a specific version, eg:
    conda install qt=4 pyqt=4
    and a couple are from other channels, eg:
    conda install -c conda-forge boost boost-cpp fftw
    conda install -c cryoem ftgl
    The rest:
    conda install bsddb freetype gsl hdf5 ipython jpeg libpng libtiff matplotlib numpy=1.11 pyopengl=3.0 scikit-learn scipy theano tk cmake openmpi
  6. Once all of this is done you're ready to start building:
    cd (wherever you checked out the eman2 source)
    ccmake .
    c
    • You can probably ignore any warnings you see at this point.
    • CMake should find everything automatically, as long as you put a directory called anaconda2 in your home directory or in $HOME/EMAN2.
    • If you put anaconda somewhere else, you will need to manually configure a bunch of locations. See troubleshooting below for tips.
    • Once the options are set as you like them. Press g to generate all of the makefiles

    • Again, ignore warnings for now, then from the command line: make -j4 (you can replace 4 with the number of cores on your machine)

    • If everything works, do a make install and you're done

    • If you get errors in compilation, you may want to run make again without the -j4 to more easily see the error messages. If you get errors you can't figure out, report them to the mailing list for help.

Once this was done (it really didn't take very long to do), everything works for me, including the GUI. While I haven't tested absolutely everything, I did go through a lot of the tutorial and everything seemed fine.

Troubleshooting

Here is the list of anaconda packages (installed above) with versions known to work in Feb, 2017. If you are having problems, you can do a conda list and check for these:

boost                     1.63.0                   py27_4    conda-forge
boost-cpp                 1.63.0                        1    conda-forge
fftw                      3.3.5                         0    conda-forge
bsddb                     1.0                      py27_1  
cmake                     3.6.3                         0  
freetype                  2.5.5                         2  
ftgl                      2.1.3                         2    jmbell
gsl                       2.2.1                         0  
hdf5                      1.8.17                        1  
ipython                   5.1.0                    py27_0  
ipython_genutils          0.1.0                    py27_0  
jpeg                      9b                            0  
libpng                    1.6.27                        0  
libtiff                   4.0.6                         3  
matplotlib                1.5.3               np111py27_0  
numpy                     1.11.1                   py27_0  
pyopengl                  3.0.2                    py27_0  
pyqt                      4.11.4                   py27_4  
qt                        4.8.7                         4  
scikit-learn              0.17.1              np111py27_2  
scipy                     0.18.1              np111py27_0  
theano                    0.8.2                    py27_0  
tk                        8.5.18                        0  

If you are having ccmake configuration issues, here is the list of the relevant options from my configuration. Clearly you will need to adjust these for your own account name:

EMAN_INSTALL_PREFIX:PATH=/Users/stevel/EMAN2
ENABLE_DEBUG:BOOL=OFF
ENABLE_DJBFFT:BOOL=OFF
ENABLE_EMAN_CUDA:BOOL=OFF
ENABLE_FFTW2:BOOL=OFF
ENABLE_FFTW3:BOOL=ON
ENABLE_FFTW_PLAN_CACHING:BOOL=ON
ENABLE_FFT_CACHING:BOOL=OFF
ENABLE_FTGL:BOOL=ON
ENABLE_HDF5:BOOL=ON
ENABLE_IOCACHE:BOOL=OFF
ENABLE_JPEG:BOOL=ON
ENABLE_MEMDEBUG:BOOL=OFF
ENABLE_MEMDEBUG2:BOOL=OFF
ENABLE_NATIVE_FFT:BOOL=OFF
ENABLE_NFFT2:BOOL=OFF
ENABLE_OPENGL:BOOL=ON
ENABLE_OPTIMIZE_MACHINE:BOOL=OFF
ENABLE_OPTIMIZE_MOUNTAIN_LION:BOOL=ON
ENABLE_OPTIMIZE_PHI:BOOL=OFF
ENABLE_OPTIMIZE_WINDOWS_VC:BOOL=OFF
ENABLE_OPTIMIZE_X86_64:BOOL=OFF
ENABLE_OPTPP:BOOL=OFF
ENABLE_PNG:BOOL=ON
ENABLE_PROFILE:BOOL=OFF
ENABLE_RT:BOOL=ON
ENABLE_SPARX_CUDA:BOOL=OFF
ENABLE_STATIC_FTGL:BOOL=OFF
ENABLE_TAO:BOOL=OFF
ENABLE_TIFF:BOOL=ON
BOOST_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
BOOST_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libboost_python.dylib
FFTW3_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
FFTW3_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libfftw3f.dylib
FFTW3d_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
FFTW3d_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libfftw3.dylib
FREETYPE_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include/freetype2
FREETYPE_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libfreetype.dylib
FTGL_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
FTGL_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libftgl.dylib
GSL_CBLAS_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
GSL_CBLAS_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libgslcblas.dylib
GSL_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
GSL_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libgsl.dylib
HDF5_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
HDF5_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libhdf5.dylib
JPEG_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
JPEG_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libjpeg.dylib
NUMPY_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/lib/python2.7/site-packages/numpy/core/include
PNG_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
PNG_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libpng.dylib
PYTHON_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include/python2.7
PYTHON_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libpython2.7.dylib
TIFF_INCLUDE_PATH:PATH=/Users/stevel/anaconda2/include
TIFF_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libtiff.dylib
ZLIB_LIBRARY:FILEPATH=/Users/stevel/anaconda2/lib/libz.dylib

EMAN2/COMPILE_EMAN2_MAC_OS_X (last edited 2017-03-16 18:58:44 by SteveLudtke)