2012-05-19 22:23:55 +07:00
|
|
|
.. _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.
|
|
|
|
|
|
2025-03-07 14:49:36 -06:00
|
|
|
----------------------------------
|
|
|
|
|
Installing on Linux/Mac with Conda
|
|
|
|
|
----------------------------------
|
2022-05-12 13:18:53 -05:00
|
|
|
|
2025-03-07 14:49:36 -06:00
|
|
|
`Conda <https://docs.conda.io/en/latest/>`_ is an open source package management
|
2022-05-25 13:35:00 -05:00
|
|
|
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.
|
2025-03-07 14:49:36 -06:00
|
|
|
OpenMC can be installed in a `conda` environment. First, `conda` should be
|
|
|
|
|
`installed <https://www.anaconda.com/docs/getting-started/getting-started>`_
|
|
|
|
|
with either Anaconda Distribution or Miniconda. Once you have `conda` installed
|
|
|
|
|
on your system, OpenMC can be installed via the `conda-forge` channel.
|
2022-05-16 11:29:14 -05:00
|
|
|
|
|
|
|
|
First, add the `conda-forge` channel with:
|
2016-10-06 17:07:32 -05:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
|
|
conda config --add channels conda-forge
|
2025-03-07 14:49:36 -06:00
|
|
|
conda config --set channel_priority strict
|
2016-10-06 17:07:32 -05:00
|
|
|
|
2025-03-07 14:49:36 -06:00
|
|
|
Then create and activate a new conda enviroment called `openmc-env` (or whatever
|
|
|
|
|
you wish) with OpenMC installed.
|
2022-05-12 13:18:53 -05:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2025-03-07 14:49:36 -06:00
|
|
|
conda create --name openmc-env openmc
|
2022-05-16 11:29:14 -05:00
|
|
|
conda activate openmc-env
|
2022-05-12 13:18:53 -05:00
|
|
|
|
2025-07-03 17:59:40 -05:00
|
|
|
If you are installing on macOS with an Apple silicon ARM-based processor, you
|
|
|
|
|
will also need to specify the `--platform` option:
|
|
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2025-07-15 16:53:52 -04:00
|
|
|
conda create --name openmc-env --platform osx-64 openmc
|
2025-07-03 17:59:40 -05:00
|
|
|
|
2025-03-07 14:49:36 -06:00
|
|
|
You are now in a conda environment called `openmc-env` that has OpenMC
|
|
|
|
|
installed.
|
2016-10-06 17:07:32 -05:00
|
|
|
|
2018-09-23 16:21:18 -04:00
|
|
|
-------------------------------------------
|
2018-09-30 16:51:57 -04:00
|
|
|
Installing on Linux/Mac/Windows with Docker
|
2018-09-23 16:21:18 -04:00
|
|
|
-------------------------------------------
|
|
|
|
|
|
|
|
|
|
OpenMC can be easily deployed using `Docker <https://www.docker.com/>`_ on any
|
2021-03-08 07:00:32 -06:00
|
|
|
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/>`_:
|
2018-09-23 16:21:18 -04:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2021-03-18 15:58:08 -05:00
|
|
|
docker run openmc/openmc:latest
|
2018-09-23 16:21:18 -04:00
|
|
|
|
2021-03-08 07:00:32 -06:00
|
|
|
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.
|
2018-09-23 16:21:18 -04:00
|
|
|
|
2018-09-30 18:11:31 -04:00
|
|
|
.. note:: The ``docker run`` command supports many `options`_ for spawning
|
2021-03-08 07:00:32 -06:00
|
|
|
containers including `mounting volumes`_ from the host filesystem,
|
|
|
|
|
which many users will find useful.
|
2018-09-23 16:21:18 -04:00
|
|
|
|
|
|
|
|
.. _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/
|
|
|
|
|
|
2021-03-10 13:10:15 +00:00
|
|
|
----------------------------------
|
|
|
|
|
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
|
2021-03-10 13:10:15 +00:00
|
|
|
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-10 13:10:15 +00:00
|
|
|
|
2021-03-12 12:29:54 +00:00
|
|
|
To install the latest OpenMC with the Python API, use the following command:
|
2021-03-10 13:10:15 +00:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2021-03-12 12:29:54 +00:00
|
|
|
spack install py-openmc
|
2021-03-10 13:10:15 +00:00
|
|
|
|
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>`.
|
2021-03-10 13:10:15 +00:00
|
|
|
Once installed, environment/lmod modules can be generated or Spack's `load` feature
|
2021-03-05 08:02:53 -06:00
|
|
|
can be used to access the installed packages.
|
2021-03-10 13:10:15 +00:00
|
|
|
|
|
|
|
|
.. _Spack: https://spack.readthedocs.io/en/latest/
|
|
|
|
|
.. _setup guide: https://spack.readthedocs.io/en/latest/getting_started.html
|
|
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
-------------------------------
|
|
|
|
|
Manually Installing from Source
|
|
|
|
|
-------------------------------
|
2016-01-19 12:56:42 -06:00
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
Obtaining prerequisites on Ubuntu
|
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
|
|
When building OpenMC from source, all :ref:`prerequisites <prerequisites>` can
|
|
|
|
|
be installed using the package manager:
|
2016-01-19 12:56:42 -06:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2021-10-01 13:20:12 -05:00
|
|
|
sudo apt install g++ cmake libhdf5-dev libpng-dev
|
2016-01-19 12:56:42 -06:00
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
After the packages have been installed, follow the instructions to build from
|
|
|
|
|
source below.
|
2016-01-19 12:56:42 -06:00
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
Obtaining prerequisites on macOS
|
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
|
|
For an OpenMC build with multithreading enabled, a package manager like
|
|
|
|
|
`Homebrew <https://brew.sh>`_ should first be installed. Then, the following
|
|
|
|
|
packages should be installed, for example in Homebrew via:
|
|
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2026-02-17 09:50:38 -06:00
|
|
|
brew install llvm cmake hdf5 python libomp libpng
|
2024-04-20 00:44:40 -05:00
|
|
|
|
|
|
|
|
The compiler provided by the above LLVM package should be used in place of the
|
|
|
|
|
one provisioned by XCode, which does not support the multithreading library used
|
2024-10-11 23:11:27 -05:00
|
|
|
by OpenMC. To ensure CMake picks up the correct compiler, make sure that either
|
|
|
|
|
the :envvar:`CXX` environment variable is set to the brew-installed ``clang++``
|
|
|
|
|
or that the directory containing it is on your :envvar:`PATH` environment
|
|
|
|
|
variable. Common locations for the brew-installed compiler are
|
|
|
|
|
``/opt/homebrew/opt/llvm/bin`` and ``/usr/local/opt/llvm/bin``.
|
2024-04-20 00:44:40 -05:00
|
|
|
|
|
|
|
|
After the packages have been installed, follow the instructions to build from
|
|
|
|
|
source below.
|
|
|
|
|
|
|
|
|
|
Building Source on Linux or macOS
|
|
|
|
|
---------------------------------
|
2012-05-19 22:23:55 +07:00
|
|
|
|
2018-01-31 13:13:15 -06:00
|
|
|
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
|
2024-04-20 00:44:40 -05:00
|
|
|
<https://git-scm.com>`_, a modern C++ compiler, `CMake <https://cmake.org>`_,
|
|
|
|
|
and `HDF5 <https://www.hdfgroup.org/solutions/hdf5/>`_ installed, you can
|
|
|
|
|
download and install OpenMC by entering the following commands in a terminal:
|
2012-05-19 22:23:55 +07:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2020-01-12 16:49:09 -06:00
|
|
|
git clone --recurse-submodules https://github.com/openmc-dev/openmc.git
|
2015-05-02 09:28:09 +07:00
|
|
|
cd openmc
|
2015-05-22 13:43:29 +07:00
|
|
|
mkdir build && cd build
|
2015-05-02 09:28:09 +07:00
|
|
|
cmake ..
|
2012-05-19 22:23:55 +07:00
|
|
|
make
|
2013-01-28 13:53:36 -05:00
|
|
|
sudo make install
|
2012-05-19 22:23:55 +07:00
|
|
|
|
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.
|
2014-03-04 19:28:46 -05:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2015-05-02 09:28:09 +07:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
|
2012-05-19 22:23:55 +07:00
|
|
|
|
2018-01-31 13:13:15 -06:00
|
|
|
The :mod:`openmc` Python package must be installed separately. The easiest way
|
2024-04-20 00:44:40 -05:00
|
|
|
to install it is using `pip <https://pip.pypa.io/en/stable/>`_.
|
|
|
|
|
From the root directory of the OpenMC repository, run:
|
2018-01-31 13:13:15 -06:00
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
2023-06-13 06:19:10 -05:00
|
|
|
python -m pip install .
|
2018-01-31 13:13:15 -06:00
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
By default, OpenMC will be built with multithreading support. To build
|
|
|
|
|
distributed-memory parallel versions of OpenMC using MPI or to configure other
|
|
|
|
|
options, directions can be found in the :ref:`detailed installation instructions
|
2017-04-05 12:05:28 -05:00
|
|
|
<usersguide_build>`.
|