Dolfinx build issue: Found serial HDF5 build, MPI HDF5 build required

Dear all,
I am totally new to Fenics and I am having troubles with the installation. I am on OS Sonoma 14.1, and I am trying to install Dolfinx . I followed the build procedure for C++ shown here:

cd dolfinx-main/cpp; mkdir build; cd build; cmake ..

and I get the following output error:

CMake Error at CMakeLists.txt:334 (message):
  Found serial HDF5 build, MPI HDF5 build required, try setting HDF5_DIR or

I installed hdf5 1.14 by downloading the .tar.gz, then

./configure --enable-parallel --enable-shared
sudo make install

If I remove --enable-parallel , --enable-shared or both, I get the same error.

Do you know how to fix this ?
Thank you !

You may want to

to the directory where

installed your custom version of hdf5. To be extra safe, delete the build folder before running cmake again.

1 Like

Hello, I don’t understand, where should I set HDF5_DIR ? In .bash_profile or .zprofile ?

Try with export HDF5_ROOT=/path/to/hdf5 in your current terminal, no need to modify profile files, delete build and run cmake again.

You may use tools like ccmake in your build directory to double check whether this setting makes any difference.

I am not sure what is the right folder to set to /path/to/hdf5. It may be /Applications/hdf5-1.14.3/hdf5/ or /Applications/hdf5-1.14.3/hdf5/bin/? Here is what is inside these folders:

% ls /Applications/hdf5-1.14.3/hdf5/bin h5cc h5debug h5dump h5import h5mkgrp h5perf_serial h5repart h5unjam h5clear h5delete h5format_convert h5jam h5pcc h5redeploy h5stat h5watch h5copy h5diff h5ls h5perf h5repack h5tools_test_utils ph5diff

% ls /Applications/hdf5-1.14.3/hdf5/ bin include lib share

Anyway, I removed the build folder, then did

export HDF5_ROOT=/Applications/hdf5-1.14.3/hdf5/bin; mkdir build; cd build; cmake ..
but I still get the same error message. I also get the same error message if I replace /Applications/hdf5-1.14.3/hdf5/bin with /Applications/hdf5-1.14.3/hdf5/

It’s definitely the one without bin. Double check with ccmake that it the one actually being used while building dolfinx.

I used the one without bin, here is the output given by ccmake :

$ccmake .. 

                                                    Page 1 of 1
 BUILD_SHARED_LIBS                ON                                                                                                                              
 Basix_DIR                        /usr/local/lib/cmake/basix                                                                                                      
 Boost_INCLUDE_DIR                /opt/homebrew/include                                                                                                           
 Boost_TIMER_LIBRARY_RELEASE      /opt/homebrew/lib/libboost_timer-mt.dylib                                                                                       
 CMAKE_BUILD_TYPE                 RelWithDebInfo                                                                                                                  
 CMAKE_INSTALL_PREFIX             /usr/local                                                                                                                      
 CMAKE_INSTALL_RPATH_USE_LINK_P   ON                                                                                                                              
 CMAKE_OSX_DEPLOYMENT_TARGET      14.1                                                                                                                            
 CMAKE_OSX_SYSROOT                /Applications/                              
 DOLFINX_ENABLE_ADIOS2            ON                                                                                                                              
 DOLFINX_ENABLE_KAHIP             OFF                                                                                                                             
 DOLFINX_ENABLE_PARMETIS          ON                                                                                                                              
 DOLFINX_ENABLE_SCOTCH            ON                                                                                                                              
 DOLFINX_ENABLE_SLEPC             ON                                                                                                                              
 DOLFINX_SKIP_BUILD_TESTS         OFF                                                                                                                             
 DOLFINX_UFCX_PYTHON              ON                                                                                                                              
 GIT_FOUND                        /opt/homebrew/bin/git                                                                                                           
 HDF5_C_LIBRARY_dl                /Applications/            
 HDF5_C_LIBRARY_hdf5              /Applications/hdf5-1.14.3/hdf5/lib/libhdf5.dylib                                                                                
 HDF5_C_LIBRARY_m                 /Applications/             
 HDF5_C_LIBRARY_z                 /Applications/             
 _REQUIRE_ADIOS2                  OFF                                                                                                                             
 _REQUIRE_KAHIP                   OFF                                                                                                                             
 _REQUIRE_PARMETIS                OFF                                                                                                                             
 _REQUIRE_SCOTCH                  OFF                                                                                                                             
 _REQUIRE_SLEPC                   OFF                                                                                                                             
 _UFCX_HEADER                     _UFCX_HEADER-NOTFOUND                                                                                                           
 pugixml_DIR                      /opt/homebrew/lib/cmake/pugixml

I don’t see any HDF5_ROOT though, I don’t understand …

This is the relevant line

which seems to confirm that hdf5 was taken from the path you provided.

However, are you sure that it is actually the path were you installed your custom hdf5 version? I am no mac user, but it seems odd that

basix and dolfinx would get installed in /usr/local when you build them manually, which would make me think that also your custom hdf5 installation was installed in /usr/local

The output of sudo make install in the hdf5 installation directory is

+ /usr/bin/install -c ./ex_table_12.c /Applications/hdf5-1.14.3/hdf5/share/hdf5_examples/hl/c/.
+ /usr/bin/install -c ./ex_ds1.c /Applications/hdf5-1.14.3/hdf5/share/hdf5_examples/hl/c/.
+ /usr/bin/install -c ./image24pixel.txt /Applications/hdf5-1.14.3/hdf5/share/hdf5_examples/hl/c/.

so I guess that my custom installation of hdf5 was installed in /Applications/hdf5-1.14.3/hdf5/.

Now if I do export HDF5_ROOT=/Applications/hdf5-1.14.3/hdf5/ and

  • install hdft with ./configure; make; make install,
  • run cmake .. in /Applications/dolfinx-main/cpp/build
  • I get the error message of the original post.

However, if I

  • install hdf5 with ./configure --enable-parallel --enable-shared; make; make install
  • run cmake .. in /Applications/dolfinx-main/cpp/build
  • I get another error message Could NOT find UFCx (missing: UFCX_INCLUDE_DIRS UFCX_SIGNATURE UFCX_VERSION) (Required is at least version "0.7"). Let alone the new error message, this means that adding the flags to configure fixed the issue with hdf5?


It means that now hdf5 is ok, the ufcx error is unrelated, and I will look into that in the other post you opened.

Great, Thank you!