Differences between revisions 1 and 24 (spanning 23 versions)
Revision 1 as of 2019-05-18 10:42:26
Size: 1368
Editor: TunayDurmaz
Comment: Initial setup and usage of python 3 environments
Revision 24 as of 2019-10-10 04:43:27
Size: 7632
Editor: TunayDurmaz
Comment: obsolete environment instructions
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Setup Python 3 Environment ==

=== Existing Miniconda/Anaconda Installations ===

 1. Create a new environment with python 3{{{
conda create -n eman-deps-15 eman-deps=15 -c cryoem/label/py3 -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-15
or
source activate eman-deps-15
}}}
 1. To switch to another conda environment, first deactivate your current environment{{{
== Python 3 Transition Environments ==


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

Install cmake=3.24 and eman-deps=15.1.
 {{{#!highlight bash
conda install eman-deps=15.1 cmake=3.14 -c cryoem -c defaults -c conda-forge
}}}

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

 {{{#!highlight bash
conda install eman-deps=16.1 cmake=3.14 boost=1.64 -c cryoem -c defaults -c conda-forge
}}}


=== Phase 3: Test Boost 1.66 ===
[[https://github.com/cryoem/eman2/pull/410|PR: Build with Boost versions 1.65-1.66]]

 {{{#!highlight bash
conda install eman-deps=16.1 cmake=3.14 boost=1.66 -c cryoem -c defaults -c conda-forge
}}}


== Python 3 Environments (Coming Soon!) ==

Coming soon!

---------

The following sections were written with conda environments in mind, but will not be used. Keeping here for future reference.

---------

== Setup Development Environment with Conda ==
{{{#!wiki comment
'''TODO'''
 1. For difference between login- and non-login shells on Mac OSX, https://www.anintegratedworld.com/basics-of-osx-bashrc-v-profile-v-bash_profile/
 1. Review how to install new vs existing installations. How do you use conda-init, if conda is not on PATH?
  a. The installer seems to take care of it, if it is not used in batch mode.
  a. How do we handle it manually, if the installation was done in batch mode.
 1. Activation, conda init ... https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment
}}}

 1. If you have an existing '''Miniconda2/Anaconda2''' installation,
  a. '''Remove miniconda/anaconda 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.
  {{{#!highlight bash
  mkdir -p <path-to-conda-cache-directory>
# mkdir -p ~/conda-global-cache

mv <path-to-current-miniconda2-installation>/pkgs <path-to-conda-cache-directory>
mv <path-to-current-miniconda2-installation>/envs <path-to-conda-cache-directory>
}}}
 1. Download '''Miniconda3''' for [[https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh|Linux]] or [[https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh|MacOSX]].
 1. Install '''Miniconda3'''.
 {{{#!highlight bash
bash <Miniconda3-installer>
}}}
 and follow the prompts.
 1. Specify package and environment directories outside of the miniconda installation. These are the directories where conda environments and extracted packages will live. If you need to reinstall miniconda, you won't have to re-create your environments and re-download and re-extract all the packages. Reinstallation will only reset the '''base''' environment. First, create the cache directory, if it doesn't exist.
 {{{#!highlight bash
  mkdir -p <path-to-conda-cache-directory>
# mkdir -p ~/conda-global-cache

  conda config --add pkgs_dirs <path-to-conda-cache-directory>/pkgs
# conda config --add pkgs_dirs ~/conda-global-cache/pkgs

  conda config --add envs_dirs <path-to-conda-cache-directory>/envs
# conda config --add pkgs_dirs ~/conda-global-cache/envs
}}}
 1. Configure conda.
  a. Do not update conda automatically. '''(Strongly recommended)'''
  {{{#!highlight bash
conda config --set auto_update_conda False
}}}
  a. If you don't want conda's base environment to be activated automatically. '''(Optional)'''
  {{{#!highlight bash
conda config --set auto_activate_base False
}}}
 1. Install '''conda 4.6.14'''.
 {{{#!highlight bash
conda install conda=4.6.14 -c defaults
}}}
 1. Initialize conda for shell interaction.
 {{{#!highlight bash
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.
 {{{#!highlight bash
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'''.
 {{{#!highlight bash
conda create -n eman-env eman-deps=14.1 -c cryoem -c defaults -c conda-forge
}}}
 1. Activate the environment.
 {{{#!highlight bash
conda activate eman-deps-14.1
}}}
 OR
 {{{#!highlight bash
conda activate eman-env
}}}
 1. Navigate to your source directory. Checkout a branch and pull updates from the remote.
 {{{#!highlight bash
cd <source-directory>
git checkout <branch>
git pull --rebase
}}}
 1. Navigate to your build directory, build and install.
 {{{#!highlight bash
cd <build-directory>
cmake <eman-source-directory>
make
make install
}}}



== Python 3 Transition Environments ==

{{{#!wiki comment
'''TODO'''
 1. Fix eman-deps versions in the PR envs.
 1. Add new env for new compilers, maybe, for boost 1.67 and update eman-deps-feedstock.
}}}

=== Phase 1: 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.
 {{{#!highlight bash
conda create -n eman-deps-15.1 eman-deps=15.1 cmake=3.14 -c cryoem -c defaults -c conda-forge
conda activate eman-deps-15.1
}}}
 1. Navigate to your source directory. Checkout branch '''cmake-upgrade''' and pull updates from the remote.
 {{{#!highlight bash
cd <source-directory>
git checkout cmake-upgrade
git pull --rebase
}}}
 1. Navigate to your build directory, build and install.
 {{{#!highlight bash
cd <build-directory>
cmake <eman2-source-directory>
make
make install
}}}
 1. To switch to another conda environment, first deactivate your current environment.
 {{{#!highlight bash
Line 15: Line 166:
or
source deactivate
}}}


=== 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. Update conda {{{
conda update conda -c defaults
}}}
 1. Install eman-deps with python 3{{{
conda install eman-deps=15 -c cryoem/label/py3 -c cryoem -c defaults -c conda-forge
}}}


== Build ==
 1. Activate the python 3 environment, if it is a conda environment{{{
conda activate eman-deps-15
or
source activate eman-deps-15
}}} or edit PATH to have the miniconda installation with python 3 as the first entry.
 1. Move into your build directory {{{
cd <python 3 build directory>
}}}
 1. Build and install {{{
cmake <eman2 source directory>
make
make install
}}}
}}}

=== Phase 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.
 {{{#!highlight bash
conda create -n eman-deps-16.1 eman-deps=16.1 cmake=3.14 boost=1.64 -c cryoem -c defaults -c conda-forge
conda activate eman-deps-16.1
}}}
 1. Navigate to your source directory. Checkout branch '''py2-boost-164''' and pull updates from the remote.
 {{{#!highlight bash
cd <source-directory>
git checkout py2-boost-164
git pull --rebase
}}}
 1. Navigate to your build directory, build and install.
 {{{#!highlight bash
cd <build-directory>
cmake <eman2-source-directory>
make
make install
}}}
 1. To switch to another conda environment, first deactivate your current environment.
 {{{#!highlight bash
conda deactivate
}}}


=== Phase 3: Test Boost 1.66 ===
[[https://github.com/cryoem/eman2/pull/410|PR: Build with Boost versions 1.65-1.66]]

 1. Create a new environment and activate it.
 {{{#!highlight bash
conda create -n eman-deps-16.1 eman-deps=16.1 cmake=3.14 boost=1.66 -c cryoem -c defaults -c conda-forge
conda activate eman-deps-16.1
}}}
 1. Navigate to your source directory. Checkout branch '''py2-boost-166''' and pull updates from the remote.
 {{{#!highlight bash
cd <source-directory>
git checkout py2-boost-166
git pull --rebase
}}}
 1. Navigate to your build directory, build and install.
 {{{#!highlight bash
cd <build-directory>
cmake <eman2-source-directory>
make
make install
}}}
 1. To switch to another conda environment, first deactivate your current environment.
 {{{#!highlight bash
conda deactivate
}}}


== Python 3 Environments (Coming Soon!) ==

Coming soon!

Python 3 Transition Environments

Phase 1: Upgrade CMake to 3.14

PR: Upgrade CMake to 3.14

Install cmake=3.24 and eman-deps=15.1.

  •    1 conda install eman-deps=15.1 cmake=3.14 -c cryoem -c defaults -c conda-forge
    

Phase 2: Test Boost 1.64

PR: Upgrade Boost to 1.64

  •    1 conda install eman-deps=16.1 cmake=3.14 boost=1.64 -c cryoem -c defaults -c conda-forge
    

Phase 3: Test Boost 1.66

PR: Build with Boost versions 1.65-1.66

  •    1 conda install eman-deps=16.1 cmake=3.14 boost=1.66 -c cryoem -c defaults -c conda-forge
    

Python 3 Environments (Coming Soon!)

Coming soon!


The following sections were written with conda environments in mind, but will not be used. Keeping here for future reference.


Setup Development Environment with Conda

  1. If you have an existing Miniconda2/Anaconda2 installation,

    1. Remove miniconda/anaconda 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.

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

  3. Install Miniconda3.

       1 bash <Miniconda3-installer>
    
    and follow the prompts.
  4. Specify package and environment directories outside of the miniconda installation. These are the directories where conda environments and extracted packages will live. If you need to reinstall miniconda, you won't have to re-create your environments and re-download and re-extract all the packages. Reinstallation will only reset the base environment. First, create the cache directory, if it doesn't exist.

       1   mkdir -p <path-to-conda-cache-directory>
       2 # mkdir -p ~/conda-global-cache
       3 
       4   conda config --add pkgs_dirs <path-to-conda-cache-directory>/pkgs
       5 # conda config --add pkgs_dirs ~/conda-global-cache/pkgs
       6 
       7   conda config --add envs_dirs <path-to-conda-cache-directory>/envs
       8 # conda config --add pkgs_dirs ~/conda-global-cache/envs
       9 
    
  5. Configure conda.
    1. Do not update conda automatically. (Strongly recommended)

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

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

       1 conda install conda=4.6.14 -c defaults
    
  7. Initialize conda for shell interaction.
       1 conda init bash
       2 
       3 # See command help for supported shells
       4 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.
       1 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.

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

Python 3 Transition Environments

Phase 1: Upgrade CMake to 3.14

PR: Upgrade CMake to 3.14

  1. Create a new environment and activate it.
       1 conda create -n eman-deps-15.1 eman-deps=15.1 cmake=3.14 -c cryoem -c defaults -c conda-forge
       2 conda activate eman-deps-15.1
    
  2. Navigate to your source directory. Checkout branch cmake-upgrade and pull updates from the remote.

       1 cd <source-directory>
       2 git checkout cmake-upgrade
       3 git pull --rebase
    
  3. Navigate to your build directory, build and install.
       1 cd <build-directory>
       2 cmake <eman2-source-directory>
       3 make
       4 make install
    
  4. To switch to another conda environment, first deactivate your current environment.
       1 conda deactivate
    

Phase 2: Test Boost 1.64

PR: Upgrade Boost to 1.64

  1. Create a new environment and activate it.
       1 conda create -n eman-deps-16.1 eman-deps=16.1 cmake=3.14 boost=1.64 -c cryoem -c defaults -c conda-forge
       2 conda activate eman-deps-16.1
    
  2. Navigate to your source directory. Checkout branch py2-boost-164 and pull updates from the remote.

       1 cd <source-directory>
       2 git checkout py2-boost-164
       3 git pull --rebase
    
  3. Navigate to your build directory, build and install.
       1 cd <build-directory>
       2 cmake <eman2-source-directory>
       3 make
       4 make install
    
  4. To switch to another conda environment, first deactivate your current environment.
       1 conda deactivate
    

Phase 3: Test Boost 1.66

PR: Build with Boost versions 1.65-1.66

  1. Create a new environment and activate it.
       1 conda create -n eman-deps-16.1 eman-deps=16.1 cmake=3.14 boost=1.66 -c cryoem -c defaults -c conda-forge
       2 conda activate eman-deps-16.1
    
  2. Navigate to your source directory. Checkout branch py2-boost-166 and pull updates from the remote.

       1 cd <source-directory>
       2 git checkout py2-boost-166
       3 git pull --rebase
    
  3. Navigate to your build directory, build and install.
       1 cd <build-directory>
       2 cmake <eman2-source-directory>
       3 make
       4 make install
    
  4. To switch to another conda environment, first deactivate your current environment.
       1 conda deactivate
    

Python 3 Environments (Coming Soon!)

Coming soon!