User Tools

Site Tools


eman2:install:sourceinstall

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eman2:install:sourceinstall [2026/03/04 13:49] steveludtkeeman2:install:sourceinstall [2026/03/07 00:23] (current) steveludtke
Line 38: Line 38:
  
     * Install:     * Install:
- <code>#!highlight bash+ <code bash>
 bash <MiniForge-installer> bash <MiniForge-installer>
 </code> </code>
Line 83: Line 83:
  
  <code bash>  <code bash>
-mamba create -n eman2 eman-dev --only-deps -c cryoem -c conda-forge+conda create -n eman2 eman-dev --only-deps -c conda-forge -c cryoem
 </code> </code>
  
  If, and ONLY if, you are installing on a headless machine without graphics, you can alternatively set up the **non-GUI** variant which will not have pyqt and pyopengl. Doing this will severely limit EMAN2's capabilities:  If, and ONLY if, you are installing on a headless machine without graphics, you can alternatively set up the **non-GUI** variant which will not have pyqt and pyopengl. Doing this will severely limit EMAN2's capabilities:
  
- <code>#!highlight bash + <code bash> 
-mamba create -n eman2 'eman-dev=*=nogui_*' --only-deps -c cryoem -c conda-forge+conda create -n eman2 'eman-dev=*=nogui_*' --only-deps -c conda-forge -c cryoem
 </code> </code>
  
Line 96: Line 96:
  **List of dependencies: ** (Not required for normal installation)If you wish to see the list of conda dependencies that **eman-dev** is built from, look [[https://github.com/cryoem/eman-feedstock/blob/master/recipe/meta.yaml|here]]. Some of the dependency versions are listed in the appropriate file under [[https://github.com/cryoem/eman-feedstock/tree/master/.ci_support|.ci_support]].  **List of dependencies: ** (Not required for normal installation)If you wish to see the list of conda dependencies that **eman-dev** is built from, look [[https://github.com/cryoem/eman-feedstock/blob/master/recipe/meta.yaml|here]]. Some of the dependency versions are listed in the appropriate file under [[https://github.com/cryoem/eman-feedstock/tree/master/.ci_support|.ci_support]].
  
- 6. Ensure you have **OpenGL**:+ 6. **GPU Acceleration** EMAN2 increasingly leverages GPU acceleration on compatible machines, and moving forward we have moved from tensorflow to JAX. EMAN2 still includes some tensorflow code, and tensorflow should already have been installed as part of the configuration above. Given its rapid state of development we suggest installing JAX using pip instead: 
 + 
 + Linux + NVidia GPU: 
 + <code bash> 
 +conda activate eman2 
 +pip install "jax[cuda12]" optax 
 +</code> 
 + 
 + Mac or other non-Nvidia: 
 + <code bash> 
 +conda activate eman2> 
 +pip install jax optax 
 +</code> 
 + 
 + 7. Ensure you have **OpenGL**:
   EMAN2 uses OpenGL (via !PyQt) for all of its graphics. OpenGL installation depends on OS variant and, for example, whether you are using proprietary NVidia drivers under Linux. You will need to have OpenGL set up on your machine as a whole before continuing. On Mac, you should already have this with XCode. On Linux with an NVidia driver you will likely also need to install the Mesa header files. If you aren't sure how to set up OpenGL, Google can probably help.   EMAN2 uses OpenGL (via !PyQt) for all of its graphics. OpenGL installation depends on OS variant and, for example, whether you are using proprietary NVidia drivers under Linux. You will need to have OpenGL set up on your machine as a whole before continuing. On Mac, you should already have this with XCode. On Linux with an NVidia driver you will likely also need to install the Mesa header files. If you aren't sure how to set up OpenGL, Google can probably help.
  
- 7. **Get EMAN code** from [[https://github.com/cryoem/eman2|GitHub:cryoem/eman2]].+ 8. **Get EMAN code** from [[https://github.com/cryoem/eman2|GitHub:cryoem/eman2]].
  <code bash>  <code bash>
 cd <path-where-you-want-eman2-source>   # eg - $HOME/src cd <path-where-you-want-eman2-source>   # eg - $HOME/src
Line 105: Line 119:
 </code> </code>
  
- 8. **Create a build directory** (out-of-source builds are recommended).+ 9. **Create a build directory** (out-of-source builds are recommended).
  <code bash>  <code bash>
 mkdir <build-directory> # eg- $HOME/src/eman2-build mkdir <build-directory> # eg- $HOME/src/eman2-build
 </code> </code>
- 9. **GPU/deep learning** Install JAX per the next section for GPU support. JAX is required for virtually all of the new EMAN3 programs  + 10. **GPU/deep learning** Install JAX per the next section for GPU support. JAX is required for virtually all of the new EMAN3 programs 
- +
-===== GPU Aceleration & Deep Learning ===== +
-Older EMAN2 programs make use of Tensorflow for Deep Learning/GPU support, but we have been gradually migrating to the new JAX library, so having both installed is strongly suggested. +
- +
-  * Tensorflow +
-    * Should be installed automatically as part of the EMAN2 environment setup above +
-    * You can check to see what version of Tensorflow and whether it is GPU accelerated with: "conda list|grep tensorflow". On a machine with an NVIDIA GPU and properly configured drivers, you should see a tensorflow version like "2.17.0    cuda120py312h02ad488_203". This says that you are using the CUDA 12.0, Python 3.12 version of tensorflow 2.17.0. If you see "cpu" instead of "cuda" then you do not have GPU acceleration, and you will need to sort that out. +
- +
-  * JAX +
-    * While it is possible to install JAX using conda/mamba, it can be difficult to find a version of GPU JAX and a version of GPU Tensorflow which will install properly together this way. +
-    * Instead, we strongly suggest just installing JAX using pip: +
-      * conda activate eman2 +
-      * Linux (NVIDIA): pip install "jax[cuda12]" optax      +
-      * Other (cpu): pip install jax optax +
-    * see [[https://pypi.org/project/jax/]] for up to date JAX instructions, this may change more frequently than this page is updated+
  
 ===== Build and Install: Daily development, Update code, etc. ===== ===== Build and Install: Daily development, Update code, etc. =====
Line 195: Line 194:
 Solutions to potential known problems will be listed here. If these don't help, please report your problem (http://groups.google.com/group/eman2): Solutions to potential known problems will be listed here. If these don't help, please report your problem (http://groups.google.com/group/eman2):
  
 +  * **Linux**
 +    * On recent linux installs (2025+) when running a tensorflow program you may encounter an error like **ImportError: libtensorflow_cc.so.2: cannot enable executable stack as shared object requires: Invalid argument**. This is a problem with the way conda-forge is compiling tensorflow conflicting with Linux security settings, and has nothing directly to do with EMAN2. It is easy to fix, but the specific method depends on your linux variant. I suggest pasting the exact error you're getting into one of the LLMs (ChatGPT, etc.) and get it to advise you.
 +    * This command may help in some situations: //patchelf --clear-execstack $CONDA_PREFIX/lib/libtensorflow_cc.so.2//
   *  **macOS** Users (bash only)   *  **macOS** Users (bash only)
     * On macOS, installation modifies //~/.bash_profile//. If you have a //~/.profile// startup file, creation of //~/.bash_profile// will prevent //~/.profile// from being read. A simple solution is to //source .profile// within //.bash_profile//.     * On macOS, installation modifies //~/.bash_profile//. If you have a //~/.profile// startup file, creation of //~/.bash_profile// will prevent //~/.profile// from being read. A simple solution is to //source .profile// within //.bash_profile//.
eman2/install/sourceinstall.1772632173.txt.gz · Last modified: by steveludtke