Skip to content
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
13 changes: 4 additions & 9 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Copyright (c) 2006-2022 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
# Copyright (c) 2017-2021 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2017-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
# All Rights reserved.
# Copyright (c) 2020 IBM Corporation. All rights reserved.
# $COPYRIGHT$
Expand All @@ -22,6 +22,9 @@
# $HEADER$
#

# There is an assumption in config/Makefile.am that config is the first
# subdirectory in the DIST_SUBDIRS list. If that changes, work may
# be required.
SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_SUBDIRS) test docs
DIST_SUBDIRS = config contrib 3rd-party $(MCA_PROJECT_DIST_SUBDIRS) test docs
EXTRA_DIST = README.md VERSION Doxyfile LICENSE autogen.pl AUTHORS
Expand All @@ -34,14 +37,6 @@ dist-hook:
echo "AUTHORS file is empty; aborting distribution"; \
exit 1; \
fi
@if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \
echo "#########################################################################"; \
echo "#"; \
echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \
echo "#"; \
echo "#########################################################################"; \
exit 1; \
fi

# Check for common symbols. Use a "-hook" to increase the odds that a
# developer will see it at the end of their installation process.
Expand Down
14 changes: 14 additions & 0 deletions config/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# This is a weird place for this, but config/ is the first directory that
# is entered, and the dist-hook runs at the end of the current directory,
# so this is the earliest we can run this test.
dist-hook:
@if test -n "$(OPAL_MAKEDIST_DISABLE)" ; then \
echo "#########################################################################"; \
echo "#"; \
echo "# make dist is disabled due to the following packages: $(OPAL_MAKEDIST_DISABLE)"; \
echo "#"; \
echo "#########################################################################"; \
exit 1; \
fi

