Installing OpenMC with DagMC using mamba: Runtime Error

I am trying to install OpenMC with DagMC and run a simulation. I have made a new conda environment with python 3.10, and used the command:

mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*"

which seemed to run fine (it didn’t give an obvious error).

The environment also has the neutronics material maker and cadquery installed using pip, but nothing else.

When I try and run my simulation, I get the error:

RuntimeError: DAGMC Universes are present but OpenMC was not configured with DAGMC

Are there additional steps for installing OpenMC with DAGMC? Should I compile from source instead of using mamba? Any help much appreciated.

Many thanks!

That looks like the binary file being executed is not the one installed with that conda command.

Perhaps you have another openmc in the PATH folders that is being found first.

You can see which openmc is being expected by default by typing

which openmc

Then with the full path of that openmc exectable typing in

/path/to/openmc --version

This should print out some info about the exectable including if it was compiled with dagmc.

I can think of 3 options in order of least hacky

You can find the exectable installed with that conda command and pass that path into the model.run command which accepts an argument called openmc_exec openmc.run — OpenMC Documentation

Or perhaps move adjust your PATH in your bashrc so that it doesn’t find the openmc that it currently finds. You could remove the folder to the compiled openmc executable or put that folder at the end of the PATH list instead of the start.

Or delete or move or rename the openmc exectable that was found with which openmc

Thanks so much @Shimwell , you were correct I had another openmc in the PATH folders. I passed the argument openmc_exec to model.run() and it worked perfectly. Thank you!