pueoBuilder
Loading...
Searching...
No Matches
Optional: Conda
  • Last tested: Thursday July 3, 2025 on OSC: Cardinal Cluster
    Deprecated
    Seems like environment variables can no longer be set through conda-devenv as promised in the old README, so you should still follow Step 1: install location to set $PUEO_UTIL_INSTALL_DIR. If you figure out how to solve this issue, please submit a PR to edit this page accordingly.
  • You can safely ignore Step 2: dependencies if you choose to follow the instructions on this page. That said, Conda is probably more difficult to set up and will incur overhead each time you log in.
  • The instruction below is ported from here, which in turn is modified from the old README.

Installing Mamba (Conda)

Remarks
We use Mamba to manage packages and environments instead of Conda to save some disk space, also because it is way faster. It is possible to install Mamba through an existing Anaconda (or Miniconda) installation, but this method is not recommended by Mamba. Consider checking out the Mambaforge (aka Miniforge) distribution to learn more.
  1. Download the Mamba installation script through
    wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
    and install with
    bash Miniforge3-Linux-x86_64.sh
  2. Press Enter to proceed to the license page, when prompted with

    ‍Do you accept the license terms? [yes|no]

    Enter yes to agree to the license terms.
  3. Press Enter again to install Miniforge to the default location (probably your home directory)
  4. When prompted with

    ‍installation finished.
    Do you wish to update your shell profile to automatically initialize conda?
    This will activate conda on startup and change the command prompt when activated.
    If you'd prefer that conda's base environment not be activated on startup,
    run the following command when conda is activated:

    conda config --set auto_activate_base false

    You can undo this by running conda init --reverse $SHELL? [yes|no]


    Answer no to finish the installation.
  5. Next, follow the prompt on your terminal and activate conda. Assuming that you installed to ${HOME}/ and that you are using the bash shell, you'd enter
    eval "$(${HOME}/miniforge3/bin/conda shell.bash hook)"
    and then you should see (base) popping up in front of your username prompt:

    ‍[jason@cardinal-login03 ~]$ eval "$(${HOME}/miniforge3/bin/conda shell.bash hook)"
    (base) [jason@cardinal-login03 ~]$

    This means the "base" environment has been activated.
  6. Next, make mamba available through
    eval "$(mamba shell hook --shell bash)"
  7. Next, enter (assuming you installed Miniforge to home)
    mamba shell init --shell bash --root-prefix=~/miniforge3
    in your terminal. You should see a prompt similar to

    ‍Running shell init, which:

    • modifies RC file: "/users/PAS2137/unmovingcastle/.bashrc"
    • generates config for root prefix: "/users/PAS2137/unmovingcastle/miniforge3"
    • sets mamba executable to: "/users/PAS2137/unmovingcastle/miniforge3/bin/mamba"

    The following has been added in your "/users/PAS2137/unmovingcastle/.bashrc" file ...

    This means that mamba has modified your ~/.bashrc.
    Next time you log in, mamba would automatically activate.
  8. You can confirm that you have an environment called "base" by entering the command
    conda info --env
    Miniforge also comes with a Python installation, type
    which python
    and you should see a path pointing to miniforge3/bin/python3.
  9. Finally, you would want to install conda-devenv through
    mamba install conda-devenv
    You can find the documentation for conda-devenv here.

Creating the PUEO environment

  1. We will first create an empty environment:
    mamba create -n pueo_env
    Using vim or any editor, create a text file called pueo.devenv.yml that contains the following:
    name: pueo_env
    channels:
    - conda-forge
    - defaults
    dependencies:
    - fftw
    - root
  2. Make sure that (base) is active. If not, run
    conda activate base
    Then, create a new environment called pueo_env through
    mamba-devenv -f pueo.devenv.yml
    Attention
    For OSC: Pitzer users:
    • Consider using Cardinal.
    • If you want to run on Pitzer, it is important that you run
      mamba-devenv
      and not conda-devenv or mamba devenv.
      Anything that is not mamba-devenv seems to be exceedingly slow on Pitzer.
    Bug
    You might see a KeyError: envs_dirs. I think it's fine?
  3. Activate this new environment pueo_env through
    conda activate peuo_env
    (or mamba activate pueo_env)

Installing cmake

If you are doing this on your own Linux machine, you likely already have cmake; If not, you can usually easily obtain it through your distro's package manager (eg. dnf).

On OSC, cmake is also already installed. To use cmake version 3.25.2, run

module load cmake/3.25.2

and check that the version is activated through

cmake --version

Done

Make sure that the pueo_env environment is actived, and make sure that you cmake is loaded. Next, follow Installing All Things PUEO.