installing cross sections in ubuntu

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)

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?

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

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

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?

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 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

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

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

Thanks,
Paul

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/

Adding cross_sections.xml to the environment variables worked! It ran! Thank you

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.

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.

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

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

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

how could i can solve this ?

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