Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwloc v2.1.0: use a git submodule #6821

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "hwloc-20x"]
path = opal/mca/hwloc/hwloc2/hwloc
url = https://github.com/open-mpi/hwloc.git
50 changes: 49 additions & 1 deletion autogen.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2009-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
Expand Down Expand Up @@ -1231,6 +1231,54 @@ sub in_tarball {

#---------------------------------------------------------------------------

++$step;
verbose "\n$step. Checking for git submodules\n\n";

# Make sure we got a submodule-full clone. If not, abort and let a
# human figure it out.
if (-f ".gitmodules") {
open(IN, "git submodule status|")
|| die "Can't run \"git submodule status\"";
while (<IN>) {
chomp;
$_ =~ m/^(.)(.{40}) ([^ ]+) *\(*([^\(\)]*)\)*$/;
my $status = $1;
my $local_hash = $2;
my $path = $3;
my $extra = $4;

print("=== Submodule: $path\n");

# Make sure the submodule is there
if ($status eq "-") {
print(" ==> ERROR: Missing

The submodule \"$path\" is missing.

Perhaps you forgot to \"git clone --recursive ...\", or you need to
\"git submodule update --init --recursive\"...?\n\n");
exit(1);
}

# See if the submodule is at the expected git hash
# (it may be ok if it's not -- just warn the user)
$extra =~ m/-g(.+)/;
my $remote_hash = $1;
if ($remote_hash) {
my $abbrev_local_hash = substr($local_hash, 0, length($remote_hash));
if ($remote_hash ne $abbrev_local_hash) {
print(" ==> WARNING: Submodule hash is different than upstream.
If this is not intentional, you may want to run:
\"git submodule update --init --recursive\"\n");
} else {
print(" Local hash == remote hash (good!)\n");
}
}
}
}

#---------------------------------------------------------------------------

# Save the platform file in the m4
$m4 .= "dnl Platform file\n";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011-2018 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011-2019 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
Expand All @@ -19,29 +19,19 @@ DISTCLEANFILES = \
hwloc/include/hwloc/autogen/stamp-h? \
hwloc/include/private/autogen/stamp-h?

# Need to include these files so that these directories are carried in
# the tarball (in case someone invokes autogen.sh on a dist tarball).
EXTRA_DIST = \
hwloc/doc/README.txt \
hwloc/contrib/systemd/README.txt \
hwloc/tests/README.txt \
hwloc/utils/README.txt \
hwloc/netloc/README.txt \
hwloc/contrib/misc/README.txt

SUBDIRS = hwloc

# Headers and sources
headers = hwloc201.h
sources = hwloc201_component.c
headers = hwloc2.h
sources = hwloc2_component.c

# We only ever build this component statically
noinst_LTLIBRARIES = libmca_hwloc_hwloc201.la
libmca_hwloc_hwloc201_la_SOURCES = $(headers) $(sources)
nodist_libmca_hwloc_hwloc201_la_SOURCES = $(nodist_headers)
libmca_hwloc_hwloc201_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc201_LDFLAGS)
libmca_hwloc_hwloc201_la_LIBADD = $(opal_hwloc_hwloc201_LIBS)
libmca_hwloc_hwloc201_la_DEPENDENCIES = \
noinst_LTLIBRARIES = libmca_hwloc_hwloc2.la
libmca_hwloc_hwloc2_la_SOURCES = $(headers) $(sources)
nodist_libmca_hwloc_hwloc2_la_SOURCES = $(nodist_headers)
libmca_hwloc_hwloc2_la_LDFLAGS = -module -avoid-version $(opal_hwloc_hwloc2_LDFLAGS)
libmca_hwloc_hwloc2_la_LIBADD = $(opal_hwloc_hwloc2_LIBS)
libmca_hwloc_hwloc2_la_DEPENDENCIES = \
$(HWLOC_top_builddir)/hwloc/libhwloc_embedded.la

# Since the rest of the code base includes the underlying hwloc.h, we
Expand Down
1 change: 1 addition & 0 deletions opal/mca/hwloc/hwloc2/README-ompi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cherry-picked commits after 2.1.0:
1 change: 1 addition & 0 deletions opal/mca/hwloc/hwloc2/autogen.subdirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hwloc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2009-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2018 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
Expand All @@ -17,43 +17,43 @@
#
# Priority
#
AC_DEFUN([MCA_opal_hwloc_hwloc201_PRIORITY], [80])
AC_DEFUN([MCA_opal_hwloc_hwloc2_PRIORITY], [80])

