Skip to content

Commit d5266ab

Browse files
authored
Merge pull request #2955 from jsquyres/pr/hwloc-external-fixes
Fix --with-hwloc=external
2 parents 0006f0d + fec519a commit d5266ab

Some content is hidden

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

47 files changed

+118
-86
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
}

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* and Technology (RIST). All rights reserved.
1111
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
1212
* reserved.
13+
* Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -20,7 +21,7 @@
2021
#include "ompi_config.h"
2122

2223
#include "opal/constants.h"
23-
#include "opal/mca/hwloc/hwloc.h"
24+
#include "opal/mca/hwloc/hwloc-internal.h"
2425

2526
#include "ompi/mca/topo/treematch/topo_treematch.h"
2627
#include "ompi/mca/topo/treematch/treematch/tm_mapping.h"

ompi/mca/topo/treematch/treematch/tm_hwloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include <hwloc.h>
2-
#include <hwloc/helper.h>
1+
#include "opal/mca/hwloc/hwloc-internal.h"
32
#include "tm_tree.h"
43
#include "tm_mapping.h"
54
#include <ctype.h>

ompi/mca/topo/treematch/treematch/tm_hwloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <hwloc.h>
1+
#include "opal/mca/hwloc/hwloc-internal.h"
22
#include "tm_tree.h"
33

44
void hwloc_topology_tag(hwloc_topology_t topology);

ompi/mca/topo/treematch/treematch/tm_thread_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <pthread.h>
22
#include "tm_thread_pool.h"
33
#include "tm_verbose.h"
4-
#include <hwloc.h>
4+
#include "opal/mca/hwloc/hwloc-internal.h"
55
#include "tm_verbose.h"
66
#include "tm_tree.h"
77
#include <errno.h>

ompi/mca/topo/treematch/treematch/tm_thread_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define THREAD_POOL_H
33

44
#include <pthread.h>
5-
#include <hwloc.h>
5+
#include "opal/mca/hwloc/hwloc-internal.h"
66

77

88
typedef struct _work_t{

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.
@@ -84,7 +84,7 @@
8484
#ifdef HAVE_UNISTD_H
8585
#include <unistd.h>
8686
#endif
87-
#include "opal/mca/hwloc/hwloc.h"
87+
#include "opal/mca/hwloc/hwloc-internal.h"
8888

8989
#ifndef MIN
9090
#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/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

0 commit comments

Comments
 (0)