Obtaining and Building MOOSE
Cloning MOOSE
MOOSE is hosted on GitHub and should be cloned directly from there using git. We recommend creating a directory named projects to put all of your MOOSE related work.
To install MOOSE run the following commands in a terminal.
mkdir ~/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.
Compile PETSc
By default, we use PETSc submodule inside of MOOSE as our nonlinear/linear solvers. PETSc can be built using the following script:
cd ~/projects/moose
unset PETSC_DIR PETSC_ARCH
./scripts/update_and_rebuild_petsc.sh
If you prefer to install PETSc into a specified location, use the following:
cd ~/projects/moose
unset PETSC_DIR PETSC_ARCH
./scripts/update_and_rebuild_petsc.sh --prefix=/where/you/want/to/put/petsc
During the follow-up libMesh compile, you need to set PETSC_DIR
, that is,
export PETSC_DIR=/where/you/want/to/put/petsc
If PETSc is built successfully, you should see some output like the following:
Now to check if the libraries are working do:
make PETSC_DIR=/your/home/projects/moose/scripts/../petsc PETSC_ARCH=arch-moose check
You could optionally check if PETSc works as follows:
cd ./petsc
make PETSC_DIR=/your/home/projects/moose/scripts/../petsc PETSC_ARCH=arch-moose check
PETSc should produce the output like this:
Running check examples to verify correct installation
Using PETSC_DIR=/your/home/projects/moose/scripts/../petsc and PETSC_ARCH=arch-moose
C/C++ example src/snes/tutorials/ex19 run successfully with 1 MPI process
C/C++ example src/snes/tutorials/ex19 run successfully with 2 MPI processes
C/C++ example src/snes/tutorials/ex19 run successfully with hypre
C/C++ example src/snes/tutorials/ex19 run successfully with mumps
C/C++ example src/snes/tutorials/ex19 run successfully with superlu_dist
Completed test examples
Compile libMesh
MOOSE directly relies on the libMesh finite-element framework. Because of this strong tie MOOSE contains a particular version of libMesh that we have vetted for our users. To pull down and compile this version of libMesh you simply need to run a script in MOOSE:
cd ~/projects/moose
./scripts/update_and_rebuild_libmesh.sh
Do not use sudo
when running update_and_rebuild_libmesh.sh.
Compile and Test MOOSE
cd ~/projects/moose/test
make -j 4
./run_tests -j 4
If the installation was successful you should see most of the tests passing (some tests will be skipped depending on your system environment).
Head back over to the Getting Started page to continue your tour of MOOSE.