Merge pull request #1790 from NavalNuclearLab/spack-docs

Spack Installation Documentation
This commit is contained in:
Paul Romano 2021-03-16 07:22:03 -05:00 committed by GitHub
commit 3e2051da3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 103 additions and 1 deletions

View file

@ -95,6 +95,28 @@ This will take several minutes to run depending on your internet download speed.
.. _options: https://docs.docker.com/engine/reference/commandline/run/
.. _mounting volumes: https://docs.docker.com/storage/volumes/
----------------------------------
Installing from Source using Spack
----------------------------------
Spack_ is a package management tool designed to support multiple versions and
configurations of software on a wide variety of platforms and environments.
Please follow Spack's `setup guide`_ to configure the Spack system.
To install the latest OpenMC with the Python API, use the following command:
.. code-block:: sh
spack install py-openmc
For more information about customizations including MPI, see the
:ref:`detailed installation instructions using Spack <install-spack>`.
Once installed, environment/lmod modules can be generated or Spack's `load` feature
can be used to access the installed packages.
.. _Spack: https://spack.readthedocs.io/en/latest/
.. _setup guide: https://spack.readthedocs.io/en/latest/getting_started.html
---------------------------------------
Installing from Source on Ubuntu 15.04+
---------------------------------------
@ -118,7 +140,7 @@ All OpenMC source code is hosted on `GitHub
<https://github.com/openmc-dev/openmc>`_. If you have `git
<https://git-scm.com>`_, the `gcc <https://gcc.gnu.org/>`_ compiler suite,
`CMake <http://www.cmake.org>`_, and `HDF5 <https://www.hdfgroup.org/HDF5/>`_
installed, you can download and install OpenMC be entering the following
installed, you can download and install OpenMC by entering the following
commands in a terminal:
.. code-block:: sh

View file

@ -74,6 +74,86 @@ are no longer supported.
.. _Personal Package Archive: https://launchpad.net/~paulromano/+archive/staging
.. _APT package manager: https://help.ubuntu.com/community/AptGet/Howto
.. _install-spack:
----------------------------------
Installing from Source using Spack
----------------------------------
Spack_ is a package management tool designed to support multiple versions and
configurations of software on a wide variety of platforms and environments.
Please follow Spack's `setup guide`_ to configure the Spack system.
The OpenMC Spack recipe has been configured with variants that match most options
provided in the CMakeLists.txt file. To see a list of these variants and other
information use:
.. code-block:: sh
spack info openmc
.. note::
It should be noted that by default OpenMC builds with ``-O2 -g`` flags which
are equivalent to a CMake build type of `RelwithDebInfo`. In addition, MPI
is OFF while OpenMP is ON.
It is recommended to install OpenMC with the Python API. Information about this
Spack recipe can be found with the following command:
.. code-block:: sh
spack info py-openmc
.. note::
The only variant for the Python API is ``mpi``.
The most basic installation of OpenMC can be accomplished by entering the following command:
.. code-block::
spack install py-openmc
.. caution::
When installing any Spack package, dependencies are assumed to be at configured defaults unless otherwise specfied in the
specification on the command line. In the above example, assuming the default options weren't changed in Spack's package
configuration, py-openmc will link against a non-optimized non-MPI openmc. Even if an optimized openmc was built separately,
it will rebuild openmc with optimization OFF. Thus, if you are trying to link against dependencies that were configured
different than defaults, ``^openmc[variants]`` will have to be present in the command.
For a more performant build of OpenMC with optimization turned ON and MPI provided by OpenMPI, the following command can be
used:
.. code-block:: sh
spack install py-openmc+mpi ^openmc+optimize ^openmpi
.. note::
``+mpi`` is automatically forwarded to OpenMC.
.. tip::
When installing py-openmc, it will use Spack's preferred Python. For example, assuming Spack's preferred Python
is 3.8.7, to build py-openmc against the latest Python 3.7 instead, ``^python@3.7.0:3.7.99`` should be added to the
specification on the command line. Additionally, a compiler type and version can be specified at the end of the
command using ``%gcc@<version>``, ``%intel@<version>``, etc.
A useful tool in Spack is to look at the dependency tree before installation. This can be observed using
Spack's `spec` tool:
.. code-block::
spack spec py-openmc+mpi ^openmc+optimize
Once installed, environment/lmod modules can be generated or Spack's `load` feature
can be used to access the installed packages.
.. _Spack: https://spack.readthedocs.io/en/latest/
.. _setup guide: https://spack.readthedocs.io/en/latest/getting_started.html
.. _install_source:
----------------------