Skip to content

v3.0.x: Fix ofi configury #6370

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

Merged
merged 2 commits into from
Feb 8, 2019
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: 1 addition & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
# Copyright (c) 2013 Mellanox Technologies, Inc.
# All rights reserved.
Expand Down Expand Up @@ -107,7 +107,6 @@ libmca_orte_common_alps_so_version=40:0:0

# OPAL layer
libmca_opal_common_cuda_so_version=40:0:0
libmca_opal_common_libfabric_so_version=40:0:0
libmca_opal_common_sm_so_version=40:0:0
libmca_opal_common_ugni_so_version=40:0:0
libmca_opal_common_verbs_so_version=41:0:1
186 changes: 108 additions & 78 deletions config/opal_check_libfabric.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2015-2016 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights
dnl Copyright (c) 2015-2019 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl $COPYRIGHT$
dnl
Expand All @@ -10,86 +10,116 @@ dnl
dnl $HEADER$
dnl

dnl
dnl _OPAL_CHECK_OFI
dnl --------------------------------------------------------
dnl Do the real work of checking for OFI libfabric.
dnl Upon return:
dnl
dnl - opal_ofi_happy: will be "yes" or "no"
dnl - opal_ofi_{CPPFLAGS|LDFLAGS|LIBS} will be loaded (if relevant)
dnl
AC_DEFUN([_OPAL_CHECK_OFI],[
# Add --with options
AC_ARG_WITH([libfabric],
[AC_HELP_STRING([--with-libfabric=DIR],
[Deprecated synonym for --with-ofi])])
AC_ARG_WITH([libfabric-libdir],
[AC_HELP_STRING([--with-libfabric-libdir=DIR],
[Deprecated synonym for --with-ofi-libdir])])

# OPAL_CHECK_LIBFABRIC(prefix, [action-if-found], [action-if-not-found]
# --------------------------------------------------------
# Check if libfabric support can be found.
#
# Sets prefix_{CPPFLAGS, LDFLAGs, LIBS} as needed and runs
# action-if-found if there is support; otherwise executes
# action-if-not-found.
#
AC_DEFUN([OPAL_CHECK_LIBFABRIC],[
if test -z "$opal_check_libfabric_happy" ; then
OPAL_VAR_SCOPE_PUSH([opal_check_libfabric_$1_save_CPPFLAGS opal_check_libfabric_$1_save_LDFLAGS opal_check_libfabric_$1_save_LIBS])

# Add --with options
AC_ARG_WITH([libfabric],
[AC_HELP_STRING([--with-libfabric=DIR],
[Specify location of libfabric installation, adding DIR/include to the default search location for libfabric headers, and DIR/lib or DIR/lib64 to the default search location for libfabric libraries. Error if libfabric support cannot be found.])])
AC_ARG_WITH([libfabric-libdir],
[AC_HELP_STRING([--with-libfabric-libdir=DIR],
[Search for libfabric libraries in DIR])])

# Sanity check the --with values
OPAL_CHECK_WITHDIR([libfabric], [$with_libfabric],
[include/rdma/fabric.h])
OPAL_CHECK_WITHDIR([libfabric-libdir], [$with_libfabric_libdir],
[libfabric.*])

opal_check_libfabric_$1_save_CPPFLAGS=$CPPFLAGS
opal_check_libfabric_$1_save_LDFLAGS=$LDFLAGS
opal_check_libfabric_$1_save_LIBS=$LIBS

opal_check_libfabric_happy=yes
AS_IF([test "$with_libfabric" = "no"],
[opal_check_libfabric_happy=no])

AS_IF([test $opal_check_libfabric_happy = yes],
[AC_MSG_CHECKING([looking for libfabric in])
AS_IF([test "$with_libfabric" != "yes"],
[opal_libfabric_dir=$with_libfabric
AC_MSG_RESULT([($opal_libfabric_dir)])],
[AC_MSG_RESULT([(default search paths)])])
AS_IF([test ! -z "$with_libfabric_libdir" && \
test "$with_libfabric_libdir" != "yes"],
[opal_libfabric_libdir=$with_libfabric_libdir])
])

AS_IF([test $opal_check_libfabric_happy = yes],
[OPAL_CHECK_PACKAGE([opal_check_libfabric],
[rdma/fabric.h],
[fabric],
[fi_getinfo],
[],
[$opal_libfabric_dir],
[$opal_libfabric_libdir],
[],
[opal_check_libfabric_happy=no])])

CPPFLAGS=$opal_check_libfabric_$1_save_CPPFLAGS
LDFLAGS=$opal_check_libfabric_$1_save_LDFLAGS
LIBS=$opal_check_libfabric_$1_save_LIBS

OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics Libfabric]],[$1],[$opal_check_libfabric_happy])

OPAL_VAR_SCOPE_POP
fi
AC_ARG_WITH([ofi],
[AC_HELP_STRING([--with-ofi=DIR],
[Specify location of OFI libfabric installation, adding DIR/include to the default search location for libfabric headers, and DIR/lib or DIR/lib64 to the default search location for libfabric libraries. Error if libfabric support cannot be found.])])

AC_ARG_WITH([ofi-libdir],
[AC_HELP_STRING([--with-ofi-libdir=DIR],
[Search for OFI libfabric libraries in DIR])])

if test $opal_check_libfabric_happy = yes ; then
$1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_libfabric_CPPFLAGS"
$1_LIBS="[$]$1_LIBS $opal_check_libfabric_LIBS"
$1_LDFLAGS="[$]$1_LDFLAGS $opal_check_libfabric_LDFLAGS"
if test "$with_ofi" = ""; then
with_ofi=$with_libfabric
fi

AC_SUBST($1_CPPFLAGS)
AC_SUBST($1_LDFLAGS)
AC_SUBST($1_LIBS)
if test "$with_ofi_libdir" = ""; then
with_ofi_libdir=$with_libfabric_libdir
fi

AS_IF([test $opal_check_libfabric_happy = yes],
[$2],
[AS_IF([test -n "$with_libfabric" && test "$with_libfabric" != "no"],
[AC_MSG_WARN([libfabric support requested (via --with-libfabric), but not found.])
# Sanity check the --with values
OPAL_CHECK_WITHDIR([ofi], [$with_ofi],
[include/rdma/fabric.h])
OPAL_CHECK_WITHDIR([ofi-libdir], [$with_ofi_libdir],
[libfabric.*])

OPAL_VAR_SCOPE_PUSH([opal_check_ofi_save_CPPFLAGS opal_check_ofi_save_LDFLAGS opal_check_ofi_save_LIBS])
opal_check_ofi_save_CPPFLAGS=$CPPFLAGS
opal_check_ofi_save_LDFLAGS=$LDFLAGS
opal_check_ofi_save_LIBS=$LIBS

opal_ofi_happy=yes
AS_IF([test "$with_ofi" = "no"],
[opal_ofi_happy=no])

AS_IF([test $opal_ofi_happy = yes],
[AC_MSG_CHECKING([looking for OFI libfabric in])
AS_IF([test "$with_ofi" != "yes"],
[opal_ofi_dir=$with_ofi
AC_MSG_RESULT([($opal_ofi_dir)])],
[AC_MSG_RESULT([(default search paths)])])
AS_IF([test ! -z "$with_ofi_libdir" && \
test "$with_ofi_libdir" != "yes"],
[opal_ofi_libdir=$with_ofi_libdir])
])

AS_IF([test $opal_ofi_happy = yes],
[OPAL_CHECK_PACKAGE([opal_ofi],
[rdma/fabric.h],
[fabric],
[fi_getinfo],
[],
[$opal_ofi_dir],
[$opal_ofi_libdir],
[],
[opal_ofi_happy=no])])

CPPFLAGS=$opal_check_ofi_save_CPPFLAGS
LDFLAGS=$opal_check_ofi_save_LDFLAGS
LIBS=$opal_check_ofi_save_LIBS

AC_SUBST([opal_ofi_CPPFLAGS])
AC_SUBST([opal_ofi_LDFLAGS])
AC_SUBST([opal_ofi_LIBS])

OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics OFI Libfabric]],[],[$opal_ofi_happy])

OPAL_VAR_SCOPE_POP

AS_IF([test $opal_ofi_happy = no],
[AS_IF([test -n "$with_ofi" && test "$with_ofi" != "no"],
[AC_MSG_WARN([OFI libfabric support requested (via --with-ofi or --with-libfabric), but not found.])
AC_MSG_ERROR([Cannot continue.])])
$3])
])
])dnl


