Skip to content

Commit 23f41a2

Browse files
authored
Merge pull request #3066 from jsquyres/pr/v2.0.x/hwloc-external-fix
v2.0.x: --with-hwloc=external fix
2 parents f9897f2 + 1be33d2 commit 23f41a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+149
-89
lines changed

autogen.pl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
55
# Copyright (c) 2013 Mellanox Technologies, Inc.
66
# All rights reserved.
@@ -432,11 +432,28 @@ sub mca_process_project {
432432
next
433433
if (! -d "$dir/$d" || $d eq "base" || substr($d, 0, 1) eq ".");
434434

435-
# If this directory has a $dir.h file and a base/
435+
my $framework_header = "$dir/$d/$d.h";
436+
437+
# If there's a $dir/$d/autogen.options file, read it
438+
my $ao_file = "$dir/$d/autogen.options";
439+
if (-r $ao_file) {
440+
verbose "\n>>> Found $dir/$d/autogen.options file\n";
441+
open(IN, $ao_file) ||
442+
die "$ao_file present, but cannot open it";
443+
while (<IN>) {
444+
if (m/\s*framework_header\s*=\s*(.+?)\s*$/) {
445+
verbose " Framework header entry: $1\n";
446+
$framework_header = "$dir/$d/$1";
447+
}
448+
}
449+
close(IN);
450+
}
451+
452+
# If this directory has a framework header and a base/
436453
# subdirectory, or its name is "common", then it's a
437454
# framework.
438455
if ("common" eq $d || !$project->{need_base} ||
439-
(-f "$dir/$d/$d.h" && -d "$dir/$d/base")) {
456+
(-f $framework_header && -d "$dir/$d/base")) {
440457
verbose "\n=== Found $pname / $d framework\n";
441458
mca_process_framework($topdir, $project, $d);
442459
}

opal/mca/btl/openib/btl_openib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
1515
* Copyright (c) 2006-2016 Los Alamos National Security, LLC. All rights
1616
* reserved.
@@ -80,7 +80,7 @@
8080
#ifdef HAVE_UNISTD_H
8181
#include <unistd.h>
8282
#endif
83-
#include "opal/mca/hwloc/hwloc.h"
83+
#include "opal/mca/hwloc/hwloc-internal.h"
8484

8585
#ifndef MIN
8686
#define MIN(a,b) ((a)<(b)?(a):(b))

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
1515
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
@@ -59,7 +59,7 @@
5959
know its exact path. We have to rely on the framework header files
6060
to find the right hwloc verbs helper file for us. */
6161
#define OPAL_HWLOC_WANT_VERBS_HELPER 1
62-
#include "opal/mca/hwloc/hwloc.h"
62+
#include "opal/mca/hwloc/hwloc-internal.h"
6363
#include "opal/mca/hwloc/base/base.h"
6464
#include "opal/mca/installdirs/installdirs.h"
6565
#include "opal_stdint.h"

opal/mca/btl/usnic/btl_usnic_hwloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "opal_config.h"
1111

12-
#include "opal/mca/hwloc/hwloc.h"
12+
#include "opal/mca/hwloc/hwloc-internal.h"
1313
#include "opal/constants.h"
1414

1515
#if BTL_IN_OPAL

opal/mca/hwloc/Makefile.am

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved.
2+
# Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
# Copyright (c) 2016 Research Organization for Information Science
44
# and Technology (RIST). All rights reserved.
55
# $COPYRIGHT$
@@ -9,17 +9,12 @@
99
# $HEADER$
1010
#
1111

12-
# We do not want -I$(srcdir) in AM_CPPFLAGS, or there can be a
13-
# conflict between system hwloc.h and opal/mca/hwloc/hwloc.h. So just
14-
# set only what we need to AM_CPPFLAGS.
15-
AM_CPPFLAGS = -I$(top_builddir)/opal/include
16-
1712
# main library setup
1813
noinst_LTLIBRARIES = libmca_hwloc.la
1914
libmca_hwloc_la_SOURCES =
2015

2116
# local files
22-
headers = hwloc.h
17+
headers = hwloc-internal.h
2318
libmca_hwloc_la_SOURCES += $(headers)
2419

2520
# Conditionally install the header files

opal/mca/hwloc/autogen.options

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
2+
# $COPYRIGHT$
3+
#
4+
5+
# Per https://github.com/open-mpi/ompi/issues/2616, we cannot have an
6+
# "hwloc.h" in the framework directory (due to conflicts of finding
7+
# the system hwloc.h file when using "--with-hwloc=external"). Hence,
8+
# we need to deviate from the framework norm of having
9+
# framework/framework.h (i.e., hwloc/hwloc.h). Instead, we'll have
10+
# hwloc/hwloc-internal.h to make sure that this header file can never
11+
# be mistaken for a system-level hwloc.h.
12+
13+
framework_header = hwloc-internal.h

opal/mca/hwloc/base/base.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
3-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
3+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
44
* $COPYRIGHT$
55
*
66
* Additional copyrights may follow
@@ -15,7 +15,7 @@
1515

1616
#include "opal/dss/dss_types.h"
1717

18-
#include "opal/mca/hwloc/hwloc.h"
18+
#include "opal/mca/hwloc/hwloc-internal.h"
1919

2020
/*
2121
* Global functions for MCA overall hwloc open and close
@@ -89,7 +89,7 @@ OPAL_DECLSPEC int opal_hwloc_base_set_binding_policy(opal_binding_policy_t *poli
8989

9090
/**
9191
* Loads opal_hwloc_my_cpuset (global variable in
92-
* opal/mca/hwloc/hwloc.h) for this process. opal_hwloc_my_cpuset
92+
* opal/mca/hwloc/hwloc-internal.h) for this process. opal_hwloc_my_cpuset
9393
* will be loaded with this process' binding, or, if the process is
9494
* not bound, use the hwloc root object's (available and online)
9595
* cpuset.

opal/mca/hwloc/base/hwloc_base_dt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2017 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
35
*
46
* $COPYRIGHT$
57
*
@@ -154,8 +156,14 @@ int opal_hwloc_unpack(opal_buffer_t *buffer, void *dest,
154156

155157
int opal_hwloc_copy(hwloc_topology_t *dest, hwloc_topology_t src, opal_data_type_t type)
156158
{
159+
#ifdef HAVE_HWLOC_TOPOLOGY_DUP
157160
/* use the hwloc dup function */
158161
return hwloc_topology_dup(dest, src);
162+
#else
163+
/* hwloc_topology_dup() was introduced in hwloc v1.8.0.
164+
* Note that as of March 2017, opal_hwloc_copy() is not (yet?) used in the code base anywhere. */
165+
return OPAL_ERR_NOT_SUPPORTED;
166+
#endif
159167
}
160168

161169
int opal_hwloc_compare(const hwloc_topology_t topo1,

opal/mca/hwloc/base/hwloc_base_frame.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
2-
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
3-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
3+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2016 Research Organization for Information Science
5+
* and Technology (RIST). All rights reserved.
46
* $COPYRIGHT$
57
*
68
* Additional copyrights may follow
@@ -20,7 +22,7 @@
2022
#include "opal/mca/base/base.h"
2123
#include "opal/threads/tsd.h"
2224

23-
#include "opal/mca/hwloc/hwloc.h"
25+
#include "opal/mca/hwloc/hwloc-internal.h"
2426
#include "opal/mca/hwloc/base/base.h"
2527

2628

opal/mca/hwloc/base/hwloc_base_maffinity.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
3+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
34
* $COPYRIGHT$
45
*
56
* Additional copyrights may follow
@@ -12,7 +13,7 @@
1213

1314
#include "opal/constants.h"
1415

15-
#include "opal/mca/hwloc/hwloc.h"
16+
#include "opal/mca/hwloc/hwloc-internal.h"
1617
#include "opal/mca/hwloc/base/base.h"
1718

1819

0 commit comments

Comments
 (0)