2015-03-03 17:19:43 +03:00
|
|
|
# -*- shell-script -*-
|
|
|
|
#
|
2015-12-28 07:22:46 +03:00
|
|
|
# Copyright (C) 2015 Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
|
|
|
|
# Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
# and Technology (RIST). All rights reserved.
|
2016-03-01 21:01:51 +03:00
|
|
|
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
|
|
|
# reserved.
|
2015-03-03 17:19:43 +03:00
|
|
|
# $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],[
|
2016-03-01 21:01:51 +03:00
|
|
|
if test -z "$ompi_check_ucx_happy" ; then
|
|
|
|
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.*])
|
2015-03-03 17:19:43 +03:00
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS"
|
|
|
|
ompi_check_ucx_$1_save_LIBS="$LIBS"
|
2015-03-03 17:19:43 +03:00
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
AS_IF([test "$with_ucx" != "no"],
|
|
|
|
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "yes"],
|
|
|
|
[
|
|
|
|
ompi_check_ucx_dir="$with_ucx"
|
|
|
|
ompi_check_ucx_libdir="$with_ucx/lib"
|
|
|
|
])
|
|
|
|
AS_IF([test ! -z "$with_ucx_libdir" && test "$with_ucx_libdir" != "yes"],
|
|
|
|
[ompi_check_ucx_libdir="$with_ucx_libdir"])
|
2015-03-03 17:19:43 +03:00
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir"
|
2015-03-03 17:19:43 +03:00
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
OPAL_CHECK_PACKAGE([ompi_check_ucx],
|
|
|
|
[ucp/api/ucp.h],
|
|
|
|
[ucp],
|
|
|
|
[ucp_cleanup],
|
|
|
|
[$ompi_check_ucx_extra_libs],
|
|
|
|
[$ompi_check_ucx_dir],
|
|
|
|
[$ompi_check_ucx_libdir],
|
|
|
|
[ompi_check_ucx_happy="yes"],
|
|
|
|
[ompi_check_ucx_happy="no"])],
|
|
|
|
[ompi_check_ucx_happy="no"])
|
2015-03-03 17:19:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS"
|
|
|
|
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS"
|
|
|
|
LIBS="$ompi_check_ucx_$1_save_LIBS"
|
2015-03-03 17:19:43 +03:00
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
AC_MSG_CHECKING(for UCX version compatibility)
|
|
|
|
AC_REQUIRE_CPP
|
2016-03-14 05:42:16 +03:00
|
|
|
old_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"
|
2016-03-01 21:01:51 +03:00
|
|
|
AC_COMPILE_IFELSE(
|
2015-03-03 17:19:43 +03:00
|
|
|
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],
|
2016-03-01 21:01:51 +03:00
|
|
|
[[
|
|
|
|
]])],
|
2015-03-03 17:19:43 +03:00
|
|
|
[ompi_ucx_version_ok="yes"],
|
|
|
|
[ompi_ucx_version_ok="no"])
|
|
|
|
|
2016-03-01 21:01:51 +03:00
|
|
|
AC_MSG_RESULT([$ompi_ucx_version_ok])
|
2016-03-14 05:42:16 +03:00
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
2016-03-01 21:01:51 +03:00
|
|
|
|
|
|
|
AS_IF([test "$ompi_ucx_version_ok" = "no"], [ompi_check_ucx_happy="no"])
|
|
|
|
|
|
|
|
OMPI_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])
|
|
|
|
fi
|
2015-03-03 17:19:43 +03:00
|
|
|
|
|
|
|
|
|
|
|
AS_IF([test "$ompi_check_ucx_happy" = "yes"],
|
2016-03-14 05:42:16 +03:00
|
|
|
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
|
2016-03-01 21:01:51 +03:00
|
|
|
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"
|
|
|
|
$1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS"
|
|
|
|
$2],
|
2015-12-28 07:22:46 +03:00
|
|
|
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"],
|
2015-03-03 17:19:43 +03:00
|
|
|
[AC_MSG_ERROR([UCX support requested but not found. Aborting])])
|
|
|
|
$3])
|
|
|
|
])
|
|
|
|
|