OpenMC installation inside Singularity Container on HPC - No such file or directory: 'openmc'

Hello there,

I have installed a singularity container on HPC in order to install inside of it the developer version of the code, 0.12.1.dev0, but it seems that something is missing.
In the file attached as a file.py, there is the recipe I have used to build the container locally, and then the command lines commented have been run once the container image was launched on the HPC. openmc_HPC_recipe.py (1.2 KB)

I thought I succeeded in the installation process, since if from shell, I run the image, activate the conda env, and check the version of the code, I can see that is the 0.12.1.dev0. If I submit a job for a file.py with a sbatch file as follow,

#!/bin/bash
#SBATCH --job-name=write_file.py 
#SBATCH --partition=global
#SBATCH --workdir=/home/ameli/test_write_read_source/write_source
#SBATCH --time=00:10:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --output=write.out
#SBATCH --mem-per-cpu=3M

module load singularity/3.2.1
singularity shell /home/ameli/ubuntu.sif
source /home/ameli/conda_dev/etc/profile.d/conda.sh
conda activate dev_openmc
export OPENMC_CROSS_SECTIONS="/home/ameli/conda_dev/pkgs/endfb71_hdf5/cross_sections.xml"
python3 write_file.py

I do get the error:

INFO: localdir at /scratch/284378.ameli
INFO: your job will run on local system.
[10 15 20 22]
Traceback (most recent call last):
  File "/home/ameli/test_write_read_source/write_source/write_file.py", line 79, in <module>
    openmc.run(threads=24)
  File "/home/ameli/openmc/openmc/executor.py", line 218, in run
    _run(args, output, cwd)
  File "/home/ameli/openmc/openmc/executor.py", line 10, in _run
    p = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE,
  File "/home/ameli/conda_dev/envs/dev_openmc/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/ameli/conda_dev/envs/dev_openmc/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'openmc'

I tried to install conda and then OpenMC from the source on a local pc, with the same procedure, and I can use the version I installed without any troubles.
I know it says it can’t filde the openmc directory, but I do see it on the cluster.
Has anyone already experienced something similar, or could someone give me a clue about it?

Thank in advance.

Tony

When you’re installing OpenMC, you need to make sure to run make install. If you are doing this within a conda environment, the correct steps would be:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
make
make install

followed by installing the Python API with pip install.

It seems that something has changed,

INFO: your job will run on local system.
[10 15 20 22]
openmc: error while loading shared libraries: libhdf5_serial.so.103: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File “/home/ameli/test_write_read_source/write_source/write_file.py”, line 80, in
openmc.run(threads=24)
File “/home/ameli/openmc/openmc/executor.py”, line 227, in run
_run(args, output, cwd)
File “/home/ameli/openmc/openmc/executor.py”, line 38, in _run
raise RuntimeError(error_msg)
RuntimeError: OpenMC aborted unexpectedly.

and googling it, I found a possible solution, so I added the libhdf5-serial-dev package on the recipe, among the packages installed during the image creation. But actually it did not work. Does anyone has already experienced it? Or does someone have an idea of what it could be?

Thanks in advance
Tony

When you install the h5py package, it uses its own version of the HDF5 library, so sometimes that can cause issues. It’s possible that you’re compiling against a library that is not found either through LD_LIBRARY_PATH or the rpath of the executable. I would ldd openmc or ldd libopenmc.so (wherever they are installed) and see which HDF5 library it expects to find.

[~]ameli@hactarlogin$ cd openmc/openmc/lib/
[lib]ameli@hactarlogin$ ldd libopenmc.so
    ./libopenmc.so: /opt/ohpc/pub/compiler/gcc/8.3.0/lib64/libgomp.so.1: version `GOMP_5.0' not found (required by ./libopenmc.so)
    ./libopenmc.so: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by ./libopenmc.so)
    ./libopenmc.so: /opt/ohpc/pub/compiler/gcc/8.3.0/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ./libopenmc.so)
    	linux-vdso.so.1 =>  (0x00007ffea5b98000)
    	libhdf5_serial.so.103 => not found
    	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb8b6be3000)
    	libdl.so.2 => /lib64/libdl.so.2 (0x00007fb8b69df000)
    	libhdf5_serial_hl.so.100 => not found
    	libstdc++.so.6 => /opt/ohpc/pub/compiler/gcc/8.3.0/lib64/libstdc++.so.6 (0x00007fb8b665c000)
    	libm.so.6 => /lib64/libm.so.6 (0x00007fb8b635a000)
    	libgomp.so.1 => /opt/ohpc/pub/compiler/gcc/8.3.0/lib64/libgomp.so.1 (0x00007fb8b612c000)
    	libgcc_s.so.1 => /opt/ohpc/pub/compiler/gcc/8.3.0/lib64/libgcc_s.so.1 (0x00007fb8b5f14000)
    	libc.so.6 => /lib64/libc.so.6 (0x00007fb8b5b47000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007fb8b712d000)

If I have already installed, how can be possible it does not found the libhdf5_serial.so.103, since I specifically added libhdf5-serial-dev on the list of packages to be installed?

Not sure why it wouldn’t show up. If you know where those libraries live, the easiest fix is to add the containing directory to LD_LIBRARY_PATH.

Thanks a lot @paulromano. Since the new public release, I don’t need to go for this way anymore, but I truly appreciate the time you spent to help me.

Tony

OpenMC v0.13.3 work fine in unbuntu20.04.

However, when it work in ubuntu18.04, it appears the same problem:
import openmc.lib
File “/home/user/openmc-v0.13.3/openmc/lib/init.py”, line 32, in
_dll = CDLL(_filename)
File “/usr/lib/python3.7/ctypes/init.py”, line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: libhdf5_serial.so.103: cannot open shared object file: No such file or directory

When I used ldd bin/openmc, there is no libhdf5_serial.so.103:
linux-vdso.so.1 (0x00007ffd263f1000)
libopenmc.so => /home/user/ openmc-v0.13.3/build/lib/libopenmc.so (0x00007f754c581000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f754c1f8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f754bfe0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f754bbef000)
libhdf5_serial.so.100 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100 (0x00007f754b697000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f754b478000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f754b274000)
libhdf5_serial_hl.so.100 => /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.100 (0x00007f754b051000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f754acb3000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f754aa84000)
/lib64/ld-linux-x86-64.so.2 (0x00007f754cc36000)
libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x00007f754a881000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f754a664000)
libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x00007f754a45c000)

Ubuntu 18.04 is an older version, but I’m determined to make OpenMC work on this server. I attempted to reinstall some libraries using apt , but it didn’t resolve the issue on my server. I would greatly appreciate any suggestions.