diff --git a/docs/source/quickinstall.rst b/docs/source/quickinstall.rst index e45c552af0..2b815734ae 100644 --- a/docs/source/quickinstall.rst +++ b/docs/source/quickinstall.rst @@ -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 `. +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 `_. If you have `git `_, the `gcc `_ compiler suite, `CMake `_, and `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 diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index ab2fe2f120..274d4c66a5 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -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@``, ``%intel@``, 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: ----------------------