Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 560964

Summary: sci-libs/hdf5 - hdf5-1.8.9-mpicxx.patch causes macro redefinition warnings with clang-3.7
Product: Gentoo Linux Reporter: William Throwe <wtt6>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: UNCONFIRMED ---    
Severity: normal CC: jstein, sci
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=420777
Whiteboard:
Package list:
Runtime testing required: ---

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>
Comment 1 Jonas Stein gentoo-dev 2021-09-01 18:21:23 UTC
This patch was introduced with bug 420777.