2016-11-23 02:03:20 +03:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
2017-07-25 16:57:35 +03:00
|
|
|
# Copyright (C) 2015-2017 Mellanox Technologies, Inc.
|
|
|
|
# All rights reserved.
|
2016-11-23 02:03:20 +03:00
|
|
|
# Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
# and Technology (RIST). All rights reserved.
|
|
|
|
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
|
|
|
# reserved.
|
|
|
|
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
|
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
# OMPI_CHECK_UCX(prefix, [action-if-found], [action-if-not-found])
|
|
|
|
# --------------------------------------------------------
|
|
|
|
# check if UCX 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([OMPI_CHECK_UCX],[
|
2017-10-23 11:28:20 +03:00
|
|
|
OPAL_VAR_SCOPE_PUSH([ompi_check_ucx_dir])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
AS_IF([test -z "$ompi_check_ucx_happy"],
|
|
|
|
[AC_ARG_WITH([ucx],
|
|
|
|
[AC_HELP_STRING([--with-ucx(=DIR)],
|
|
|
|
[Build with Unified Communication X library support])])
|
|
|
|
OPAL_CHECK_WITHDIR([ucx], [$with_ucx], [include/ucp/api/ucp.h])
|
|
|
|
AC_ARG_WITH([ucx-libdir],
|
|
|
|
[AC_HELP_STRING([--with-ucx-libdir=DIR],
|
|
|
|
[Search for Unified Communication X libraries in DIR])])
|
|
|
|
OPAL_CHECK_WITHDIR([ucx-libdir], [$with_ucx_libdir], [libucp.*])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
AS_IF([test "$with_ucx" != "no"],
|
|
|
|
[AS_IF([test -n "$with_ucx" && test "$with_ucx" != "yes"],
|
|
|
|
[ompi_check_ucx_dir="$with_ucx"],
|
|
|
|
[PKG_CHECK_MODULES_STATIC([ucx],[ucx],
|
|
|
|
[ompi_check_ucx_dir=`$PKG_CONFIG --variable=prefix ucx`
|
|
|
|
AS_IF([test "$ompi_check_ucx_dir" = "/usr"],
|
|
|
|
[ompi_check_ucx_dir=])],
|
|
|
|
[true])])
|
|
|
|
ompi_check_ucx_happy="no"
|
|
|
|
AS_IF([test -z "$ompi_check_ucx_dir"],
|
|
|
|
[OPAL_CHECK_PACKAGE([ompi_check_ucx],
|
|
|
|
[ucp/api/ucp.h],
|
|
|
|
[ucp],
|
2018-06-27 19:59:40 +03:00
|
|
|
[ucp_cleanup],
|
2018-09-11 19:06:22 +03:00
|
|
|
[-luct -lucm -lucs],
|
2017-10-23 11:28:20 +03:00
|
|
|
[],
|
|
|
|
[],
|
|
|
|
[ompi_check_ucx_happy="yes"],
|
|
|
|
[ompi_check_ucx_happy="no"])
|
|
|
|
AS_IF([test "$ompi_check_ucx_happy" = yes],
|
|
|
|
[AC_MSG_CHECKING(for UCX version compatibility)
|
|
|
|
AC_REQUIRE_CPP
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],[[]])],
|
|
|
|
[ompi_check_ucx_happy="yes"],
|
|
|
|
[ompi_check_ucx_happy="no"])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
AC_MSG_RESULT([$ompi_check_ucx_happy])])
|
|
|
|
AS_IF([test "$ompi_check_ucx_happy" = "no"],
|
|
|
|
[ompi_check_ucx_dir=/opt/ucx])])
|
|
|
|
AS_IF([test "$ompi_check_ucx_happy" != yes],
|
|
|
|
[AS_IF([test -n "$with_ucx_libdir"],
|
|
|
|
[ompi_check_ucx_libdir="$with_ucx_libdir"],
|
|
|
|
[files=`ls $ompi_check_ucx_dir/lib64/libucp.* 2> /dev/null | wc -l`
|
|
|
|
AS_IF([test "$files" -gt 0],
|
|
|
|
[ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib64],
|
|
|
|
[ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib])])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS"
|
|
|
|
ompi_check_ucx_$1_save_LIBS="$LIBS"
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
OPAL_CHECK_PACKAGE([ompi_check_ucx],
|
|
|
|
[ucp/api/ucp.h],
|
|
|
|
[ucp],
|
2018-06-27 19:59:40 +03:00
|
|
|
[ucp_cleanup],
|
2018-09-11 11:43:40 +03:00
|
|
|
[-luct -lucm -lucs],
|
2017-10-23 11:28:20 +03:00
|
|
|
[$ompi_check_ucx_dir],
|
|
|
|
[$ompi_check_ucx_libdir],
|
|
|
|
[ompi_check_ucx_happy="yes"],
|
|
|
|
[ompi_check_ucx_happy="no"])
|
2018-03-15 21:50:10 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS"
|
|
|
|
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS"
|
|
|
|
LIBS="$ompi_check_ucx_$1_save_LIBS"
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
AS_IF([test "$ompi_check_ucx_happy" = yes],
|
|
|
|
[AC_MSG_CHECKING(for UCX version compatibility)
|
|
|
|
AC_REQUIRE_CPP
|
|
|
|
old_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],[[]])],
|
|
|
|
[ompi_check_ucx_happy="yes"],
|
|
|
|
[ompi_check_ucx_happy="no"])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
AC_MSG_RESULT([$ompi_check_ucx_happy])
|
|
|
|
CPPFLAGS=$old_CPPFLAGS])])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
2018-01-16 13:32:45 +03:00
|
|
|
old_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AS_IF([test -n "$ompi_check_ucx_dir"],
|
|
|
|
[CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"])
|
|
|
|
AC_CHECK_DECLS([ucp_tag_send_nbr],
|
|
|
|
[AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1],
|
|
|
|
[have ucp_tag_send_nbr()])], [],
|
|
|
|
[#include <ucp/api/ucp.h>])
|
2018-07-02 16:37:03 +03:00
|
|
|
AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb,
|
|
|
|
ucp_request_check_status, ucp_put_nb, ucp_get_nb],
|
2018-06-28 12:58:07 +03:00
|
|
|
[], [],
|
2018-06-27 19:59:40 +03:00
|
|
|
[#include <ucp/api/ucp.h>])
|
2018-07-09 15:23:20 +03:00
|
|
|
AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND,
|
|
|
|
UCP_ATOMIC_POST_OP_OR,
|
|
|
|
UCP_ATOMIC_POST_OP_XOR,
|
|
|
|
UCP_ATOMIC_FETCH_OP_FAND,
|
|
|
|
UCP_ATOMIC_FETCH_OP_FOR,
|
|
|
|
UCP_ATOMIC_FETCH_OP_FXOR],
|
|
|
|
[], [],
|
|
|
|
[#include <ucp/api/ucp.h>])
|
2019-02-13 17:23:09 +03:00
|
|
|
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],
|
|
|
|
[AC_DEFINE([HAVE_UCP_WORKER_ADDRESS_FLAGS], [1],
|
|
|
|
[have worker address attribute])], [],
|
|
|
|
[#include <ucp/api/ucp.h>])
|
2018-01-16 13:32:45 +03:00
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
|
2017-10-23 11:28:20 +03:00
|
|
|
OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])])])
|
2016-11-23 02:03:20 +03:00
|
|
|
|
|
|
|
AS_IF([test "$ompi_check_ucx_happy" = "yes"],
|
|
|
|
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
|
2017-10-23 11:28:20 +03:00
|
|
|
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"
|
|
|
|
$1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS"
|
|
|
|
$2],
|
2016-11-23 02:03:20 +03:00
|
|
|
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"],
|
|
|
|
[AC_MSG_ERROR([UCX support requested but not found. Aborting])])
|
|
|
|
$3])
|
2017-10-23 11:28:20 +03:00
|
|
|
|
|
|
|
OPAL_VAR_SCOPE_POP
|
2016-11-23 02:03:20 +03:00
|
|
|
])
|
|
|
|
|