Skip to content

Commit f22b7d4

Browse files
committed
hwloc/external.h: fix a clash with external HWLOC_VERSION[*]
Some macros defined by the embedded hwloc ends up in opal_config.h because hwloc configury m4 files are slurped into Open MPI. These macros are not required here, and they might conflict with an external hwloc install, so simply #undef them in hwloc/external/external.h after including <opal_config.h> but before including the external <hwloc.h>. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp> Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 352b667 commit f22b7d4

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

opal/mca/hwloc/external/external.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
3-
* Copyright (c) 2016 Research Organization for Information Science
2+
* Copyright (c) 2011-2019 Cisco Systems, Inc. All rights reserved
3+
* Copyright (c) 2016-2019 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
55
*
66
* Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
@@ -21,6 +21,23 @@
2121
BEGIN_C_DECLS
2222

2323
#include <opal_config.h>
24+
25+
/* Top-level configure will always configure the embedded hwloc
26+
* component, even if we already know that we'll be using an external
27+
* hwloc (because of complicated reasons). A side-effect of this is
28+
* that the embedded hwloc will AC_DEFINE HWLOC_VERSION (and friends)
29+
* in opal_config.h. If the external hwloc defines a different value
30+
* of HWLOC_VERSION (etc.), we'll get zillions of warnings about the
31+
* two HWLOC_VERSION values not matching. Hence, we undefined all of
32+
* them here (so that the external <hwloc.h> can define them to
33+
* whatever it wants). */
34+
35+
#undef HWLOC_VERSION
36+
#undef HWLOC_VERSION_MAJOR
37+
#undef HWLOC_VERSION_MINOR
38+
#undef HWLOC_VERSION_RELEASE
39+
#undef HWLOC_VERSION_GREEK
40+
2441
#include MCA_hwloc_external_header
2542

2643
/* If the including file requested it, also include the hwloc verbs

0 commit comments

Comments
 (0)