Problem Installing OpenMC on Manjaro

I am using the openmc tutorial by Copenhagen Atomics (https://youtu.be/sCDT5ZAeJcY?si=GwApix-8RGlTcHgu) to download OpenMC. I am stuck on the error:

RuntimeError: Failed to open HDF5 file with mode ‘r’: /opt/nuclear-data/endfb-vii.1-hdf5/neutron/U235.h5

I get this error when doing: bash ./test_install.sh

Please help

Please, run the command and show the output to us:

ls /opt/nuclear-data/endfb-vii.1-hdf5/neutron/U235.h5

This is the output:

ls: cannot access ‘/opt/nuclear-data/endfb-vii.1-hdf5/neutron/U235.h5’: No such file or directory

So you alread know the problem is with nuclear-data (cross sections files), not in openmc.

Install nuclear-data correctly:

git clone https://aur.archlinux.org/nuclear-data.git
cd nuclear-data
makepkg -si

Or use paru to install it:

paru -S nuclear-data

(or use yay or any other of your preference)

The package nuclear-data let you choose between 4 cross sections (or you can choose all):

endfb71
endfb80
jeff33
fendl32

The cross sections will go folder: /opt/nuclear-data/
Inside will have a folder of what kind you choose.

Inside this folder will have 3 folder’s: neutron, photon and another I forget.

Inside neutron folder will have 1 file .h5 to each cross section: u235.h5, u238.h5, etc

To run openmc daily you should specificy the crosssection folder. You can do it on python code ou export a variable contain this folder before run openmc:
export OPENMC_CROSS_SECTIONS=/opt/nuclear-data/endfb-vii.1-hdf5/cross_sections.xml

To don’t need export this variable every time manually, put this comand on your file .bashrc (of your user).

Ok, I tried what you did, and I get the same pymoab error but there is nothing about the runtime:

bash ./test_install.sh  :heavy_check_mark:
Traceback (most recent call last):
File “/home/sauravquantum/.cache/yay/openmc-git/step_to_h5m.py”, line 2, in
import CAD_to_OpenMC.assembly as ab
File “/usr/lib/python3.12/site-packages/CAD_to_OpenMC/assembly.py”, line 18, in
from pymoab import core, types
ModuleNotFoundError: No module named ‘pymoab’
/usr/lib/python3.12/site-packages/openmc/stats/multivariate.py:829: FutureWarning: The ‘only_fissionable’ has been deprecated. Use the ‘constraints’ argument when defining a source instead.
warn("The ‘only_fissionable’ has been deprecated. Use the "
/usr/lib/python3.12/site-packages/openmc/source.py:656: FutureWarning: This class is deprecated in favor of ‘IndependentSource’
warnings.warn(“This class is deprecated in favor of ‘IndependentSource’”, FutureWarning)
Traceback (most recent call last):
File “/home/sauravquantum/.cache/yay/openmc-git/test_openmc.py”, line 59, in
openmc.run()
File “/usr/lib/python3.12/site-packages/openmc/executor.py”, line 314, in run
_run(args, output, cwd)
File “/usr/lib/python3.12/site-packages/openmc/executor.py”, line 97, in _run
p = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/subprocess.py”, line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.12/subprocess.py”, line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘openmc’
rm: cannot remove ‘.h5’: No such file or directory
rm: cannot remove '
.stl’: No such file or directory
rm: cannot remove ‘*.h5m’: No such file or directory

The error is write here:

That is: Pymoab isn’t installed.

Maybe you just install moab packege from AUR can solve this:

git clone https://aur.archlinux.org/moab.git
cd moab
makepkg -si

or:

paru -S moab

But I need say something: your questions is very easy to solve, just read the error code… So that means you are a new user on GNU/Linux or at least a basic user…
In this case I recomend don’t compile from source the code, because this is a advance way to install OpenMC that you have control about are you are installing or not (but you need to learn to solve the basic problems by yourself).

So I will let a script to install OpenMC from conda, that is much more easy to install because alredy come compilled. But you shoud read the OpenMC docs anyway: Quick Install Guide — OpenMC Documentation

paru -S nuclear-data miniconda3

echo """

#MiniConda
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1

#OpenMC Cross Sections
var=`echo /opt/nuclear-data/*hdf5 | head -n1`
export OPENMC_CROSS_SECTIONS=$var/cross_sections.xml
""" >> ~/.bashrc

source /opt/miniconda3/etc/profile.d/conda.sh
conda config --add channels conda-forge
conda create -n openmc-env openmc[version=0.14.0,build=nompi_py312hecd8f91_1]

This will install the miniconda3 aur package, use conda to create a envrolviment and install openmc in this envrolviment.

So every time you want to user openmc, you should activate this envrolvment after open the terminal:

conda activate openmc-env

If you don’t wanna this command every time after open the terminal, put on .bashrc:

echo "conda activate openmc-env" >> ~/.bashrc

You can figure out another versions of OpenMC with the command:

conda search openmc

Recently they release the 0.15.0 version.
Today this version is not on conda yet, but you can check it later and install new version when you want. For now you can start to use the 0.14.0 version.