Error with HDF5 when installing into Anaconda environment from source

Hi there,

I am trying to install the new time-filter branch into an anaconda environment however during the make process I obtain many errors relating to HDF5 and the HDF5 interface, including an error that states that the HDF5 C compiler wrapper is unable to compile a minimal HDF5 program. Could someone please advise?

Many thanks :slight_smile:
hdf5_errors

Maybe if you paste your CMakeCache file we could figure out what’s up. The compiler errors alone just say that it’s not #including the right HDF5 headers.

BTW, where is this time filters branch?

CMakeCache copy.py (26.7 KB)

Hi @gridley,

Please find attached the CMakeCache file (had to change it to a .py to upload it). The time filters branch can be found at GitHub - paulromano/openmc at time-filter

Thank you!

This line explains your problem:

//The directory containing a CMake configuration file for HDF5.
HDF5_DIR:PATH=HDF5_DIR-NOTFOUND

So, since your issue is not related to linking but is related to declarations of the HDF5 functions missing, can you check if this directory includes HDF5 stuff?

/opt/anaconda3/envs/openmc-time-filter/include

The CMakeCache says that’s where it is #including HDF5 files from.

In addition to the CMakeCache, the initial output from when you ran CMake should have reported an error with not finding all the HDF5 stuff it needs. If you could copy and paste that, that would be great. If we’re failing to detect HDF5 being properly installed, that’s something we should consider fixing.

BTW, you may need to delete the CMakeCache file to get the initial output from CMake to look like it did the first time around.

That directory seems to include hdf5 stuff (see attached).

So it seems that the initial cmake output is indicating that there are issues with HDF5 (unable to compile a minimal HDF5 program). Does this help?

Yes, you’ll certainly have to resolve this issue with not being able to compile a minimal HDF5 program before compiling OpenMC. But that is obvious.

This may help you out:

IMO it’s better to just not use conda if you don’t have a need to install multiple versions of stuff to the same system, although that is not a commonly held sentiment. If you’re on macbook, I would brew install hdf5 and the other dependencies.

If this continues to give you trouble, you may want to consider installing OpenMC using docker.

Hi @gridley ,

Thank you for linking that post! Setting HDF5_ROOT=/usr fixed the HDF5 issues. I now have an issue with linking libraries. Could you perhaps advise here too please?

Thank you so much for your help! :slight_smile:

From what I can find this is an error with Xcode but I have no idea how to approach it I’m afraid.

@bakingbad From the CMakeCache.txt file that you shared, it looks like it’s finding pugixml in /usr/local/lib/cmake/pugixml, indicating that you have a preexisting installation of pugixml. For whatever reason, the information it’s finding in the pugixml cmake configuration from that installation doesn’t seem to be working with OpenMC. I would recommend forcing OpenMC to use the included version of pugixml with the following change:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb078fd44..430ef425d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,6 @@ if(fmt_FOUND)
 else()
   message(STATUS "Did not find fmt, will use submodule instead")
 endif()
-find_package(pugixml QUIET NO_SYSTEM_ENVIRONMENT_PATH)
 if(pugixml_FOUND)
   message(STATUS "Found pugixml: ${pugixml_DIR}")
 else()

Hi @paulromano

This solved it, thank you so much!