Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2019-07-11 05:14:58
Size: 6591
Editor: TunayDurmaz
Comment: general environment setup
Revision 7 as of 2019-07-12 04:41:39
Size: 4070
Editor: TunayDurmaz
Comment: Some improvements
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Line 4: Line 5:
 1. If you have an existing '''Miniconda2''' installation and want to make use of your cached packages, move your pkgs/ and envs/ folders out of your current installation to another location.{{{
mkdir -p <path-to-conda-cahe-directory>
 1. If you have an existing '''Miniconda2''' installation,
  a. '''Remove miniconda entries from PATH'''.
  a. If you
want to make use of your cached packages, move your '''pkgs/''' and '''envs/''' folders out of your current installation to another location.
  
{{{
  mkdir -p <path-to-conda-cahe-directory>
Line 7: Line 11:
Line 11: Line 16:
 1. Install '''Miniconda3'''.{{{  1. Install '''Miniconda3'''.
 
{{{
Line 13: Line 19:
}}} and follow the prompts.
 1. Specify package and environment directories.{{{
conda config --set pkgs_dirs <path-to-conda-cahe-directory>/pkgs
}}}
 
and follow the prompts.
 1. Specify package and environment directories. These are the directories where conda environments and extracted packages will live.
 
{{{
  conda config --set pkgs_dirs <path-to-conda-cahe-directory>/pkgs
Line 17: Line 25:
conda config --set envs_dirs <path-to-conda-cahe-directory>/envs
  
conda config --set envs_dirs <path-to-conda-cahe-directory>/envs
Line 21: Line 30:
  a. Do not update conda automatically.{{{   a. Do not update conda automatically. '''(Strongly recommended.)'''
  
{{{
Line 24: Line 34:
  a. If you don't want conda's base environment to be activated automatically.{{{   a. If you don't want conda's base environment to be activated automatically. '''(Optional)'''
  
{{{
Line 27: Line 38:
 1. Install '''conda 4.6.14'''.{{{  1. Install '''conda 4.6.14'''.
 
{{{
Line 30: Line 42:
 1. Initialize conda for shell interaction.{{{  1. Initialize conda for shell interaction.
 
{{{
Line 32: Line 45:
Line 36: Line 50:
== Use Conda Environments for Development ==
Line 38: Line 51:
Do not install anything into the base environment, do not use the base environment for development, use non-base environments.
 1. Create a new environment.{{{

==
Development Environments ==

D
o not install anything into the '''base''' environment, do not use the '''base''' environment for development, use '''non-base''' environments.

 1. Create a new environment.
 
{{{
Line 42: Line 60:
 OR choose a simpler name for the environment, '''eman-env''' or '''eman'''.{{{  OR choose a simpler name for the environment, '''eman-env''' or '''eman'''.
 
{{{
Line 45: Line 64:
 1. Activate the environment.{{{  1. Activate the environment.
 
{{{
Line 48: Line 68:
 OR{{{  OR
 
{{{
Line 51: Line 72:


== Setup Python 2 Environment With CMake 3.14 ==

[[https://github.com/cryoem/eman2/pull/407|PR: Upgrade CMake to 3.14]]

=== New Miniconda Installations ===

 1. Download and install [[https://repo.continuum.io/miniconda/|Miniconda]].
 1. Add the new installation to PATH.{{{
export PATH=<new miniconda path>/bin:$PATH
 1. Navigate to your source directory. Checkout a branch and pull updates from the remote.
 {{{
cd <source directory>
git checkout <branch>
git pull --rebase
Line 63: Line 78:
 1. Install eman-deps with cmake 3.14.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14
conda install eman-deps=14.2 cmake=3.14 conda=4.6.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
 1. Navigate to your build directory, build and install.
 {{{
cd <build directory>
cmake <eman2 source directory>
make
make install
Line 71: Line 88:
=== Existing Miniconda/Anaconda Installations === == Python 3 Transition Environments ==
Line 73: Line 90:
 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14

== Upgrade CMake to 3.14 ==
[[https://github.com/cryoem/eman2/pull/407|PR: Upgrade CMake to 3.14]]

 1. Create a new environment and activate it.
 {{{
conda create -n eman-deps-14.2 eman-deps=14.2 cmake=3.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
conda activate eman-deps-14.2
Line 77: Line 99:
 1. Create a new environment.{{{
conda create -n eman-deps-14.2 eman-deps=14.2 cmake=3.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
 1. To switch to another conda environment, first deactivate your current environment.
 {{{
conda deactivate
Line 80: Line 103:
 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{
conda activate eman-deps-14.2
or
source activate eman-deps-14.2

== Test Boost 1.64 ==
[[https://github.com/cryoem/eman2/pull/408|PR: Upgrade Boost to 1.64]]

 1. Create a new environment and activate it.
 {{{
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.64 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
conda activate eman-deps-14.3
Line 85: Line 112:
 1. To switch to another conda environment, first deactivate your current environment.{{{  1. To switch to another conda environment, first deactivate your current environment.
 
{{{
Line 87: Line 115:
or
source deactivate
Line 92: Line 118:

== Setup Python 2 Environment with Boost 1.64 ==

[[https://github.com/cryoem/eman2/pull/408|PR: Upgrade Boost to 1.64]]

=== New Miniconda Installations ===

 1. Download and install [[https://repo.continuum.io/miniconda/|Miniconda]].
 1. Add the new installation to PATH.{{{
export PATH=<new miniconda path>/bin:$PATH
}}}
 1. Install eman-deps with cmake 3.14.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14
conda install eman-deps=14.3 cmake=3.14 boost=1.64 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
}}}



=== Existing Miniconda/Anaconda Installations ===

 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14
}}}
 1. Create a new environment.{{{
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.64 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
}}}
 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{
conda activate eman-deps-14.3
or
source activate eman-deps-14.3
}}}
 1. To switch to another conda environment, first deactivate your current environment.{{{
conda deactivate
or
source deactivate
}}}




== Setup Python 2 Environment with Boost 1.66 ==
== Test Boost 1.66 ==
Line 138: Line 121:
=== New Miniconda Installations ===

 1. Download and install [[https://repo.continuum.io/miniconda/|Miniconda]].
 1. Add the new installation to PATH.{{{
export PATH=<new miniconda path>/bin:$PATH
 1. Create a new environment and activate it.
 {{{
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.66 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
conda activate eman-deps-14.3
Line 144: Line 126:
 1. Install eman-deps with cmake 3.14.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14
conda install eman-deps=14.3 cmake=3.14 boost=1.66 conda=4.6.14 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
 1. To switch to another conda environment, first deactivate your current environment.
 {{{
conda deactivate
Line 149: Line 130:



=== Existing Miniconda/Anaconda Installations ===

 1. Pin your conda, you need to do this only once. Skip this step, if you have already done it.{{{
conda config --set auto_update_conda False
conda install conda=4.6.14
}}}
 1. Create a new environment.{{{
conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.66 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
}}}
 1. Use the activation command printed at the end of the previous command's run to activate the new conda environment.{{{
conda activate eman-deps-14.3
or
source activate eman-deps-14.3
}}}
 1. To switch to another conda environment, first deactivate your current environment.{{{
conda deactivate
or
source deactivate
}}}



== Build ==
Checkout a branch and build as usual.
 1. Update eman2 source.{{{
cd <source directory>
git checkout <branch>
git pull --rebase
}}}
 1. Activate conda environment, if it is a conda environment.{{{
conda activate <env-name>
or
source activate <env-name>
}}} or edit PATH to have the miniconda installation as the first entry.
 1. Move into your build directory.{{{
cd <build directory>
}}}
 1. Build and install.{{{
cmake <eman2 source directory>
make
make install
}}}

Under Construction

Setup Development Environment with Conda

  1. If you have an existing Miniconda2 installation,

    1. Remove miniconda entries from PATH.

    2. If you want to make use of your cached packages, move your pkgs/ and envs/ folders out of your current installation to another location.

        mkdir -p <path-to-conda-cahe-directory>
      # mkdir -p ~/conda-global-cache
      
      mv <path-to-current-miniconda2-installation>/pkgs <path-to-conda-cahe-directory>
      mv <path-to-current-miniconda2-installation>/envs <path-to-conda-cahe-directory>
  2. Download Miniconda3 for Linux or MacOSX.

  3. Install Miniconda3.

    bash <Miniconda3-installer>
    • and follow the prompts.
  4. Specify package and environment directories. These are the directories where conda environments and extracted packages will live.
      conda config --set pkgs_dirs <path-to-conda-cahe-directory>/pkgs
    # conda config --set pkgs_dirs ~/conda-global-cache/pkgs
    
      conda config --set envs_dirs <path-to-conda-cahe-directory>/envs
    # conda config --set pkgs_dirs ~/conda-global-cache/envs
  5. Configure conda.
    1. Do not update conda automatically. (Strongly recommended.)

      conda config --set auto_update_conda False
    2. If you don't want conda's base environment to be activated automatically. (Optional)

      conda config --set auto_activate_base False
  6. Install conda 4.6.14.

    conda install conda=4.6.14 -c defaults
  7. Initialize conda for shell interaction.
    conda init bash
    
    # See command help for supported shells
    conda init --help

Development Environments

Do not install anything into the base environment, do not use the base environment for development, use non-base environments.

  1. Create a new environment.
    conda create -n eman-deps-14.1 eman-deps=14.1 -c cryoem -c defaults -c conda-forge

    OR choose a simpler name for the environment, eman-env or eman.

    conda create -n eman-env eman-deps=14.1 -c cryoem -c defaults -c conda-forge
  2. Activate the environment.
    conda activate eman-deps-14.1
    OR
    conda activate eman-env
  3. Navigate to your source directory. Checkout a branch and pull updates from the remote.
    cd <source directory>
    git checkout <branch>
    git pull --rebase
  4. Navigate to your build directory, build and install.
    cd <build directory>
    cmake <eman2 source directory>
    make
    make install

Python 3 Transition Environments

Upgrade CMake to 3.14

PR: Upgrade CMake to 3.14

  1. Create a new environment and activate it.
    conda create -n eman-deps-14.2 eman-deps=14.2 cmake=3.14 -c cryoem/label/dev -c cryoem -c defaults -c conda-forge
    conda activate eman-deps-14.2
  2. To switch to another conda environment, first deactivate your current environment.
    conda deactivate

Test Boost 1.64

PR: Upgrade Boost to 1.64

  1. Create a new environment and activate it.
    conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.64 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
    conda activate eman-deps-14.3
  2. To switch to another conda environment, first deactivate your current environment.
    conda deactivate

Test Boost 1.66

PR: Build with Boost versions 1.65-1.66

  1. Create a new environment and activate it.
    conda create -n eman-deps-14.2 eman-deps=14.3 cmake=3.14 boost=1.66 -c cryoem/label/boost -c cryoem -c defaults -c conda-forge
    conda activate eman-deps-14.3
  2. To switch to another conda environment, first deactivate your current environment.
    conda deactivate