Including hdf5.h disables MPI C++ bindings

Bug #1165504 reported by Bradley M. Froehle
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hdf5 (Ubuntu)

Bug Description

In Ubuntu Raring, including "hdf5.h" from the libhdf5-openmpi-dev
package completely disables the MPI C++ bindings. This leads to
weird errors and regressions compared to previous versions of

For example, to reproduce:

$ cat test.cpp
#include <hdf5.h> // disables MPI C++ bindings
#include <mpi.h>
int main() {
  printf("I'm %d of %d\n", MPI::COMM_WORLD.Get_rank(),

$ mpicxx -o test test.cpp
test.cpp: In function ‘int main()’:
test.cpp:4:3: error: ‘MPI’ has not been declared
test.cpp:5:28: error: ‘MPI’ has not been declared
test.cpp:5:56: error: ‘MPI’ has not been declared
test.cpp:6:3: error: ‘MPI’ has not been declared

The fix for this bug is to remove 'skip_cxx_inclusion.diff' from

There has been some discussion of this bug on the Debian bug
tracker (
However there hasn't been much action since the package is in
experimental. With the release of Raring nearing, I suggest
that we remove this patch from Ubuntu.

$ apt-cache policy libopenmpi-dev
  Installed: 1.4.5-1ubuntu1
  Candidate: 1.4.5-1ubuntu1
  Version table:
 *** 1.4.5-1ubuntu1 0
        500 raring/universe amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libhdf5-openmpi-dev
  Installed: 1.8.9-1~exp3
  Candidate: 1.8.9-1~exp3
  Version table:
 *** 1.8.9-1~exp3 0
        500 raring/universe amd64 Packages
        100 /var/lib/dpkg/status

Tags: patch
Changed in hdf5 (Debian):
status: Unknown → Fix Released
no longer affects: hdf5 (Debian)
Revision history for this message
Bradley M. Froehle (brad-froehle) wrote :

Patch attached.

tags: added: patch
Rajiv Shah (rajivshah3)
Changed in hdf5 (Ubuntu):
status: New → Confirmed
Revision history for this message
Sylvestre Ledru (sylvestre) wrote :

Applying this patch would bring back this bug:

Revision history for this message
Bradley M. Froehle (brad-froehle) wrote :

Yes, however I'm not convinced that the bug you cite [1] is even
a bug. To me, I would describe it as "expected behavior".

If you use or link to libraries which use MPI, you should use the
mpicc / mpicxx / mpif90 wrappers as your compilers. Failing to
do so is going to cause you grief, as evidenced in that bug


To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.