1
1

configure: detect UCX support by default

Adds detecting UCX from following paths: "/usr /usr/local /opt/ucx"

Signed-off-by: Boris Karasev <karasev.b@gmail.com>
Этот коммит содержится в:
Boris Karasev 2017-07-25 16:57:35 +03:00
родитель 4a3aa4f224
Коммит d917d54ddc
2 изменённых файлов: 54 добавлений и 45 удалений

Просмотреть файл

@ -1,6 +1,7 @@
# -*- shell-script -*- # -*- shell-script -*-
# #
# Copyright (C) 2015 Mellanox Technologies Ltd. ALL RIGHTS RESERVED. # Copyright (C) 2015-2017 Mellanox Technologies, Inc.
# All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science # Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved. # and Technology (RIST). All rights reserved.
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights # Copyright (c) 2016 Los Alamos National Security, LLC. All rights
@ -20,6 +21,7 @@
# support, otherwise executes action-if-not-found # support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_UCX],[ AC_DEFUN([OMPI_CHECK_UCX],[
if test -z "$ompi_check_ucx_happy" ; then if test -z "$ompi_check_ucx_happy" ; then
_x_ac_ucx_dirs="/usr /usr/local /opt/ucx"
AC_ARG_WITH([ucx], AC_ARG_WITH([ucx],
[AC_HELP_STRING([--with-ucx(=DIR)], [AC_HELP_STRING([--with-ucx(=DIR)],
[Build with Unified Communication X library support])]) [Build with Unified Communication X library support])])
@ -29,58 +31,64 @@ AC_DEFUN([OMPI_CHECK_UCX],[
[Search for Unified Communication X libraries in DIR])]) [Search for Unified Communication X libraries in DIR])])
OPAL_CHECK_WITHDIR([ucx-libdir], [$with_ucx_libdir], [libucp.*]) OPAL_CHECK_WITHDIR([ucx-libdir], [$with_ucx_libdir], [libucp.*])
ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_ucx_$1_save_LIBS="$LIBS"
AS_IF([test "$with_ucx" != "no"], AS_IF([test "$with_ucx" != "no"],
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "yes"], [AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "yes"],
[ [_x_ac_ucx_dirs="$with_ucx"])
ompi_check_ucx_dir="$with_ucx" for ompi_check_ucx_dir in $_x_ac_ucx_dirs; do
ompi_check_ucx_libdir="$with_ucx/lib" AS_IF([test ! -z "$with_ucx_libdir" && test "$with_ucx_libdir" != "yes"],
]) [
AS_IF([test ! -z "$with_ucx_libdir" && test "$with_ucx_libdir" != "yes"], ompi_check_ucx_libdir="$with_ucx_libdir"
[ompi_check_ucx_libdir="$with_ucx_libdir"]) ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir"
],
[AS_IF([test ! -z "$ompi_check_ucx_dir"],
[
ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib
ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir"
])])
ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir" ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_ucx_$1_save_LIBS="$LIBS"
OPAL_CHECK_PACKAGE([ompi_check_ucx], OPAL_CHECK_PACKAGE([ompi_check_ucx],
[ucp/api/ucp.h], [ucp/api/ucp.h],
[ucp], [ucp],
[ucp_cleanup], [ucp_cleanup],
[$ompi_check_ucx_extra_libs], [$ompi_check_ucx_extra_libs],
[$ompi_check_ucx_dir], [$ompi_check_ucx_dir],
[$ompi_check_ucx_libdir], [$ompi_check_ucx_libdir],
[ompi_check_ucx_happy="yes"], [ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])], [ompi_check_ucx_happy="no"])
[ompi_check_ucx_happy="no"]) CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS"
LIBS="$ompi_check_ucx_$1_save_LIBS"
if test "$ompi_check_ucx_happy" = no; then
continue
fi
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_ucx_version_ok="yes"],
[ompi_ucx_version_ok="no"])
CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS" AC_MSG_RESULT([$ompi_ucx_version_ok])
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS" CPPFLAGS=$old_CPPFLAGS
LIBS="$ompi_check_ucx_$1_save_LIBS"
AC_MSG_CHECKING(for UCX version compatibility) AS_IF([test "$ompi_ucx_version_ok" = "no"], [ompi_check_ucx_happy="no"])
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_ucx_version_ok="yes"],
[ompi_ucx_version_ok="no"])
AC_MSG_RESULT([$ompi_ucx_version_ok]) if test "$ompi_check_ucx_happy" = yes; then
CPPFLAGS=$old_CPPFLAGS break
fi
AS_IF([test "$ompi_ucx_version_ok" = "no"], [ompi_check_ucx_happy="no"]) done],
[ompi_check_ucx_happy="no"])
OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy]) OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])
fi fi
AS_IF([test "$ompi_check_ucx_happy" = "yes"], AS_IF([test "$ompi_check_ucx_happy" = "yes"],
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS" [$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS" $1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"

Просмотреть файл

@ -1,5 +1,6 @@
# #
# Copyright (C) Mellanox Technologies Ltd. 2001-2015. ALL RIGHTS RESERVED. # Copyright (C) 2001-2017 Mellanox Technologies, Inc.
# All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
# Additional copyrights may follow # Additional copyrights may follow
@ -36,10 +37,10 @@ mcacomponentdir = $(ompilibdir)
mcacomponent_LTLIBRARIES = $(component_install) mcacomponent_LTLIBRARIES = $(component_install)
mca_pml_ucx_la_SOURCES = $(local_sources) mca_pml_ucx_la_SOURCES = $(local_sources)
mca_pml_ucx_la_LIBADD = $(pml_ucx_LIBS) mca_pml_ucx_la_LIBADD = $(pml_ucx_LIBS)
mca_pml_ucx_la_LDFLAGS = -module -avoid-version mca_pml_ucx_la_LDFLAGS = -module -avoid-version $(pml_ucx_LDFLAGS)
noinst_LTLIBRARIES = $(component_noinst) noinst_LTLIBRARIES = $(component_noinst)
libmca_pml_ucx_la_SOURCES = $(local_sources) libmca_pml_ucx_la_SOURCES = $(local_sources)
libmca_pml_ucx_la_LIBADD = $(pml_ucx_LIBS) libmca_pml_ucx_la_LIBADD = $(pml_ucx_LIBS)
libmca_pml_ucx_la_LDFLAGS = -module -avoid-version libmca_pml_ucx_la_LDFLAGS = -module -avoid-version $(pml_ucx_LDFLAGS)