#
# Force this component to compile in static-only mode
#
AC_DEFUN([MCA_opal_hwloc_hwloc201_COMPILE_MODE], [
AC_DEFUN([MCA_opal_hwloc_hwloc2_COMPILE_MODE], [
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
$4="static"
AC_MSG_RESULT([$$4])
])

# Include hwloc m4 files
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_pkg.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_attributes.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_visibility.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_check_vendor.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_components.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/hwloc_internal.m4)
m4_include(opal/mca/hwloc/hwloc201/hwloc/config/netloc.m4)

# MCA_hwloc_hwloc201_POST_CONFIG()
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_pkg.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_check_attributes.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_check_visibility.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_check_vendor.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_components.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/hwloc_internal.m4)
m4_include(opal/mca/hwloc/hwloc2/hwloc/config/netloc.m4)

# MCA_hwloc_hwloc2_POST_CONFIG()
# ---------------------------------
AC_DEFUN([MCA_opal_hwloc_hwloc201_POST_CONFIG],[
OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc201_basedir])
AC_DEFUN([MCA_opal_hwloc_hwloc2_POST_CONFIG],[
OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc2_basedir])

# If we won, then do all the rest of the setup
AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc201_support" = "yes"],
AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc2_support" = "yes"],
[
# Set this variable so that the framework m4 knows what
# file to include in opal/mca/hwloc/hwloc-internal.h
opal_hwloc_hwloc201_basedir=opal/mca/hwloc/hwloc201
opal_hwloc_base_include="$opal_hwloc_hwloc201_basedir/hwloc201.h"
opal_hwloc_hwloc2_basedir=opal/mca/hwloc/hwloc2
opal_hwloc_base_include="$opal_hwloc_hwloc2_basedir/hwloc2.h"

# Add some stuff to CPPFLAGS so that the rest of the source
# tree can be built
file=$opal_hwloc_hwloc201_basedir/hwloc
file=$opal_hwloc_hwloc2_basedir/hwloc
CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS"
AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"],
[CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"])
Expand All @@ -66,12 +66,12 @@ AC_DEFUN([MCA_opal_hwloc_hwloc201_POST_CONFIG],[
])dnl


# MCA_hwloc_hwloc201_CONFIG([action-if-found], [action-if-not-found])
# MCA_hwloc_hwloc2_CONFIG([action-if-found], [action-if-not-found])
# --------------------------------------------------------------------
AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[
AC_CONFIG_FILES([opal/mca/hwloc/hwloc201/Makefile])
AC_DEFUN([MCA_opal_hwloc_hwloc2_CONFIG],[
AC_CONFIG_FILES([opal/mca/hwloc/hwloc2/Makefile])

OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc201_save_CPPFLAGS opal_hwloc_hwloc201_save_LDFLAGS opal_hwloc_hwloc201_save_LIBS opal_hwloc_hwloc201_save_cairo opal_hwloc_hwloc201_save_xml opal_hwloc_hwloc201_save_mode opal_hwloc_hwloc201_basedir opal_hwloc_hwloc201_file opal_hwloc_hwloc201_save_cflags CPPFLAGS_save LIBS_save opal_hwloc_external])
OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc2_save_CPPFLAGS opal_hwloc_hwloc2_save_LDFLAGS opal_hwloc_hwloc2_save_LIBS opal_hwloc_hwloc2_save_cairo opal_hwloc_hwloc2_save_xml opal_hwloc_hwloc2_save_mode opal_hwloc_hwloc2_basedir opal_hwloc_hwloc2_file opal_hwloc_hwloc2_save_cflags CPPFLAGS_save LIBS_save opal_hwloc_external])

# We know that the external hwloc component will be configured
# before this one because of its priority. This component is only
Expand All @@ -85,20 +85,20 @@ AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[
AC_MSG_NOTICE([hwloc:external failed, so this component will be used])])

# default to this component not providing support
opal_hwloc_hwloc201_basedir=opal/mca/hwloc/hwloc201
opal_hwloc_hwloc201_support=no
opal_hwloc_hwloc2_basedir=opal/mca/hwloc/hwloc2
opal_hwloc_hwloc2_support=no

