Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560964 - sci-libs/hdf5 - hdf5-1.8.9-mpicxx.patch causes macro redefinition warnings with clang-3.7
Summary: sci-libs/hdf5 - hdf5-1.8.9-mpicxx.patch causes macro redefinition warnings wi...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-21 03:51 UTC by William Throwe
Modified: 2017-06-20 12:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Throwe 2015-09-21 03:51:03 UTC
Gentoo is applying hdf5-1.8.9-mpicxx.patch:

--- a/src/H5public.h
+++ b/src/H5public.h
@@ -58,6 +58,8 @@
 #   include <stddef.h>
 #endif
 #ifdef H5_HAVE_PARALLEL
+#   define OMPI_SKIP_MPICXX   /* Make sure that cxx specific headers are not included */
+#   define MPICH_SKIP_MPICXX
 #   include <mpi.h>
 #ifndef MPI_FILE_NULL          /*MPIO may be defined in mpi.h already       */
 #   include <mpio.h>

This causes warnings if one has already defined OMPI_SKIP_MPICXX (or presumably MPICH_SKIP_MPICXX):

/home/supernova/wthrowe/gentoo/usr/include/H5public.h:61:12: warning: 'OMPI_SKIP_MPICXX' macro redefined [-Wmacro-redefined]
#   define OMPI_SKIP_MPICXX   /* Make sure that cxx specific headers are not included */
           ^
<command line>:1:9: note: previous definition is here
#define OMPI_SKIP_MPICXX 1
        ^
1 warning generated.


(Some of our source files use OpenMPI without using HDF5, so we can't just rely on the HDF5 headers to define this macro.)

The patch should only define these macros if they are not already defined.  Something like:

 #   include <stddef.h>
 #endif
 #ifdef H5_HAVE_PARALLEL
+#   ifndef OMPI_SKIP_MPICXX
+#      define OMPI_SKIP_MPICXX   /* Make sure that cxx specific headers are not included */
+#   endif
+#   ifndef MPICH_SKIP_MPICXX
+#      define MPICH_SKIP_MPICXX
+#   endif
 #   include <mpi.h>
 #ifndef MPI_FILE_NULL          /*MPIO may be defined in mpi.h already       */
 #   include <mpio.h>