These are the command I have run to receive the error in the subject:
What should I do?
git clone https://github.com/mit-crpg/openmc.git
cd openmc
git checkout -b master origin/master
mkdir build && cd build
#!/bin/bash
export FC=gfortran-4.9
wget ftp://ftp.hdfgroup.org/HDF5/current/src/hdf5-*.tar.gz
tar -xzvf hdf5-*.tar.gz
cd hdf5-*; ./configure --prefix=/opt/hdf5 --enable-fortran --enable-fortran2003
make
sudo make install
The error message listed in the subject of your message is a cmake error message. How are you running cmake?
Well I am no longer receive that error message but I cannot seem to generate the openmc command. I am attaching a text file of what I did in terminal. Hopefully it can help diagnose the problem
Im not quite sure I know what I am doing
Terminal Saved Output (138 KB)
Based on the output, it looks like you installed HDF5, but you haven’t built/installed OpenMC itself. You still need to run something like:
cd ~/openmc/build
cmake -DCMAKE_INSTALL_PREFIX=/opt/openmc …
make
make install
then you’ll need to make /opt/openmc/bin (or whatever installation location you choose) available on your PATH environment in order for the ‘openmc’ command to be available.
For further details, please see:
http://openmc.readthedocs.io/en/latest/usersguide/install.html#compiling-on-linux-and-mac-os-x
Best regards,
Paul
It seems that maybe HDF5 isn’t installed in the correct location? I receive the same error message that sparked this post. What should I try now?
Thank you so much for your help by the way
Terminal Saved Output (1.2 KB)
Set the HDF5_ROOT environment variable to the root directory of your HDF5 installation, e.g.
export HDF5_ROOT=/opt/hdf5/
cmake -DCMAKE_INSTALL_PREFIX=/opt/openmc …
Alternatively, you can just set the environment variable on a per-command basis:
HDF5_ROOT=/opt/hdf5/ cmake -DCMAKE_INSTALL_PREFIX=/opt/openmc …
Hope this helps!
More details here: http://openmc.readthedocs.io/en/latest/usersguide/install.html#selecting-hdf5-installation
Im so close I think! While I could try to figure it out based on the suggestions, I would prefer to know what you suggest and how I should proceed. I am attaching the terminal output. Thanks again!
Openmc (126 KB)
I ran this and made no progress as Ive decided to try to “add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.)”:
cd
open .bash_profile
Then added this line and saved the file:
export PYTHONPATH=“$PYTHONPATH:/opt/openmc”
And ran the rest:
source .bash_profile
cd ~/openmc/build
make
sudo make install
You may have been able to guess that this has to do with installation of OpenMC’s Python API. In your case, it looks like you’re using anaconda. I’d highly suggest just ignoring that error message, going to the root openmc directory (which has a file called setup.py), and then running ‘python setup.py install’. This will install the openmc Python package within your anaconda installation.
Best,
Paul
This also means that I cannot run OpenMC directly from a directory though I am guessing? Now that I check, it still doesn’t recognize openmc as a command so that answers my question. Does this just mean I have to run openmc from within python?
You’ve been more helpful than all resources I’ve used combined
The openmc executable that is created acts just like any other – in order to run it from an arbitrary directory, the directory containing ‘openmc’ needs to be on your PATH environment variable or you need to explicitly qualify the full path to the openmc executable. If you just run ‘openmc’ and it says command not found, that means the appropriate directory is not on your PATH. Typically, you would modify the PATH environment variable your .profile / .bash_profile / .bashrc file (assuming you are using bash), e.g. by adding the line
export PATH="/opt/openmc/bin:$PATH"
Best regards,
Paul