Bug#721202: Including hdf5.h disables MPI C++ bindings

Gilles Filippini pini at debian.org
Tue Dec 24 12:31:37 UTC 2013


Hi,

Bradley M. Froehle a écrit , Le 29/08/2013 02:24:
> Subject: Including hdf5.h disables MPI C++ bindings
> Package: libhdf5-openmpi-dev
> Version: 1.8.9-1~exp3
> Severity: normal
>
> As reported in lp:1165504 [1] and discussed in bug 686926 [2],
> including "hdf5.h" from the libhdf5-openmpi-dev package
> completely disables the MPI C++ bindings. This leads to weird
> errors and regressions.
>
> 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.
>
> The main rationale for the patch was to alleviate awkward
> workarounds when compilng C++ code:
>
>    mkoctfile -DMPICH_SKIP_MPICXX=1 -DOMPI_SKIP_MPICXX=1 helloworld.cc
>
> However, the appropriate fix would instead have been to compile
> helloworld as:
>
>    CXX=mpicxx mkoctfile helloworld.cc
>
> The mpicxx wrappers are provided for a reason, and we should
> strive to encourage our users to actually _use_ them.
>
> I hope you consider reverting the 'skip_cxx_inclusion.diff'
> from debian/patches/series.
>
> Thanks,
> Brad
>
> [1]: https://bugs.launchpad.net/ubuntu/+source/hdf5/+bug/1165504
> [2]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686926

I think this requests is valid. The workaround introduced by this patch 
is wrong, and I'd like to drop it.

As I understand it, mpic{c,xx} wrappers are just another way of doing 
pkg-config related stuff. Then, why not giving a try at pkg-config? I.e. 
adding pkg-config files to libhdf5*-dev packages, and patching mkoctfile 
to rely on pkgconfig for hdf5 flags.

What do you think?

Thanks,

_g.



More information about the Pkg-grass-devel mailing list