EXTRA_DIST = \
distscript.sh \
opal_get_version.m4sh \
Expand Down
11 changes: 10 additions & 1 deletion config/opal_check_ofi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,16 @@ AC_DEFUN([OPAL_CHECK_OFI],[
AC_CHECK_DECLS([PMIX_PACKAGE_RANK],
[],
[],
[#include <pmix.h>])])
[#include <pmix.h>])

AC_CHECK_MEMBER([struct fi_mr_attr.iface],
[opal_check_fi_mr_attr_iface=1],
[opal_check_fi_mr_attr_iface=0],
[[#include <rdma/fi_domain.h>]])

AC_DEFINE_UNQUOTED([OPAL_OFI_HAVE_FI_MR_IFACE],
[${opal_check_fi_mr_attr_iface}],
[check if iface avaiable in fi_mr_attr])])

CPPFLAGS=${opal_check_ofi_save_CPPFLAGS}
LDFLAGS=${opal_check_ofi_save_LDFLAGS}
Expand Down
65 changes: 63 additions & 2 deletions config/opal_functions.m4
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,69 @@ dnl #######################################################################
dnl #######################################################################
dnl #######################################################################

m4_copy([OAC_VAR_SCOPE_PUSH], [OPAL_VAR_SCOPE_PUSH])
m4_copy([OAC_VAR_SCOPE_POP], [OPAL_VAR_SCOPE_POP])
AC_DEFUN([OPAL_VAR_SCOPE_INIT],
[opal_var_scope_push()
{
opal_var_scope_push_lineno=$[]1
shift
# First, check to see if any of these variables are already set.
# This is a simple sanity check to ensure we're not already
# overwriting pre-existing variables (that have a non-empty
# value). It's not a perfect check, but at least it's something.
for opal_var_scope_tmp_var in $[]@; do
AS_VAR_SET_IF([$opal_var_scope_tmp_var],
[AS_VAR_COPY([opal_var_scope_tmp_var_val], [$opal_var_scope_tmp_var])
AC_MSG_WARN([Found configure shell variable clash at line $opal_var_scope_push_lineno!])
AC_MSG_WARN([[OPAL_VAR_SCOPE_PUSH] called on "$opal_var_scope_tmp_var",])
AC_MSG_WARN([but it is already defined with value "$opal_var_scope_tmp_var_val"])
AC_MSG_WARN([This usually indicates an error in configure.])
AC_MSG_ERROR([Cannot continue])])
done
AS_UNSET([opal_var_scope_push_lineno])
AS_UNSET([opal_var_scope_tmp_var])
AS_UNSET([opal_var_scope_tmp_var_val])
}

opal_var_scope_pop()
{
# Iterate over all the variables and unset them all
for opal_var_scope_tmp_var in $[]@; do
AS_UNSET([$opal_var_scope_tmp_var])
done
AS_UNSET([opal_var_scope_tmp_var])
}])

# OPAL_VAR_SCOPE_PUSH(vars list)
# ------------------------------
# Scope-check that the vars in the space-separated vars list are not already
# in use. Generate a configure-time error if a conflict is found. Note that
# the in use check is defined as "defined", so even if a var in vars list is
# set outside of OPAL_VAR_SCOPE_PUSH, the check will still trip.
AC_DEFUN([OPAL_VAR_SCOPE_PUSH],[
AC_REQUIRE([OPAL_VAR_SCOPE_INIT])dnl
m4_pushdef([opal_var_scope_stack], [$1])dnl
m4_foreach_w([opal_var_scope_var], [$1],
[m4_set_add([opal_var_scope_active_set], opal_var_scope_var,
[], [m4_fatal([OPAL_VAR_SCOPE_PUSH found the variable ]opal_var_scope_var[
active in a previous scope.])])])dnl
opal_var_scope_push ${LINENO} $1
])dnl

# OPAL_VAR_SCOPE_POP()
# --------------------
# Unset the last set of variables set in OPAL_VAR_SCOPE_POP. Every call to
# OPAL_VAR_SCOPE_PUSH should have a matched call to this macro.
AC_DEFUN([OPAL_VAR_SCOPE_POP],[
AC_REQUIRE([OPAL_VAR_SCOPE_INIT])dnl
m4_ifdef([opal_var_scope_stack], [],
[m4_fatal([OPAL_VAR_SCOPE_POP was called without a defined
variable stack. This usually means that OPAL_VAR_SCOPE_POP was called more
times than OPAL_VAR_SCOPE_PUSH.])])dnl
m4_foreach_w([opal_var_scope_var], opal_var_scope_stack,
[m4_set_remove([opal_var_scope_active_set], opal_var_scope_var)])dnl
opal_var_scope_pop opal_var_scope_stack
m4_popdef([opal_var_scope_stack])dnl
])dnl

dnl #######################################################################
dnl #######################################################################
Expand Down
120 changes: 16 additions & 104 deletions config/opal_mca.m4
Original file line number Diff line number Diff line change
Expand Up @@ -455,18 +455,6 @@ AC_DEFUN([MCA_CONFIGURE_FRAMEWORK],[
[AS_IF([test $components_last_result -eq 1], [best_mca_component_priority=]OPAL_EVAL_ARG([MCA_$1_$2_]mca_component[_PRIORITY]))])
])])

# configure components that provide their own configure script.
# It would be really hard to run these for "find first that
# works", so we don't :)
m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST], [],
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [STOP_AT_FIRST_PRIORITY], [],
[m4_if(OPAL_EVAL_ARG([MCA_$1_]$2[_CONFIGURE_MODE]), [PRIORITY], [],
[MCA_CHECK_IGNORED_PRIORITY($1, $2)
AS_IF([test "$3" != "0"],
[MCA_CONFIGURE_ALL_CONFIG_COMPONENTS($1, $2, [all_components],
[static_components], [dso_components],
[static_ltlibs])])])])])

