# installing cross sections in ubuntu

**URL:** <https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242>\
**Category:** User Support\
**Created:** [November 2, 2016, 7:58am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242 "2016-11-02T07:58:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 2, 2016, 7:58am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/1 "2016-11-02T07:58:13Z")

</div>

I’ve installed openMC using PPA in ubuntu per the instructions in the documentation, and it appears to be working. However, I can’t run any input files because I get the error “No cross\_sections.xml file was specified in settings.xml or in the CROSS\_SECTIONS environment variable”. Doesn’t apt-get install the nndc cross-section data also?

If not, I assume I still need to execute the following (per the instructions in section 2.3 of the documentation)

```auto
cd openmc/data
python get_nndc_data.py

But I have no idea where the files/directories are installed. 

Or am I missing something else altogether?

```

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 2, 2016, 2:47pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/2 "2016-11-02T14:47:34Z")

</div>

Hi Lucas,

This was an oversight on our part – the get\_nndc\_data.py script is not included in the PPA unfortunately (although this will be fixed for the next version). You can download a .zip or .tar.gz from here:

[https://github.com/mit-crpg/openmc/releases/tag/v0.8.0](https://github.com/mit-crpg/openmc/releases/tag/v0.8.0)

Once you extract the files, go to the data directory and run the get\_nndc\_data.py script and it should proceed normally. If you continue having issues, let us know.

Best regards,  
Paul

---

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 6, 2016, 5:37am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/3 "2016-11-06T05:37:25Z")

</div>

That seems to have worked, but after setting the environment variable CROSS\_SECTIONS, I still get the ‘no cross\_sections.xml…’ error. Instead, I have to set the OPENMC\_CROSS\_SECTIONS environment variable every time I open a terminal. Then I get the following error when trying to run a set of input files:

Reading settings XML file…  
Reading cross sections XML file…  
PARSE\_ERR  
81 runParser  
0  
STOP 1

Am I still missing something?

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 7, 2016, 7:44pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/4 "2016-11-07T19:44:16Z")

</div>

If you are using bash shell, you will need to set the environment variables in your .bash\_profile, .profile, or .bashrc configuration file for them to apply to every session. Here’s a [primer on environment variables](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps) if you are not very familiar.

The error you are seeing results from having a malformed XML input file. Without seeing your input file, I couldn’t tell you where your error is—only that you have one. Are you using the Python API to create XML input files or are you writing them directly?

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 9, 2016, 2:44am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/5 "2016-11-09T02:44:38Z")

</div>

I know the input files are good. My classmates have successfully run them. I also get the same error when I try to run any of the examples  
included with openMC

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 9, 2016, 12:20pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/6 "2016-11-09T12:20:19Z")

</div>

Lucas- would you mind sharing your cross\_sections.xml file so we can help diagnose what may be going on?

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 9, 2016, 12:26pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/7 "2016-11-09T12:26:08Z")

</div>

One potential mistake that would result in what you are seeing – you need to set the OPENMC\_CROSS\_SECTIONS environment variable to the cross\_sections.xml file itself, not just the directory, as in:

OPENMC\_CROSS\_SECTIONS=/home/user/openmc\_data/cross\_sections.xml

and not

OPENMC\_CROSS\_SECTIONS=/home/user/openmc\_data/

---

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 9, 2016, 11:10pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/8 "2016-11-09T23:10:54Z")

</div>

Adding cross\_sections.xml to the environment variables worked! It ran! Thank you

---

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 16, 2016, 8:28am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/9 "2016-11-16T08:28:27Z")

</div>

new problem: Python does not see the openMC API. So, I can’t write any python scripts to build input files, or use any of the Jupyter notebooks. Anaconda and Python all work perfectly fine

I’d really prefer not to write all my inputs manually as xml files.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 16, 2016, 12:40pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/10 "2016-11-16T12:40:53Z")

</div>

If you are using the PPA to install OpenMC, you would normally need to use the python interpreter installed from the Ubuntu repositories, not the conda-installed python. You can test this by running /usr/bin/python and then trying to ‘import openmc’. You can try using the conda-installed python and adding /usr/lib/python2.7/dist-packages to your PYTHONPATH environment variable, but this may cause other issues.

---

<div class="post-metadata">

**Author:** ![Lucas\_Beveridge](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@Lucas\_Beveridge](https://openmc.discourse.group/u/Lucas_Beveridge)\
**Post date:** [November 17, 2016, 8:28am UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/11 "2016-11-17T08:28:48Z")

</div>

when trying to execute ‘import openmc’ I get an error saying there’s no such module installed. I also tried setting PYTHONPATH to the conda installed python, and got even more errors

---

<div class="post-metadata">

**Author:** ![Ahmed\_K\_Madani](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Ahmed\_K\_Madani](https://openmc.discourse.group/u/Ahmed_K_Madani)\
**Post date:** [February 22, 2017, 11:11pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/12 "2017-02-22T23:11:19Z")

</div>

i added cross\_sections.xml in setting.xml file and it start running but it gave me an error

[![](https://global.discourse-cdn.com/free1/uploads/openmc/original/1X/3f2c5e52f48ea3fd1bc485a60d225e9b61209a4c.png)](https://lh3.googleusercontent.com/-26qJjot_E24/WK4ZZvNA-8I/AAAAAAAAANc/S5CD-_Z3hBEbyeYJo20o21BTpLGajDX-QCLcB/s1600/error.png)

it said ACE Library /opt/mcnp/data/endf70j does not exist

how could i can solve this ?

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [February 22, 2017, 11:32pm UTC](https://openmc.discourse.group/t/installing-cross-sections-in-ubuntu/242/13 "2017-02-22T23:32:40Z")

</div>

In order to run your version of OpenMC, you need to have ACE cross section files. The cross\_sections.xml tells OpenMC where to look for these ACE files, but they have to be present on your system. For more information, see here:

[http://openmc.readthedocs.io/en/stable/usersguide/install.html#cross-section-configuration](http://openmc.readthedocs.io/en/stable/usersguide/install.html#cross-section-configuration)
