# OpenMC aborts unexpectedly when trying to use plot functions

**URL:** <https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862>\
**Category:** User Support\
**Created:** [January 24, 2024, 7:49pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862 "2024-01-24T19:49:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cclaro](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@cclaro](https://openmc.discourse.group/u/cclaro)\
**Post date:** [January 24, 2024, 7:49pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/1 "2024-01-24T19:49:01Z")

</div>

deleted and redownloaded openMC using the quick install guide through conda. Code compiles fine but aborts when plotting. Here is the file.  
[matt\_test.py](https://openmc.discourse.group/uploads/short-url/fdF17A4ZupqwRKW4UfgxXdyjaCO.py) (4.0 KB)

this is the error i receive:

Traceback (most recent call last):  
File “/Users/christianandresclaro/code/matt\_test”, line 99, in   
plot = hex\_universe.plot(pixels=(600, 600), color\_by=‘material’, colors={fuel\_kernel: ‘black’, coolant: ‘yellow’})  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/Users/christianandresclaro/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/universe.py”, line 446, in plot  
model.plot\_geometry(False, cwd=tmpdir, openmc\_exec=openmc\_exec)  
File “/Users/christianandresclaro/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/model/model.py”, line 828, in plot\_geometry  
openmc.plot\_geometry(output=output, openmc\_exec=openmc\_exec)  
File “/Users/christianandresclaro/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py”, line 154, in plot\_geometry  
\_run(args, output, cwd)  
File “/Users/christianandresclaro/miniconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py”, line 125, in \_run  
raise RuntimeError(error\_msg)  
RuntimeError: OpenMC aborted unexpectedly.

---

<div class="post-metadata">

**Author:** ![cclaro](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@cclaro](https://openmc.discourse.group/u/cclaro)\
**Post date:** [January 24, 2024, 8:04pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/2 "2024-01-24T20:04:16Z")

</div>

when i run the openmc command in the terminal i get this:  
| The OpenMC Monte Carlo Code  
Copyright | 2011-2023 MIT, UChicago Argonne LLC, and contributors  
License | [License Agreement — OpenMC Documentation](https://docs.openmc.org/en/latest/license.html)  
Version | 0.14.0  
Date/Time | 2024-01-24 15:02:27  
OpenMP Threads | 16

Reading settings XML file…  
Reading materials XML file…  
Reading geometry XML file…  
Preparing distributed cell instances…  
Reading plot XML file…

=======================\> PLOTTING SUMMARY \<========================

Plot ID: 1  
Plot file: plot\_1.png  
Universe depth: -1  
Plot Type: Slice  
Origin: 0 0 0  
Width: 1.26 1.26  
Coloring: Cells  
Basis: XY  
Pixels: 250 250

Processing plot 1: plot\_1.png…  
libpng warning: Application built with libpng-1.4.12 but running with 1.6.39  
zsh: segmentation fault openmc

---

<div class="post-metadata">

**Author:** ![cclaro](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@cclaro](https://openmc.discourse.group/u/cclaro)\
**Post date:** [January 26, 2024, 6:37pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/3 "2024-01-26T18:37:25Z")

</div>

so i was able to get through with a source install but im running into a new issue:  
Traceback (most recent call last):  
File “/Users/christianandresclaro/code/matt\_test”, line 100, in   
hex\_universe.plot(pixels=(600, 600), color\_by=‘material’, colors={fuel\_kernel: ‘black’, coolant: ‘yellow’})  
File “/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/universe.py”, line 446, in plot  
model.plot\_geometry(False, cwd=tmpdir, openmc\_exec=openmc\_exec)  
File “/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/model/model.py”, line 823, in plot\_geometry  
if self.is\_initialized:  
File “/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/model/model.py”, line 160, in is\_initialized  
import openmc.lib  
File “/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/lib/ **init**.py”, line 32, in   
\_dll = CDLL(\_filename)  
File “/Users/christianandresclaro/miniconda3/lib/python3.10/ctypes/ **init**.py”, line 374, in **init**  
self.\_handle = \_dlopen(self.\_name, mode)  
OSError: dlopen(/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/lib/libopenmc.dylib, 0x0006): tried: ‘/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/lib/libopenmc.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/lib/libopenmc.dylib’ (no such file), ‘/Users/christianandresclaro/miniconda3/lib/python3.10/site-packages/openmc/lib/libopenmc.dylib’ (no such file)

---

<div class="post-metadata">

**Author:** ![cclaro](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@cclaro](https://openmc.discourse.group/u/cclaro)\
**Post date:** [January 28, 2024, 5:07am UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/4 "2024-01-28T05:07:24Z")

</div>

update: had to track down the libopenmc.dylib and move it to the correct file directory. install is now successful.

---

<div class="post-metadata">

**Author:** ![ema619](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@ema619](https://openmc.discourse.group/u/ema619)\
**Post date:** [May 24, 2024, 11:05pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/5 "2024-05-24T23:05:56Z")

</div>

Hi, I have the same segmentation fault due to libpng version’s mismatch, could you please tell me how you solved it ?

---

<div class="post-metadata">

**Author:** ![cclaro](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@cclaro](https://openmc.discourse.group/u/cclaro)\
**Post date:** [May 24, 2024, 11:23pm UTC](https://openmc.discourse.group/t/openmc-aborts-unexpectedly-when-trying-to-use-plot-functions/3862/6 "2024-05-24T23:23:03Z")

</div>

I went through a source install. For some reason it just wasn’t storing the file in the correct directory. I searched for the file on my computer and just moved it to the directory that it wanted. Solved the issue.
