The ``my-amrex-branch`` will then be used when building MFiX-Exa.
The options **ENABLE\_PARTICLES=yes**, **ENABLE\_AMRDATA=yes**, and **ENABLE\_EB=yes** are required by MFiX-Exa. ``[other amrex options]`` in the snippet above refers to any other AMReX configuration option in addition to the required ones. Please refer to the `AMReX user guide <https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#building-with-cmake>`_ for more details on building AMReX with CMake.
To revert to the default version of the AMReX submodule, run ``git submodule
update``:
.. code:: shell
Building MFiX-Exa
~~~~~~~~~~~~~~~~~
> git submodule update
> git status
...
nothing to commit, working tree clean
You can edit, commit, pull, and push AMReX changes from ``subprojects/amrex``.
AMReX development is outside the scope of this document. Run ``git status`` in
the top-level MFix-Exa repo to see whether the AMReX submodule has new commits,
modified files, or untracked files.
To update the AMReX submodule reference by MFiX-Exa:
Clone and build MFiX-Exa:
.. code:: shell
> git add subprojects/amrex
> git commit -m 'Updating AMReX version'
This will only update the AMReX SHA-1 referenced by MFiX-Exa. Uncommitted AMReX
changes and untracked AMReX files under ``subprojects/amrex`` are not added by
``git add subprojects/amrex``. Change directories to ``subprojects/amrex`` and
commit any AMReX changes first before ``git add subprojects/amrex``.
.. note::
Only update the AMReX submodule reference in coordination with the other
MFiX-Exa developers!
Proceed to :ref:`Configuring`.
.. _external_amrex:
External AMReX
~~~~~~~~~~~~~~
It is also possible to build MFiX-Exa with an existing AMReX installation.
For instructions on building AMReX with CMake, refer to the `AMReX user guide
If building with :ref:`external_amrex`, specify the path to AMReX with
``-DAMREX_ROOT``:
If no AMReX installation is found on the system, or if one is found but does not meet MFiX-Exa requirements, MFiX-Exa CMake falls back to **SUPERBUILD** mode.
When building in **SUPERBUILD** mode, the AMReX git repo is checked out via a git submodule before AMReX CMake build system is included into MFiX-Exa CMake infrastructure. Consequently, MFiX-Exa CMake inherents AMReX's CMake targets and configuration options, that is, MFiX-Exa and AMReX are configured and built as a single entity.
.. highlight:: console
::
> cmake -S . -B builddir \
-DAMREX_ROOT=/absolute/path/to/amrex/installdir
Passing ``-DAMREX_ROOT=/absolute/path/to/amrex/installdir`` instructs CMake to
search ``/absolute/path/to/amrex/installdir``, and then search system paths, for
an available AMReX installation.
Alternatively, set the ``AMREX_ROOT`` environmental variable instead of passing
it as a command line option.
Assuming no valid AMReX installation is present on the target system, and ``AMReX_ROOT`` is not set in the environment, the following code will build MFiX-Exa in **SUPERBUILD** mode:
.. note::
.. code:: shell
MFiX-Exa needs to be built with the same CMake options used to build the
external AMReX installation. This is another reason when the default
``[amrex options]`` is a list of any of the AMReX configuration options listed in the `AMReX user guide <https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#building-with-cmake>`_
.. _Building:
Building
--------
Few more notes on building MFiX-Exa
-----------------------------------
To build MFiX-Exa:
The system defaults compilers can be overwritten as follows: