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 Mambaforge. If you run into issues during these steps, please visit our Conda Troubleshooting guide. This installation guide relies on the utilization of mamba
, an optimized package manager for Conda.
Linux Users:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh bash Mambaforge-Linux-x86_64.sh -b -p ~/mambaforge3
Macintosh Users with Intel processors:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh bash Mambaforge-MacOSX-x86_64.sh -b -p ~/mambaforge3
Macintosh Users with Apple Silicon processors:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-arm64.sh bash Mambaforge-MacOSX-arm64.sh -b -p ~/mambaforge3
With Mambaforge installed in your home directory, export PATH so that it may be used:
export PATH=$HOME/mambaforge3/bin:$PATH
Now that we can execute mamba
, initialize it and then exit the terminal:
mamba init
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) ~>
Add INL's public channel to gain access to INL's Conda package library:
conda config --add channels https://conda.software.inl.gov/public
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:
mamba create -n moose moose-dev
After the installation completes, activate the new environment:
mamba activate moose
If you are running into errors, please see our troubleshooting guide for Conda.
Know that you will need to mamba 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.
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
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:
mamba activate base
mamba env remove -n moose
Now that you have a working MOOSE, proceed to 'New Users' to begin your tour of MOOSE!