dnl
dnl OPAL_CHECK_OFI
dnl --------------------------------------------------------
dnl Check to see if OFI libfabric is available.
dnl
dnl This is a simple wrapper around _OPAL_CHECK_OFI that just
dnl ensures to only run the checks once. We do not use AC_REQUIRE
dnl because that re-orders the texts and makes ordering in stdout
dnl quite confusing / difficult to grok.
dnl
AC_DEFUN([OPAL_CHECK_OFI],[
# Check for OFI libfabric. Note that $opal_ofi_happy is used in
# other configure.m4's to know if OFI/libfabric configured
# successfully. We only need to run the back-end checks once, but
# at least emit a "checking..." statement each subsequent time
# this macro is invoked so that configure's stdout has
# sensible/logical output.
AS_IF([test -z "$opal_ofi_happy"],
[_OPAL_CHECK_OFI],
[AC_MSG_CHECKING([if OFI libfabric is available])
AC_MSG_RESULT([$opal_ofi_happy])])
])
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2006-2011 Los Alamos National Security, LLC. All rights
# reserved.
Expand Down Expand Up @@ -152,7 +152,6 @@ AC_SUBST(libopen_pal_so_version)
# transparently by adding some intelligence in autogen.pl
# and/or opal_mca.m4, but I don't have the cycles to do this
# right now.
AC_SUBST(libmca_opal_common_libfabric_so_version)
AC_SUBST(libmca_opal_common_cuda_so_version)
AC_SUBST(libmca_opal_common_sm_so_version)
AC_SUBST(libmca_opal_common_ugni_so_version)
Expand Down
17 changes: 10 additions & 7 deletions ompi/mca/mtl/ofi/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
#
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2017 IBM Corporation. All rights reserved.
# Copyright (c) 2019 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -12,7 +16,7 @@

