OpenMC/docs/source/quickinstall.rst

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

165 lines
5.8 KiB
ReStructuredText
Raw Permalink Normal View History

.. _quickinstall:
===================
Quick Install Guide
===================
This quick install guide outlines the basic steps needed to install OpenMC on
your computer. For more detailed instructions on configuring and installing
OpenMC, see :ref:`usersguide_install` in the User's Manual.
--------------------------------------------------
Installing on Linux/Mac with Mamba and conda-forge
--------------------------------------------------
2022-05-16 11:39:40 -05:00
`Conda <https://conda.io/en/latest/>`_ is an open source package management
system and environments management system for installing multiple versions of
2022-05-16 11:39:40 -05:00
software packages and their dependencies and switching easily between them.
`Mamba <https://mamba.readthedocs.io/en/latest/>`_ is a cross-platform package
manager and is compatible with `conda` packages.
OpenMC can be installed in a `conda` environment with `mamba`.
First, `conda` should be installed with one of the following installers:
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_,
`Anaconda <https://www.anaconda.com/>`_, or `Miniforge <https://github.com/conda-forge/miniforge>`_.
Once you have `conda` installed on your system, OpenMC can be installed via the
`conda-forge` channel with `mamba`.
2022-05-16 11:29:14 -05:00
First, add the `conda-forge` channel with:
.. code-block:: sh
conda config --add channels conda-forge
2022-05-16 11:39:40 -05:00
Then create and activate a new conda enviroment called `openmc-env` in
which to install OpenMC.
.. code-block:: sh
2022-05-16 11:29:14 -05:00
conda create -n openmc-env
conda activate openmc-env
2022-05-16 11:29:14 -05:00
Then install `mamba`, which will be used to install OpenMC.
2020-06-12 13:24:35 +06:00
.. code-block:: sh
2020-06-12 09:17:10 +06:00
2022-05-16 11:29:14 -05:00
conda install mamba
2022-05-16 11:29:14 -05:00
To list the versions of OpenMC that are available on the `conda-forge` channel,
in your terminal window or an Anaconda Prompt run:
.. code-block:: sh
2022-05-16 11:29:14 -05:00
mamba search openmc
OpenMC can then be installed with:
.. code-block:: sh
mamba install openmc
You are now in a conda environment called `openmc-env` that has OpenMC installed.
-------------------------------------------
Installing on Linux/Mac/Windows with Docker
-------------------------------------------
OpenMC can be easily deployed using `Docker <https://www.docker.com/>`_ on any
Windows, Mac, or Linux system. With Docker running, execute the following command
in the shell to download and run a `Docker image`_ with the most recent release
2021-03-18 15:58:08 -05:00
of OpenMC from `DockerHub <https://hub.docker.com/>`_:
.. code-block:: sh
2021-03-18 15:58:08 -05:00
docker run openmc/openmc:latest
This will take several minutes to run depending on your internet download speed.
The command will place you in an interactive shell running in a `Docker
container`_ with OpenMC installed.
.. note:: The ``docker run`` command supports many `options`_ for spawning
containers including `mounting volumes`_ from the host filesystem,
which many users will find useful.
.. _Docker image: https://docs.docker.com/engine/reference/commandline/images/
.. _Docker container: https://www.docker.com/resources/what-container
.. _options: https://docs.docker.com/engine/reference/commandline/run/
.. _mounting volumes: https://docs.docker.com/storage/volumes/
----------------------------------
Installing from Source using Spack
----------------------------------
2021-03-12 14:03:02 +00:00
Spack_ is a package management tool designed to support multiple versions and
configurations of software on a wide variety of platforms and environments.
2021-03-12 12:29:54 +00:00
Please follow Spack's `setup guide`_ to configure the Spack system.
2021-03-12 12:29:54 +00:00
To install the latest OpenMC with the Python API, use the following command:
.. code-block:: sh
2021-03-12 12:29:54 +00:00
spack install py-openmc
2021-03-12 12:29:54 +00:00
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
--------------------------------
2016-01-19 12:56:42 -06:00
To build OpenMC from source, several :ref:`prerequisites <prerequisites>` are
needed. If you are using Ubuntu or higher, all prerequisites can be installed
directly from the package manager:
2016-01-19 12:56:42 -06:00
.. code-block:: sh
sudo apt install g++ cmake libhdf5-dev libpng-dev
2016-01-19 12:56:42 -06:00
After the packages have been installed, follow the instructions below for
building and installing OpenMC from source.
-------------------------------------------
Installing from Source on Linux or Mac OS X
-------------------------------------------
All OpenMC source code is hosted on `GitHub
2018-08-02 10:49:40 -05:00
<https://github.com/openmc-dev/openmc>`_. If you have `git
<https://git-scm.com>`_, the `gcc <https://gcc.gnu.org/>`_ compiler suite,
`CMake <https://cmake.org>`_, and `HDF5
<https://www.hdfgroup.org/solutions/hdf5/>`_ installed, you can download and
install OpenMC be entering the following commands in a terminal:
.. code-block:: sh
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
2015-05-02 09:28:09 +07:00
cd openmc
mkdir build && cd build
2015-05-02 09:28:09 +07:00
cmake ..
make
2013-01-28 13:53:36 -05:00
sudo make install
2013-01-28 13:53:36 -05:00
This will build an executable named ``openmc`` and install it (by default in
2015-05-02 09:28:09 +07:00
/usr/local/bin). If you do not have administrator privileges, the cmake command
should specify an installation directory where you have write access, e.g.
.. code-block:: sh
2015-05-02 09:28:09 +07:00
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
The :mod:`openmc` Python package must be installed separately. The easiest way
to install it is using `pip <https://pip.pypa.io/en/stable/>`_, which is
included by default in Python 3.4+. From the root directory of the OpenMC
distribution/repository, run:
.. code-block:: sh
pip install .
2017-04-05 07:11:57 -05:00
If you want to build a parallel version of OpenMC (using OpenMP or MPI),
directions can be found in the :ref:`detailed installation instructions
<usersguide_build>`.