|
| 1 | +--- |
| 2 | +layout: manual |
| 3 | +title: OpenMC |
| 4 | +subtitle: "OpenMC - Installing from source for development" |
| 5 | +permalink: /manual/guides/openmc |
| 6 | +--- |
| 7 | + |
| 8 | +# Recommendation 0. Read the Installation Guide |
| 9 | +OpenMC has an [excellent installation |
| 10 | +guide](https://docs.openmc.org/en/stable/usersguide/install.html#installing-from-source) |
| 11 | +that covers the dependencies. Several practices, discussed below, may |
| 12 | +make the whole process easier, cleaner, and more self-contained. |
| 13 | + |
| 14 | +# Recommendation 1. Set up a Conda Environment |
| 15 | +When building OpenMC from source, using a conda environment to install |
| 16 | +dependencies allows different versions of various dependencies to co-exist on |
| 17 | +the same machine. It also eases installation of OpenMC's Python API. |
| 18 | +To create an environment with the name `openmc-env`, run: |
| 19 | + |
| 20 | +``` |
| 21 | +conda create -n openmc-env |
| 22 | +``` |
| 23 | + |
| 24 | +# Recommendation 2. Install Dependencies |
| 25 | +Install all the dependencies listed in the installation guide using conda in your new environment. For |
| 26 | +example, to install the Python dependencies, run: |
| 27 | +``` |
| 28 | +conda install numpy scipy pandas pytest matplotlib lxml |
| 29 | +uncertainties |
| 30 | +``` |
| 31 | +This _should_ install the required compilers and HDF5 libraries needed for |
| 32 | +OpenMC. |
| 33 | +> [!NOTE] |
| 34 | +> The recommendations for installing `h5py` in |
| 35 | +> [development mode](https://docs.openmc.org/en/stable/usersguide/install.html#installing-in-development-mode) |
| 36 | +> are in the installation guide. If you chose to do this, you should set |
| 37 | +> `HDF5_DIR=$CONDA_PREFIX` (for building `h5py`) and `HDF5_ROOT=$CONDA_PREFIX`(for |
| 38 | +> building OpenMC). |
0 commit comments