EXTRA_DIST = post_configure.sh

AM_CPPFLAGS = $(ompi_mtl_ofi_CPPFLAGS) $(opal_common_libfabric_CPPFLAGS)
AM_CPPFLAGS = $(opal_ofi_CPPFLAGS)

dist_ompidata_DATA = help-mtl-ofi.txt

Expand Down Expand Up @@ -42,15 +46,14 @@ mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_mtl_ofi_la_SOURCES = $(mtl_ofi_sources)
mca_mtl_ofi_la_LDFLAGS = \
$(ompi_mtl_ofi_LDFLAGS) \
$(opal_ofi_LDFLAGS) \
-module -avoid-version
mca_mtl_ofi_la_LIBADD = $(top_builddir)/ompi/lib@[email protected] \
$(ompi_mtl_ofi_LIBS) \
$(OPAL_TOP_BUILDDIR)/opal/mca/common/libfabric/lib@OPAL_LIB_PREFIX@mca_common_libfabric.la
$(opal_ofi_LIBS)

noinst_LTLIBRARIES = $(component_noinst)
libmca_mtl_ofi_la_SOURCES = $(mtl_ofi_sources)
libmca_mtl_ofi_la_LDFLAGS = \
$(ompi_mtl_ofi_LDFLAGS) \
$(opal_ofi_LDFLAGS) \
-module -avoid-version
libmca_mtl_ofi_la_LIBADD = $(ompi_mtl_ofi_LIBS)
libmca_mtl_ofi_la_LIBADD = $(opal_ofi_LIBS)
10 changes: 6 additions & 4 deletions ompi/mca/mtl/ofi/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved
#
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -23,10 +25,10 @@ AC_DEFUN([MCA_ompi_mtl_ofi_POST_CONFIG], [
AC_DEFUN([MCA_ompi_mtl_ofi_CONFIG],[
AC_CONFIG_FILES([ompi/mca/mtl/ofi/Makefile])

# ensure we already ran the common libfabric config
AC_REQUIRE([MCA_opal_common_libfabric_CONFIG])
# Check for OFI
OPAL_CHECK_OFI

AS_IF([test "$opal_common_libfabric_happy" = "yes"],
AS_IF([test "$opal_ofi_happy" = "yes"],
[$1],
[$2])
])dnl
13 changes: 9 additions & 4 deletions opal/mca/btl/usnic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# All rights reserved.
# Copyright (c) 2006 Sandia National Laboratories. All rights
# reserved.
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
# $COPYRIGHT$
Expand All @@ -21,7 +21,7 @@
# $HEADER$
#

AM_CPPFLAGS = -DBTL_IN_OPAL=1 $(opal_common_libfabric_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\"
AM_CPPFLAGS = -DBTL_IN_OPAL=1 $(opal_ofi_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\"

EXTRA_DIST = README.txt README.test

Expand Down Expand Up @@ -89,13 +89,18 @@ mcacomponent_LTLIBRARIES = $(component)
mca_btl_usnic_la_SOURCES = $(component_sources)
mca_btl_usnic_la_LDFLAGS = \
$(opal_btl_usnic_LDFLAGS) \
$(opal_ofi_LDFLAGS) \
-module -avoid-version
mca_btl_usnic_la_LIBADD = $(top_builddir)/opal/lib@[email protected] \
$(OPAL_TOP_BUILDDIR)/opal/mca/common/libfabric/lib@OPAL_LIB_PREFIX@mca_common_libfabric.la
$(opal_ofi_LIBS)

noinst_LTLIBRARIES = $(lib)
libmca_btl_usnic_la_SOURCES = $(lib_sources)
libmca_btl_usnic_la_LDFLAGS = -module -avoid-version $(opal_btl_usnic_LDFLAGS)
libmca_btl_usnic_la_LDFLAGS = \
$(opal_btl_usnic_LDFLAGS) \
$(opal_ofi_LDFLAGS) \
-module -avoid-version
libmca_btl_usnic_la_LIBADD = $(opal_ofi_LIBS)

if OPAL_BTL_USNIC_BUILD_UNIT_TESTS
usnic_btl_run_tests_CPPFLAGS = \
Expand Down
18 changes: 8 additions & 10 deletions opal/mca/btl/usnic/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# All rights reserved.
# Copyright (c) 2006 Sandia National Laboratories. All rights
# reserved.
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010-2019 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -93,21 +95,17 @@ AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
AC_MSG_RESULT([$opal_btl_usnic_happy])
])

# The usnic BTL requires libfabric support.
AS_IF([test "$opal_btl_usnic_happy" = "yes"],
[AC_MSG_CHECKING([whether libfabric support is available])
AS_IF([test "$opal_common_libfabric_happy" = "yes"],
[opal_btl_usnic_happy=yes],
[opal_btl_usnic_happy=no])
AC_MSG_RESULT([$opal_btl_usnic_happy])
])
[ # The usnic BTL requires OFI libfabric support
OPAL_CHECK_OFI
opal_btl_usnic_happy=$opal_ofi_happy])

# The usnic BTL requires at least libfabric v1.1 (there was a
# critical bug in libfabric v1.0).
AS_IF([test "$opal_btl_usnic_happy" = "yes"],
[AC_MSG_CHECKING([whether libfabric is >= v1.1])
opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS
CPPFLAGS="$opal_common_libfabric_CPPFLAGS $CPPFLAGS"
CPPFLAGS="$opal_ofi_CPPFLAGS $CPPFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rdma/fabric.h>]],
[[
#if !defined(FI_MAJOR_VERSION)
Expand All @@ -125,7 +123,7 @@ AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
# Make sure we can find the libfabric usnic extensions header
AS_IF([test "$opal_btl_usnic_happy" = "yes" ],
[opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS
CPPFLAGS="$opal_common_libfabric_CPPFLAGS $CPPFLAGS"
CPPFLAGS="$opal_ofi_CPPFLAGS $CPPFLAGS"
AC_CHECK_HEADER([rdma/fi_ext_usnic.h],
[],
[opal_btl_usnic_happy=no])
Expand Down
Loading