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 [2025/06/30 02:38] – [ARM-64 Linux] steveludtkeeman2:install:sourceinstall [2026/04/08 16:05] (current) steveludtke
Line 9: Line 9:
   * We make use of the [[https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html|environment]] system in [[https://docs.conda.io/en/latest/|conda]] to separate EMAN2 dependencies from other conda or system packages you may have installed.    * We make use of the [[https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html|environment]] system in [[https://docs.conda.io/en/latest/|conda]] to separate EMAN2 dependencies from other conda or system packages you may have installed. 
     * If you need to install other packages you wish to use in concert with EMAN2, you will need to install them within the EMAN2 conda environment. Be warned that sometimes installing another package may trigger a version change in one of EMAN2's dependencies, which may or may not be a problem, depending on which dependency it is. We strongly suggest getting the base EMAN2 installed and working first, before trying to install any additional packages within the same conda environment. If you don't need to use EMAN2 and the other package in the same environment, we suggest making a separate environment for the other software.     * If you need to install other packages you wish to use in concert with EMAN2, you will need to install them within the EMAN2 conda environment. Be warned that sometimes installing another package may trigger a version change in one of EMAN2's dependencies, which may or may not be a problem, depending on which dependency it is. We strongly suggest getting the base EMAN2 installed and working first, before trying to install any additional packages within the same conda environment. If you don't need to use EMAN2 and the other package in the same environment, we suggest making a separate environment for the other software.
 +----
 +<note>If you are installing EMAN2 on a Windows 11 machine, you __must__ install and set up [[https://learn.microsoft.com/en-us/windows/wsl/install|WSL2]] first! EMAN2 is installed from the WSL2 terminal (Ubuntu on Windows) once WSL2 is set up. Setting up WSL2 is not part of these instructions and this same WSL2 can be used to install other Linux software on your Win 11 machine once set up. You will need to install the compilation tools under WSL2 as well.</note>
  
 ---- ----
Line 22: Line 24:
     * IF you have conda-forge, mini-forge or Anaconda already installed in your account, and wish to try setting up EMAN2 as a new environment skip ahead to //Configure and update conda//. This may or may not work, depending on the age of your previous Anaconda install.     * IF you have conda-forge, mini-forge or Anaconda already installed in your account, and wish to try setting up EMAN2 as a new environment skip ahead to //Configure and update conda//. This may or may not work, depending on the age of your previous Anaconda install.
     * Otherwise:     * Otherwise:
- <code>#!highlight bash+ <code bash>
 echo $PATH echo $PATH
 # make sure no Anaconda/Miniconda/old EMAN2 entries: # make sure no Anaconda/Miniconda/old EMAN2 entries:
Line 38: Line 40:
  
     * Install:     * Install:
- <code>#!highlight bash+ <code bash>
 bash <MiniForge-installer> bash <MiniForge-installer>
 </code> </code>
Line 47: Line 49:
  3. **Initialize conda for shell interaction.** These instructions will depend on what shell you use. The default on most systems is //bash//. If you use a different shell ( //tsch//, //zsh//, ... ), you will need to take that into account:  3. **Initialize conda for shell interaction.** These instructions will depend on what shell you use. The default on most systems is //bash//. If you use a different shell ( //tsch//, //zsh//, ... ), you will need to take that into account:
  
-## <code>#!highlight bash + <code bash
-## # for bash-like shells, such as bash and zsh +# for bash-like shells, such as bash and zsh 
-## source <MiniForge-path>/etc/profile.d/conda.sh +source <MiniForge-path>/etc/profile.d/conda.sh 
-##  + 
-## # for csh-like shells, such as csh and tcsh: +# for csh-like shells, such as csh and tcsh: 
-## source <MiniForge-path>/etc/profile.d/conda.csh +source <MiniForge-path>/etc/profile.d/conda.csh 
-##  + 
-## # <shell-name> is bash, fish, powershell, tcsh, xonsh or zsh +# <shell-name> is bash, fish, powershell, tcsh, xonsh or zsh 
-## conda init <shell-name> +conda init <shell-name> 
-## </code>+</code>
  
  **You will need to close and reopen your shell/terminal for the installation to take effect!**.   **You will need to close and reopen your shell/terminal for the installation to take effect!**. 
Line 63: Line 65:
  
  4. **Configure and update conda.**  4. **Configure and update conda.**
- <code>#!highlight bash+ <code bash>
 # We suggest the following, meaning you will need to use //conda activate// after logging in before using EMAN2 # We suggest the following, meaning you will need to use //conda activate// after logging in before using EMAN2
 conda config --set auto_activate_base False conda config --set auto_activate_base False
Line 82: Line 84:
  
  
- <code>#!highlight 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>
  
- **ARM-64 Linux** - At present this requires some special tricks. See section below.+ **ARM-64 Linux** (aarch64) - At present this requires some special tricks. See section below. 
  **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. **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:
  
- 6. Ensure you have **OpenGL**:+ 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>#!highlight bash+ <code bash>
 cd <path-where-you-want-eman2-source>   # eg - $HOME/src cd <path-where-you-want-eman2-source>   # eg - $HOME/src
 git clone https://github.com/cryoem/eman2.git # this will create an eman2 folder containing the current source code from the master branch git clone https://github.com/cryoem/eman2.git # this will create an eman2 folder containing the current source code from the master branch
 </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>#!highlight 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 131: Line 132:
  
  10. **Activate** your environment. If you used a different name above, use it here too.  10. **Activate** your environment. If you used a different name above, use it here too.
- <code>#!highlight bash+ <code bash>
 conda activate eman2 conda activate eman2
 </code> </code>
  
  11. **Update and Checkout source code**. Periodically you should update your source using standard git techniques.  11. **Update and Checkout source code**. Periodically you should update your source using standard git techniques.
- <code>#!highlight bash+ <code bash>
 cd <source-directory>    # <path-where-you-want-eman2-source>/eman2 cd <source-directory>    # <path-where-you-want-eman2-source>/eman2
 git fetch --all --prune  # get remote branches and cleanup non-existing remote branches from local repo git fetch --all --prune  # get remote branches and cleanup non-existing remote branches from local repo
Line 144: Line 145:
  
  12. **CMake**  12. **CMake**
- <code>#!highlight bash+ <code bash>
 cd <build-directory> cd <build-directory>
 # on Mac: # on Mac:
Line 177: Line 178:
  
  14. **Other Environments**. To switch to another conda environment (stop working with EMAN2), first deactivate your current environment.  14. **Other Environments**. To switch to another conda environment (stop working with EMAN2), first deactivate your current environment.
- <code>#!highlight bash+ <code bash>
 conda deactivate conda deactivate
 </code> </code>
Line 195: Line 196:
 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//.
Line 213: Line 217:
 Please, provide the output of the following commands when reporting a problem. Record the session via **script** command. This, also, records the commands, and you can just submit the full text file with your problem report. Please, provide the output of the following commands when reporting a problem. Record the session via **script** command. This, also, records the commands, and you can just submit the full text file with your problem report.
  
- 1. <code>#!highlight bash+ 1. <code bash>
 script filename.txt script filename.txt
  
eman2/install/sourceinstall.1751251094.txt.gz · Last modified: by steveludtke