OpenMC quits using universe.plot

Hi,

I’m new to OpenMC and I’m trying to follow the first example - Modelling a Pincell.

When I get to the universe.plot(width=(2.0, 2.0), origin=(0.0, 0.0, 0.1)) function, OpenMC crashes with the following error.


RuntimeError Traceback (most recent call last)
Cell In[29], line 1
----> 1 universe.plot(width=(2.0, 2.0), origin=(0.0, 0.0, 0.1))

ile ~/openmc/openmc/executor.py:125, in _run(args, output, cwd) 122 error_msg = ‘OpenMC aborted unexpectedly.’ 123 error_msg = ’ '.join(error_msg.split()) → 125 raise RuntimeError(error_msg)

RuntimeError: OpenMC aborted unexpectedly.

I’m on Mac Ventura 13.4 and I’ve tried installing OpenMC through Condaforge and building from source. I’ve used Juypter notebook to run the code and also tried running through VSCode - the same error occurs every time. I’ve also rebuilt OpenMC with the debug flag on, but no more information on the error is provided.

Any help would be greatly appreciated.

1 Like

I’m facing the same issue. Please let me know if you find a solution to this problem. It’ll be much appreciated.

I believe this related to having a version of libpng that’s differing between what it got compiled with and what it is linking to at runtime.

Can you post the output of openmc -v?


Here’s the version I am currently using

Can you run the plotting from the command line and see if there’s any more helpful output?

If you want to try a different approach, keep reading.

The latest documentation shows how to build openmc for mac without conda. I think conda is pretty clunky, personally. Not only because of errors like this that I’ve seen before but also how incredibly slow it can be to “solve the environment”. It’s much faster to just use a pip venv.

https://docs.openmc.org/en/latest/quickinstall.html#obtaining-prerequisites-on-macos