AS_VAR_SET_IF([OPAL_EVAL_ARG([DIRECT_$2])], [
AC_MSG_CHECKING([if direct-selection component exists for $2 framework])
direct_component_happy=no
Expand Down Expand Up @@ -640,74 +628,6 @@ AC_DEFUN([MCA_CONFIGURE_M4_CONFIG_COMPONENT],[
unset compile_mode
])


######################################################################
#
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS
#
# configure all components in the given framework that have configure
# scripts and should be configured according to the usual rules...
#
# USAGE:
# MCA_CONFIGURE_ALL_CONFIG_COMPONENTS(project_name,
# framework_name,
# all_components_variable,
# static_components_variable,
# dso_components_variable,
# static_ltlibs_variable)
#
######################################################################
AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
for component_path in $srcdir/$1/mca/$2/* ; do
component="`basename $component_path`"
if test -d $component_path && test -x $component_path/configure ; then
opal_show_subsubsubtitle "MCA component $2:$component (need to configure)"

opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: before, should_build=$8"
MCA_COMPONENT_BUILD_CHECK($1, $2, $component,
[should_build=1], [should_build=0])
MCA_COMPONENT_COMPILE_MODE($1, $2, $component, compile_mode)
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after, should_build=$should_build"

if test "$should_build" = "1" ; then
OPAL_CONFIG_SUBDIR([$1/mca/$2/$component],
[$opal_subdir_args],
[should_build=1], [should_build=0])
opal_show_verbose "OPAL_MCA_ALL_CONFIG_COMPONENTS: after subdir, should_build=$should_build"
fi

if test "$should_build" = "1" ; then
# do some extra work to pass flags back from the
# top-level configure, the way a configure.m4
# component would.
infile="$srcdir/$1/mca/$2/$3/post_configure.sh"
if test -f $infile; then

# First check for the ABORT tag
line="`$GREP ABORT= $infile | cut -d= -f2-`"
if test -n "$line" && test "$line" != "no"; then
AC_MSG_WARN([MCA component configure script told me to abort])
AC_MSG_ERROR([cannot continue])
fi

m4_foreach(flags, [LDFLAGS, LIBS],
[[line="`$GREP WRAPPER_EXTRA_]flags[= $infile | cut -d= -f2-`"]
eval "line=$line"
if test -n "$line"; then
$2[_]$3[_WRAPPER_EXTRA_]flags[="$line"]
fi
])dnl
fi

MCA_PROCESS_COMPONENT($1, $2, $component, $3, $4, $5, $6, $compile_mode)
else
MCA_PROCESS_DEAD_COMPONENT($1, $2, $component)
fi
fi
done
])


# MCA_COMPONENT_COMPILE_MODE(project_name (1), framework_name (2),
# component_name (3), compile_mode_variable (4))
# -------------------------------------------------------------------------
Expand All @@ -716,17 +636,15 @@ AC_DEFUN([MCA_CONFIGURE_ALL_CONFIG_COMPONENTS],[
# the cached value for subsequent tests. The string is not stored in a cache
# variable (ie .*_cv_.*) because cache variables would not be invalidated
# based on changes to --enable-mca-dso or --enable-mca-static.
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
OAC_ASSERT_LITERAL([$1], [1])dnl
OAC_ASSERT_LITERAL([$2], [2])dnl
OAC_ASSERT_LITERAL([$3], [3])dnl

AS_VAR_PUSHDEF([compile_mode_cv], [$1_$2_$3_compile_mode])dnl
AS_VAR_SET_IF([compile_mode_cv],
[],
[AS_LITERAL_IF([$3],
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
[m4_ifdef([MCA_$1_$2_$3_COMPILE_MODE],
[dnl We introduced caching of this check after setting the compile
dnl mode by the substitute macro was common, and there was not a
dnl polymorphic variable assumption in all those macros, so we use
Expand All @@ -735,8 +653,7 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE],[
MCA_$1_$2_$3_COMPILE_MODE([$1], [$2], [$3], [component_compile_mode_tmp])
AS_VAR_COPY([compile_mode_cv], [$component_compile_mode_tmp])
OPAL_VAR_SCOPE_POP],
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])],
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
[MCA_COMPONENT_COMPILE_MODE_INTERNAL([$1], [$2], [$3], [compile_mode_cv])])])
AS_VAR_COPY([$4], [compile_mode_cv])
AS_VAR_POPDEF([compile_mode_cv])dnl
])
Expand All @@ -758,10 +675,10 @@ AC_DEFUN([MCA_COMPONENT_COMPILE_MODE_INTERNAL], [
OPAL_VAR_SCOPE_PUSH([compile_mode_internal_tmp SHARED_FRAMEWORK SHARED_COMPONENT STATIC_FRAMEWORK STATIC_COMPONENT])

SHARED_FRAMEWORK="$DSO_$2"
AS_VAR_COPY([SHARED_COMPONENT], [DSO_$2_$3])
SHARED_COMPONENT="$DSO_$2_$3"

STATIC_FRAMEWORK="$STATIC_$2"
AS_VAR_COPY([STATIC_COMPONENT], [STATIC_$2_$3])
STATIC_COMPONENT="$STATIC_$2_$3"

# Look for the most specific specifier between static/dso. If
# there is a tie (either neither or both specified), prefer
Expand Down Expand Up @@ -819,8 +736,6 @@ AC_DEFUN([OPAL_MCA_STRIP_LAFILES], [
#---------------------------------------------------------------------
# Final setup work for a given component. It should be known before
# calling that this component can build properly (and exists)
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_PROCESS_COMPONENT],[
AC_REQUIRE([AC_PROG_GREP])

Expand Down Expand Up @@ -893,13 +808,13 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
# wishes all LDFLAGS and LIBS to be provided as wrapper flags.
AS_IF([test "$8" = "static"],
[AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LDFLAGS],
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LDFLAGS])],
[AS_VAR_COPY([tmp_flags], [$2_$3_LDFLAGS])])
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LDFLAGS}],
[tmp_flags=${$2_$3_LDFLAGS}])
OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_ldflags], [$tmp_flags])

AS_VAR_SET_IF([$2_$3_WRAPPER_EXTRA_LIBS],
[AS_VAR_COPY([tmp_flags], [$2_$3_WRAPPER_EXTRA_LIBS])],
[AS_VAR_COPY([tmp_all_flags], [$2_$3_LIBS])
[tmp_flags=${$2_$3_WRAPPER_EXTRA_LIBS}],
[tmp_all_flags=${$2_$3_LIBS}
OPAL_MCA_STRIP_LAFILES([tmp_flags], [$tmp_all_flags])])
OPAL_FLAGS_APPEND_MOVE([mca_wrapper_extra_libs], [$tmp_flags])])

Expand All @@ -910,13 +825,12 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
# Since a configure script component can never be used in a
# STOP_AT_FIRST framework, we don't have to implement the else
# clause in the literal check.
AS_LITERAL_IF([$3],
[AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
[AS_IF([test "$with_devel_headers" = "yes"],
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])])
AS_IF([test "$$2_$3_WRAPPER_EXTRA_CPPFLAGS" != ""],
[m4_if(OPAL_EVAL_ARG([MCA_$1_$2_CONFIGURE_MODE]), [STOP_AT_FIRST], [stop_at_first=1], [stop_at_first=0])
AS_IF([test "$8" = "static" && test "$stop_at_first" = "1"],
[AS_IF([test "$with_devel_headers" = "yes"],
[OPAL_FLAGS_APPEND_UNIQ([mca_wrapper_extra_cppflags], [$$2_$3_WRAPPER_EXTRA_CPPFLAGS])])],
[AC_MSG_WARN([ignoring $2_$3_WRAPPER_EXTRA_CPPFLAGS ($$2_$3_WRAPPER_EXTRA_CPPFLAGS): component conditions not met])])])
])


Expand All @@ -926,8 +840,6 @@ AC_MSG_ERROR([*** $2 component $3 was supposed to be direct-called, but
# Final setup work for a component that can not be built. Do the
# last minute checks to make sure the user isn't doing something
# stupid.
#
# NOTE: component_name may not be determined until runtime....
AC_DEFUN([MCA_PROCESS_DEAD_COMPONENT],[
AC_MSG_CHECKING([if MCA component $2:$3 can compile])
AC_MSG_RESULT([no])
Expand Down Expand Up @@ -1004,7 +916,7 @@ AC_DEFUN([MCA_COMPONENT_BUILD_CHECK],[

# if we were explicitly disabled, don't build :)
AS_IF([test "$DISABLE_$2" = "1"], [want_component=0])
AS_VAR_IF([DISABLE_$2_$3], [1], [want_component=0])
AS_IF([test "${DISABLE_$2_$3}" = "1"], [want_component=0])

AS_IF([test "$want_component" = "1"], [$4], [$5])
])
Expand Down
4 changes: 4 additions & 0 deletions ompi/mca/mtl/ofi/mtl_ofi.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
return OMPI_SUCCESS;
}

#if OPAL_OFI_HAVE_FI_MR_IFACE

if ((convertor->flags & CONVERTOR_ACCELERATOR) && ompi_mtl_ofi.hmem_needs_reg) {
/* Register buffer */
int ret;
Expand Down Expand Up @@ -343,6 +345,8 @@ int ompi_mtl_ofi_register_buffer(struct opal_convertor_t *convertor,
}
}

#endif

return OMPI_SUCCESS;
}

Expand Down
Loading