Conda MOOSE Environment

Our preferred method for obtaining dependencies necessary for MOOSE-based application development is via Conda's myriad array of libraries. Follow these instructions to create an environment on your machine using Conda.

Follow the steps below depending on your platform to install Miniforge. If you run into issues during these steps, please visit our Conda Troubleshooting guide.

  • Linux Users:

    
    curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
    bash Miniforge3-Linux-x86_64.sh -b -p ~/miniforge
    

  • Macintosh Users with Intel processors:

    
    curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
    bash Miniforge3-MacOSX-x86_64.sh -b -p ~/miniforge
    

  • Macintosh Users with Apple Silicon processors:

    
    curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
    bash Miniforge3-MacOSX-arm64.sh -b -p ~/miniforge
    

With Miniforge installed in your home directory, export PATH so that it may be used:


export PATH=$HOME/miniforge/bin:$PATH

Now that we can execute conda, initialize it and then exit the terminal:


conda init --all
exit

Upon restarting your terminal, you should see your prompt prefixed with (base). This indicates you are in the base environment, and Conda is ready for operation:


$ (base) ~>

The next thing you should do after a fresh install, is perform an update to the base Conda environment:


conda update --all --yes

Add INL's public channel to gain access to INL's Conda package library:


conda config --add channels https://conda.software.inl.gov/public
warningwarning:Do not use sudo

If you find yourself using sudo commands while engaging Conda commands... something is not right. The most common reason for needing sudo is due to an improper Conda installation. Conda should be installed to your home directory, without any use of sudo.

Install MOOSE

Create a unique conda environment for MOOSE, named moose, and install the MOOSE dependency packages:

conda create -n moose moose-dev=2024.03.15

After the installation completes, activate the new environment:


conda activate moose

If you are running into errors, please see our troubleshooting guide for Conda.

commentnote

Know that you will need to conda activate moose for each terminal window you open, and each time you wish to perform MOOSE related work. If you wish to make this automatic, you can add that command to the end of your shell profile with the command below:


if [[ "$0" = *"bash" ]]; then
    echo "conda activate moose" >> ~/.bash_profile
elif [[ "$0" = "zsh" ]]; then
    echo "conda activate moose" >> ~/.zshrc
fi

Cloning MOOSE

MOOSE is hosted on GitHub and should be cloned directly from there using git. We recommend creating a directory ~/projects to contain all of your MOOSE related work.

To clone MOOSE, run the following commands in a terminal:


mkdir -p ~/projects
cd ~/projects
git clone https://github.com/idaholab/moose.git
cd moose
git checkout master
commentnote

The master branch of MOOSE is the stable branch that will only be updated after all tests are passing. This protects you from the day-to-day changes in the MOOSE repository.

Build and Test MOOSE

To build MOOSE run the following commands:


cd ~/projects/moose/test
make -j 6

To test MOOSE, run the following commands:


cd ~/projects/moose/test
./run_tests -j 6

Some tests are SKIPPED. This is normal as some tests are specific to available resources, or some other constraint your machine does not satisfy. If you see failures, or you see MAX FAILURES, thats a problem! And it needs to be addressed before continuing:

  • Supply a report of the actual failure (scroll up a ways). For example the following snippet does not give the full picture (created with ./run_tests -i always_bad):

    
    Final Test Results:
    --------------------------------------------------------------------------------
    tests/test_harness.always_ok .................... FAILED (Application not found)
    tests/test_harness.always_bad .................................. FAILED (CODE 1)
    --------------------------------------------------------------------------------
    Ran 2 tests in 0.2 seconds. Average test time 0.0 seconds, maximum test time 0.0 seconds.
    0 passed, 0 skipped, 0 pending, 2 FAILED
    

    Instead, you need to scroll up and report the actual error:

    
    tests/test_harness.always_ok: Working Directory: /Users/me/projects/moose/test/tests/test_harness
    tests/test_harness.always_ok: Running command:
    tests/test_harness.always_ok:
    tests/test_harness.always_ok: ####################################################################
    tests/test_harness.always_ok: Tester failed, reason: Application not found
    tests/test_harness.always_ok:
    tests/test_harness.always_ok .................... FAILED (Application not found)
    tests/test_harness.always_bad: Working Directory: /Users/me/projects/moose/test/tests/test_harness
    tests/test_harness.always_bad: Running command: false
    tests/test_harness.always_bad:
    tests/test_harness.always_bad: ###################################################################
    tests/test_harness.always_bad: Tester failed, reason: CODE 1
    tests/test_harness.always_bad:
    tests/test_harness.always_bad .................................. FAILED (CODE 1)
    

Uninstall

If you wish to remove the moose environment at any time, you may do so using the following commands:


conda activate base
conda env remove -n moose

Now that you have a working MOOSE, proceed to 'New Users' to begin your tour of MOOSE!