Note that the instructions on this page should only be followed if you specifically need to install this version of EMAN2. Current releases use a completely different scheme.
Official releases are in reverse chronological order. The Continuous Build is rebuilt any time a developer makes a change they think users should have access to. It is normally reasonably stable, and will contain the latest pre-publication features. Alternatively, the highest numbered version will contain a stable and tested release. Windows10 users please see the instructions below before downloading.
Note: The neural network code in EMAN2 works best on GPUs, which are available only on the Linux installations. It can still run on Mac, but will be quite slow.
1. If you have previously installed EMAN2:
2. Download eman2.X.MacOS.sh/eman2.X.linux64.sh. 3. Run:
bash <path-to-EMAN2-installer>
# added by EMAN2 2.31 installer # >>> conda init >>> # !! Contents within this block are managed by 'conda init' !! ... ... ... unset __conda_setup # <<< conda init <<<
If you have any other similar looking blocks before the last one, it might be a good idea to remove them to avoid any potential conflicts.
source ~/.profile
to ~/.bash_profile.
4. Linux users: The new neural network based routines are much faster running on a GPU. If you have an NVidia graphics card, see Using the GPU section below. 5. Run these programs to see if the install worked:
e2version.py e2speedtest.py e2display.py e2proc2d.py :64:64:1 test.hdf --process mask.sharp:outer_radius=24 e2display.py test.hdf
6. If you have problems with any of these programs
7. You will find that when you open a new shell, you will see (base) added to your command prompt. This indicates that Anaconda, the environment EMAN2 now uses for distribution, is active, and you can run EMAN2/SPARX/SPHIRE commands.
conda deactivate
and EMAN2 commands will no longer work (but any software that doesn't like Anaconda will work).
conda config --set auto_activate_base False
, which will prevent Anaconda from being activated automatically when you open new shells. In that case you will need to do a
conda activate
before running EMAN2/SPARX/SPHIRE commands.
MacOS Big Sur Users The new Big Sur MacOS release (fall 2020) broke some things in Python, which are only now (Dec 2020) getting fixed. These fixes have not yet made their way into Anaconda. If you experience an error similar to “Unable to load OpenGL library”, this quick fix works when building from source and may also work for binary installs:
You need to go into your miniconda3 or anaconda3 folder and find this file (the path may be slightly different on your install, but you should be able to find it):
~/anaconda3/envs/eman2/lib/python3.7/site-packages/OpenGL/platform/ctypesloader.py
Around line 80 you should find a line like:
fullName = util.find_library( name )
change this line to:
fullName = '/System/Library/Frameworks/' + name + '.framework/' + name
(important to use 8 spaces before fullName, not a <tab>)
conda install -n base conda-build=3.17.8 -c defaults
Most Linux clusters will have at least one OpenMPI installation on the cluster. In some cases there may be more than one, and you may have to select a “module” to get the correct one. It is also critical that OpenMPI be compiled with the –disable-dlopen option. If you don't understand this statement, please consult with your cluster sysadmin.
8. Remove the OpenMPI we provided:
conda remove openmpi --force
9. Make sure that the correct OpenMPI for your cluster is in your path. You should be able to run 'mpicc' and get a message like 'gcc: no input files'.
10. Rebuild Pydusa using the system installed OpenMPI.
export GIT_PYDUSA_BRANCH=v20180515 conda build <path-to-EMAN2-directory>/recipes/pydusa --numpy 1.13 --no-test
Can't build /home/stevel/EMAN2/recipes/fftw-mpi due to environment creation error: Downloaded bytes did not match Content-Length url: http://www.fftw.org/fftw-3.3.6-pl1.tar.gz target_path: /home/stevel/EMAN2/conda-bld/src_cache/fftw-3.3.6.tar.gz Content-Length: 4179807 downloaded bytes: 208916
this means the fftw download failed. You will need to re-run this step, but first, delete the failed download :
rm EMAN2/conda-bld/src_cache/fftw-3.3.6.tar.gz
configure: error: could not find mpi library for --enable-mpi
this means the fftw build failed. On our system, this happened due to a libuuid library mismatch in combination with the omnipath cluster architecture.
To workaround this situation try:
cd <path-to-EMAN2-directory>/lib rm libuuid.so.1 ln -s /lib64/libuuid.so.1.3.0 libuuid.so.1 (Try 'ldconfig -p | grep libuuid' to find the correct libuuid location and version) cd -
Run this step again and revert this change after the whole installation process is complete.
cd <path-to-EMAN2-directory>/lib rm libuuid.so.1 ln -s libuuid.so.1.0.0 libuuid.so.1 cd -
11. Finally, install the compiled Pydusa:
conda install fftw-mpi --force-reinstall --override-channels -c file://<path-to-EMAN2-directory>/conda-bld -c defaults conda install 'pydusa=1.15=np113*' --force-reinstall --override-channels -c file://<path-to-EMAN2-directory>/conda-bld -c defaults
This option insures that –disable-dlopen is used when compiling OpenMPI, but may lack some system-specific optimizations provided by your sysadmin.
12. Remove the OpenMPI we provided:
conda remove openmpi --force
13. Rebuild OpenMPI. It is important to have the hwloc library available on the system. It might be available with 'module load hwloc'. It is also important to have the libraries of the used queuing system available (slurm, Torque/PBS, SGE, …).
conda build <path-to-EMAN2-directory>/recipes/openmpi -c defaults -c conda-forge -c conda-forge/label/cf201901 conda install openmpi --override-channels -c file://<path-to-EMAN2-directory>/conda-bld -c defaults
14. Rebuild Pydusa using the rebuilt OpenMPI:
export GIT_PYDUSA_BRANCH=v20180515 conda build <path-to-EMAN2-directory>/recipes/pydusa --numpy 1.13 --no-test
Can't build /home/stevel/EMAN2/recipes/fftw-mpi due to environment creation error: Downloaded bytes did not match Content-Length url: http://www.fftw.org/fftw-3.3.6-pl1.tar.gz target_path: /home/stevel/EMAN2/conda-bld/src_cache/fftw-3.3.6.tar.gz Content-Length: 4179807 downloaded bytes: 208916
this means the fftw download failed. You will need to re-run this step, but first, delete the failed download :
rm EMAN2/conda-bld/src_cache/fftw-3.3.6.tar.gz
configure: error: could not find mpi library for --enable-mpi
this means the fftw build failed. On our system, this happened due to a libuuid library mismatch in combination with the omnipath cluster architecture. To workaround this situation try:
cd <path-to-EMAN2-directory>/lib rm libuuid.so.1 ln -s /lib64/libuuid.so.1.3.0 libuuid.so.1 (Try 'ldconfig -p | grep libuuid' to find the correct libuuid location and version) cd -
Run this step again and revert this change after the whole installation process is complete.
cd <path-to-EMAN2-directory>/lib rm libuuid.so.1 ln -s libuuid.so.1.0.0 libuuid.so.1 cd -
15. Finally, install the compiled Pydusa:
conda install fftw-mpi --force-reinstall --override-channels -c file://<path-to-EMAN2-directory>/conda-bld -c defaults conda install 'pydusa=1.15=np113*' --force-reinstall --override-channels -c file://<path-to-EMAN2-directory>/conda-bld -c defaults
We are finally able to provide 64 bit Windows binaries for EMAN2, however, please see the Windows 10- Linux/Bash shell option below for what may be a better alternative. Notes:
16. Download eman2.X.win64.exe. 17. Launch the installer.
18. **Select Installation Type:** Just Me 19. **Choose Installation Location:** Select a location with NO space in path 20. **Advanced Installation Options:** Don't add EMAN2 to PATH environment variable.
21. Open Anaconda Prompt by clicking Windows Start Menu → Anaconda2 (64-bit) → Anaconda Prompt. 22. In most cases you will want to install: Python Launcher. 23. Run these programs to see if the install worked:
e2version.py e2speedtest.py e2display.py e2proc2d.py :64:64:1 test.hdf --process mask.sharp:outer_radius=24
Windows 10 includes an embedded Ubuntu Linux environment. It is possible to run the EMAN2 Linux binaries within this Win10 environment, but you will need to install some additional dependencies to do so. Also, you will effectively be running at a Linux command prompt, so you will have to become a bit familiar with Linux to do this, but it does avoid installing an additional operating system on your machine.
24. Enable “Windows Subsystem for Linux” and install Ubuntu or any other distribution that you are familiar with, https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/.
25. Install OpenGL.
sudo apt-get update sudo apt-get install libsm-dev libxrender-dev build-essential libgl1-mesa-dev mesa-utils mesa-common-dev libglu1-mesa libglu1-mesa-dev sudo apt-get autoremove
26. Install Xming X Server for Windows.
27. Set environment variables.
export DISPLAY=:0 glxinfo | grep OpenGL export KMP_AFFINITY=disabled # per https://github.com/Microsoft/BashOnWindows/issues/785#issuecomment-238079769
28. Download and install `eman2.X.linux64.sh`. 29. Start X Server before running eman2 programs. 30. Run these programs to see if the install worked:
e2version.py e2speedtest.py e2display.py e2proc2d.py :64:64:1 test.hdf --process mask.sharp:outer_radius=24
Currently, the GPU is only used for neural network operations in tomogram annotation and in particle picking. It provides a ~10 fold or more speed up in neural network training. The new GPU developments are currently based on TensorFlow. From about 2006-2012 EMAN2 had its own internal CUDA code, which could be compiled into the C++ library. This has been deprecated, and likely no longer works, though the code is still present. We are working on a new GPU support strategy moving forward.
Many machines will have CUDA installed already, and if CUDA is an appropriate version, this should work fine with the TensorFlow version shipped with EMAN2. However, if you are running newer versions of CUDA there may be problems. You can test compatibility quickly with:
# Make sure you have your environment set to run EMAN2 programs e2version.py # The above command should work and return your current version. If it does, then run: python -c "import tensorflow"
If this command does not return an error, then you should be able to run deep learning software within EMAN2. If it does raise an error, then you will need to debug the problem:
apt-get install nvidia-cuda-toolkit
conda remove tensorflow-gpu tensorflow-gpu-base pip install cython pip install tensorflow # read any messages carefully, if there are errors you may need other installations