opal_hwloc_hwloc201_save_CPPFLAGS=$CPPFLAGS
opal_hwloc_hwloc201_save_LDFLAGS=$LDFLAGS
opal_hwloc_hwloc201_save_LIBS=$LIBS
opal_hwloc_hwloc2_save_CPPFLAGS=$CPPFLAGS
opal_hwloc_hwloc2_save_LDFLAGS=$LDFLAGS
opal_hwloc_hwloc2_save_LIBS=$LIBS

# save XML or graphical options
opal_hwloc_hwloc201_save_cairo=$enable_cairo
opal_hwloc_hwloc201_save_xml=$enable_xml
opal_hwloc_hwloc201_save_static=$enable_static
opal_hwloc_hwloc201_save_shared=$enable_shared
opal_hwloc_hwloc201_save_plugins=$enable_plugins
opal_hwloc_hwloc201_save_mode=$hwloc_mode
opal_hwloc_hwloc2_save_cairo=$enable_cairo
opal_hwloc_hwloc2_save_xml=$enable_xml
opal_hwloc_hwloc2_save_static=$enable_static
opal_hwloc_hwloc2_save_shared=$enable_shared
opal_hwloc_hwloc2_save_plugins=$enable_plugins
opal_hwloc_hwloc2_save_mode=$hwloc_mode

# never enable hwloc's graphical option
enable_cairo=no
Expand Down Expand Up @@ -129,28 +129,28 @@ AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[

# hwloc checks for compiler visibility, and its needs to do
# this without "picky" flags.
opal_hwloc_hwloc201_save_cflags=$CFLAGS
opal_hwloc_hwloc2_save_cflags=$CFLAGS
CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY
AS_IF([test -n "$opal_datatype_cuda_CPPFLAGS"],
[CPPFLAGS="$CPPFLAGS $opal_datatype_cuda_CPPFLAGS"])

# Only set the symbol prefix if this component is being used
# (i.e., if the external component is not being used).
AS_IF([test "$opal_hwloc_external_support" = "no"],
[HWLOC_SET_SYMBOL_PREFIX([opal_hwloc201_])])
[HWLOC_SET_SYMBOL_PREFIX([opal_hwloc2_])])

# Do the bulk of the hwloc core setup
HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc201/hwloc],
HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc2/hwloc],
[AC_MSG_CHECKING([whether hwloc configure succeeded])
AC_MSG_RESULT([yes])
HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc201_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc201_basedir/hwloc/VERSION`"
HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc2_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc2_basedir/hwloc/VERSION`"

# Build flags for our Makefile.am
opal_hwloc_hwloc201_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)'
opal_hwloc_hwloc201_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc201_basedir"'/hwloc/hwloc/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)'
opal_hwloc_hwloc201_support=yes
opal_hwloc_hwloc2_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)'
opal_hwloc_hwloc2_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc2_basedir"'/hwloc/hwloc/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)'
opal_hwloc_hwloc2_support=yes

AC_DEFINE_UNQUOTED([HWLOC_HWLOC201_HWLOC_VERSION],
AC_DEFINE_UNQUOTED([HWLOC_HWLOC2_HWLOC_VERSION],
["$HWLOC_VERSION"],
[Version of hwloc])

Expand All @@ -163,35 +163,35 @@ AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[
],
[AC_MSG_CHECKING([whether hwloc configure succeeded])
AC_MSG_RESULT([no])
opal_hwloc_hwloc201_support=no])
CFLAGS=$opal_hwloc_hwloc201_save_cflags
opal_hwloc_hwloc2_support=no])
CFLAGS=$opal_hwloc_hwloc2_save_cflags

# Restore some env variables, if necessary
AS_IF([test -n "$opal_hwloc_hwloc201_save_cairo"],
[enable_cairo=$opal_hwloc_hwloc201_save_cairo])
AS_IF([test -n "$opal_hwloc_hwloc201_save_xml"],
[enable_xml=$opal_hwloc_hwloc201_save_xml])
AS_IF([test -n "$opal_hwloc_hwloc201_save_static"],
[enable_static=$opal_hwloc_hwloc201_save_static])
AS_IF([test -n "$opal_hwloc_hwloc201_save_shared"],
[enable_shared=$opal_hwloc_hwloc201_save_shared])
AS_IF([test -n "$opal_hwloc_hwloc201_save_plugins"],
[enable_plugins=$opal_hwloc_hwloc201_save_shared])

