Including hdf5.h disables MPI C++ bindings

Bug #1165504 reported by Bradley M. Froehle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hdf5-sharp
New
Undecided
Unassigned
hdf5 (Ubuntu)
Confirmed
Undecided
Unassigned

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
Ubuntu.

For example, to reproduce:

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

$ 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
debian/patches/series.

There has been some discussion of this bug on the Debian bug
tracker (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686926).
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
libopenmpi-dev:
  Installed: 1.4.5-1ubuntu1
  Candidate: 1.4.5-1ubuntu1
  Version table:
 *** 1.4.5-1ubuntu1 0
        500 http://mirror.anl.gov/pub/ubuntu/ raring/universe amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libhdf5-openmpi-dev
libhdf5-openmpi-dev:
  Installed: 1.8.9-1~exp3
  Candidate: 1.8.9-1~exp3
  Version table:
 *** 1.8.9-1~exp3 0
        500 http://mirror.anl.gov/pub/ubuntu/ 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:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686926

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
report.

[1]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686926

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.