CPPFLAGS=$opal_hwloc_hwloc201_save_CPPFLAGS
LDFLAGS=$opal_hwloc_hwloc201_save_LDFLAGS
LIBS=$opal_hwloc_hwloc201_save_LIBS

AC_SUBST([opal_hwloc_hwloc201_CFLAGS])
AC_SUBST([opal_hwloc_hwloc201_CPPFLAGS])
AC_SUBST([opal_hwloc_hwloc201_LDFLAGS])
AC_SUBST([opal_hwloc_hwloc201_LIBS])
AS_IF([test -n "$opal_hwloc_hwloc2_save_cairo"],
[enable_cairo=$opal_hwloc_hwloc2_save_cairo])
AS_IF([test -n "$opal_hwloc_hwloc2_save_xml"],
[enable_xml=$opal_hwloc_hwloc2_save_xml])
AS_IF([test -n "$opal_hwloc_hwloc2_save_static"],
[enable_static=$opal_hwloc_hwloc2_save_static])
AS_IF([test -n "$opal_hwloc_hwloc2_save_shared"],
[enable_shared=$opal_hwloc_hwloc2_save_shared])
AS_IF([test -n "$opal_hwloc_hwloc2_save_plugins"],
[enable_plugins=$opal_hwloc_hwloc2_save_shared])

CPPFLAGS=$opal_hwloc_hwloc2_save_CPPFLAGS
LDFLAGS=$opal_hwloc_hwloc2_save_LDFLAGS
LIBS=$opal_hwloc_hwloc2_save_LIBS

AC_SUBST([opal_hwloc_hwloc2_CFLAGS])
AC_SUBST([opal_hwloc_hwloc2_CPPFLAGS])
AC_SUBST([opal_hwloc_hwloc2_LDFLAGS])
AC_SUBST([opal_hwloc_hwloc2_LIBS])

# Finally, add some flags to the wrapper compiler so that our
# headers can be found.
hwloc_hwloc201_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS"
hwloc_hwloc201_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS"
hwloc_hwloc201_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc201_basedir/hwloc/include"
hwloc_hwloc2_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS"
hwloc_hwloc2_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS"
hwloc_hwloc2_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc2_basedir/hwloc/include"

# If we are not building the internal hwloc, then indicate that
# this component should not be built. NOTE: we still did all the
Expand All @@ -201,12 +201,12 @@ AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[
# distclean" infrastructure to work properly).
AS_IF([test "$opal_hwloc_external_support" = "yes"],
[AC_MSG_NOTICE([using an external hwloc; disqualifying this component])
opal_hwloc_hwloc201_support=no],
opal_hwloc_hwloc2_support=no],
[AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1])
AC_DEFINE([HAVE_HWLOC_TOPOLOGY_DUP], [1])])

# Done!
AS_IF([test "$opal_hwloc_hwloc201_support" = "yes"],
AS_IF([test "$opal_hwloc_hwloc2_support" = "yes"],
[$1],
[$2])

Expand Down
1 change: 1 addition & 0 deletions opal/mca/hwloc/hwloc2/hwloc
Submodule hwloc added at f1a2e2
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2011-2019 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
* reserved.
Expand All @@ -24,20 +24,20 @@
#include "opal/constants.h"

#include "opal/mca/hwloc/hwloc-internal.h"
#include "hwloc201.h"
#include "hwloc2.h"

/*
* Public string showing the sysinfo ompi_linux component version number
*/
const char *opal_hwloc_hwloc201_component_version_string =
"OPAL hwloc201 hwloc MCA component version " OPAL_VERSION;
const char *opal_hwloc_hwloc2_component_version_string =
"OPAL hwloc2 hwloc MCA component version " OPAL_VERSION;

/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/

const opal_hwloc_component_t mca_hwloc_hwloc201_component = {
const opal_hwloc_component_t mca_hwloc_hwloc2_component = {

/* First, the mca_component_t struct containing meta information
about the component itself */
Expand All @@ -46,7 +46,7 @@ const opal_hwloc_component_t mca_hwloc_hwloc201_component = {
OPAL_HWLOC_BASE_VERSION_2_0_0,

/* Component name and version */
.mca_component_name = "hwloc201",
.mca_component_name = "hwloc2",
MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION),
},
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion opal/mca/hwloc/hwloc201/README-ompi.txt

This file was deleted.

Loading