diff --git a/config/ompi_check_mxm.m4 b/config/ompi_check_mxm.m4 index c510fbeb6e2..a0d98c1e504 100644 --- a/config/ompi_check_mxm.m4 +++ b/config/ompi_check_mxm.m4 @@ -3,6 +3,9 @@ dnl dnl Copyright (c) 2001-2011 Mellanox Technologies Ltd. ALL RIGHTS RESERVED. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights +dnl reserved. +dnl Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -16,51 +19,50 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_MXM],[ - AC_ARG_WITH([mxm], - [AC_HELP_STRING([--with-mxm(=DIR)], - [Build Mellanox Messaging support, optionally adding - DIR/include and DIR/lib or DIR/lib64 to the search path for headers and libraries])]) - AC_ARG_WITH([mxm-libdir], - [AC_HELP_STRING([--with-mxm-libdir=DIR], - [Search for Mellanox MXM libraries in DIR])]) - OPAL_CHECK_WITHDIR([mxm-libdir], [$with_mxm_libdir], [libmxm.*]) + if test -z "$ompi_check_mxm_happy" ; then + AC_ARG_WITH([mxm], + [AC_HELP_STRING([--with-mxm(=DIR)], + [Build Mellanox Messaging support, optionally adding + DIR/include and DIR/lib or DIR/lib64 to the search path for headers and libraries])]) + AC_ARG_WITH([mxm-libdir], + [AC_HELP_STRING([--with-mxm-libdir=DIR], + [Search for Mellanox MXM libraries in DIR])]) + OPAL_CHECK_WITHDIR([mxm-libdir], [$with_mxm_libdir], [libmxm.*]) - ompi_check_mxm_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_mxm_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_mxm_$1_save_LIBS="$LIBS" + ompi_check_mxm_$1_save_CPPFLAGS="$CPPFLAGS" + ompi_check_mxm_$1_save_LDFLAGS="$LDFLAGS" + ompi_check_mxm_$1_save_LIBS="$LIBS" - AS_IF([test "$with_mxm" != "no"], - [AS_IF([test ! -z "$with_mxm" && test "$with_mxm" != "yes"], - [ + AS_IF([test "$with_mxm" != "no"], + [AS_IF([test ! -z "$with_mxm" && test "$with_mxm" != "yes"], + [ ompi_check_mxm_dir="$with_mxm" - ]) - AS_IF([test ! -z "$with_mxm_libdir" && test "$with_mxm_libdir" != "yes"], - [ompi_check_mxm_libdir="$with_mxm_libdir"]) + ]) + AS_IF([test ! -z "$with_mxm_libdir" && test "$with_mxm_libdir" != "yes"], + [ompi_check_mxm_libdir="$with_mxm_libdir"]) - OPAL_CHECK_PACKAGE([$1], - [mxm/api/mxm_api.h], - [mxm], - [mxm_cleanup], - [], - [$ompi_check_mxm_dir], - [$ompi_check_mxm_libdir], - [ompi_check_mxm_happy="yes"], - [ompi_check_mxm_happy="no"])], - [ompi_check_mxm_happy="no"]) + OPAL_CHECK_PACKAGE([ompi_check_mxm], + [mxm/api/mxm_api.h], + [mxm], + [mxm_cleanup], + [], + [$ompi_check_mxm_dir], + [$ompi_check_mxm_libdir], + [ompi_check_mxm_happy="yes"], + [ompi_check_mxm_happy="no"])], + [ompi_check_mxm_happy="no"]) + CPPFLAGS="$ompi_check_mxm_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_mxm_$1_save_LDFLAGS" + LIBS="$ompi_check_mxm_$1_save_LIBS" - - CPPFLAGS="$ompi_check_mxm_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_mxm_$1_save_LDFLAGS" - LIBS="$ompi_check_mxm_$1_save_LIBS" - - AC_MSG_CHECKING(for MXM version compatibility) - AC_REQUIRE_CPP - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I$ompi_check_mxm_dir/include" - AC_COMPILE_IFELSE( + AC_MSG_CHECKING(for MXM version compatibility) + AC_REQUIRE_CPP + old_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I$ompi_check_mxm_dir/include" + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], - [[ + [[ #ifndef MXM_VERSION #error "MXM Version is less than 2.1, please upgrade" #endif @@ -72,13 +74,19 @@ AC_DEFUN([OMPI_CHECK_MXM],[ [ompi_mxm_version_ok="yes"], [ompi_mxm_version_ok="no"]) - AC_MSG_RESULT([$ompi_mxm_version_ok]) - CFLAGS=$old_CFLAGS + AC_MSG_RESULT([$ompi_mxm_version_ok]) + CFLAGS=$old_CFLAGS + + AS_IF([test "$ompi_mxm_version_ok" = "no"], [ompi_check_mxm_happy="no"]) - AS_IF([test "$ompi_mxm_version_ok" = "no"], [ompi_check_mxm_happy="no"]) + OPAL_SUMMARY_ADD([[Transports]],[[Mellanox MXM]],[$1],[$ompi_check_mxm_happy]) + fi AS_IF([test "$ompi_check_mxm_happy" = "yes"], - [$2], + [$1_LDFLAGS="[$]$_LDFLAGS $ompi_check_mxm_LDFLAGS" + $1_LIBS="[$]$1_LIBS $ompi_check_mxm_LIBS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_mxm_CPPFLAGS" + $2], [AS_IF([test ! -z "$with_mxm" && test "$with_mxm" != "no"], [AC_MSG_ERROR([MXM support requested but not found. Aborting])]) $3]) diff --git a/config/ompi_check_psm.m4 b/config/ompi_check_psm.m4 index 9142c756030..12954f40630 100644 --- a/config/ompi_check_psm.m4 +++ b/config/ompi_check_psm.m4 @@ -11,9 +11,11 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2006 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2006 QLogic Corp. All rights reserved. -dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights +dnl reserved. dnl Copyright (c) 2016 Intel Corporation. All rights reserved. dnl dnl $COPYRIGHT$ @@ -29,53 +31,60 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_PSM],[ - AC_ARG_WITH([psm], - [AC_HELP_STRING([--with-psm(=DIR)], - [Build PSM (Qlogic InfiniPath) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([psm], [$with_psm], [include/psm.h]) - AC_ARG_WITH([psm-libdir], - [AC_HELP_STRING([--with-psm-libdir=DIR], - [Search for PSM (QLogic InfiniPath PSM) libraries in DIR])]) - OPAL_CHECK_WITHDIR([psm-libdir], [$with_psm_libdir], [libpsm_infinipath.*]) + if test -z "$ompi_check_psm_happy" ; then + AC_ARG_WITH([psm], + [AC_HELP_STRING([--with-psm(=DIR)], + [Build PSM (Qlogic InfiniPath) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + OPAL_CHECK_WITHDIR([psm], [$with_psm], [include/psm.h]) + AC_ARG_WITH([psm-libdir], + [AC_HELP_STRING([--with-psm-libdir=DIR], + [Search for PSM (QLogic InfiniPath PSM) libraries in DIR])]) + OPAL_CHECK_WITHDIR([psm-libdir], [$with_psm_libdir], [libpsm_infinipath.*]) - ompi_check_psm_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_psm_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_psm_$1_save_LIBS="$LIBS" + ompi_check_psm_$1_save_CPPFLAGS="$CPPFLAGS" + ompi_check_psm_$1_save_LDFLAGS="$LDFLAGS" + ompi_check_psm_$1_save_LIBS="$LIBS" - AS_IF([test "$with_psm" != "no"], - [AS_IF([test ! -z "$with_psm" && test "$with_psm" != "yes"], - [ompi_check_psm_dir="$with_psm"]) - AS_IF([test ! -z "$with_psm_libdir" && test "$with_psm_libdir" != "yes"], - [ompi_check_psm_libdir="$with_psm_libdir"]) + AS_IF([test "$with_psm" != "no"], + [AS_IF([test ! -z "$with_psm" && test "$with_psm" != "yes"], + [ompi_check_psm_dir="$with_psm"]) + AS_IF([test ! -z "$with_psm_libdir" && test "$with_psm_libdir" != "yes"], + [ompi_check_psm_libdir="$with_psm_libdir"]) - OPAL_CHECK_PACKAGE([$1], - [psm.h], - [psm_infinipath], - [psm_finalize], - [], - [$ompi_check_psm_dir], - [$ompi_check_psm_libdir], - [ompi_check_psm_happy="yes"], - [ompi_check_psm_happy="no"])], - [ompi_check_psm_happy="no"]) + OPAL_CHECK_PACKAGE([ompi_check_psm], + [psm.h], + [psm_infinipath], + [psm_finalize], + [], + [$ompi_check_psm_dir], + [$ompi_check_psm_libdir], + [ompi_check_psm_happy="yes"], + [ompi_check_psm_happy="no"])], + [ompi_check_psm_happy="no"]) - CPPFLAGS="$ompi_check_psm_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_psm_$1_save_LDFLAGS" - LIBS="$ompi_check_psm_$1_save_LIBS" + CPPFLAGS="$ompi_check_psm_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_psm_$1_save_LDFLAGS" + LIBS="$ompi_check_psm_$1_save_LIBS" - AS_IF([test "$ompi_check_psm_happy" = "yes" && test "$enable_progress_threads" = "yes"], - [AC_MSG_WARN([PSM driver does not currently support progress threads. Disabling BTL.]) - ompi_check_psm_happy="no"]) + AS_IF([test "$ompi_check_psm_happy" = "yes" && test "$enable_progress_threads" = "yes"], + [AC_MSG_WARN([PSM driver does not currently support progress threads. Disabling BTL.]) + ompi_check_psm_happy="no"]) - AS_IF([test "$ompi_check_psm_happy" = "yes"], - [AC_CHECK_HEADERS( + AS_IF([test "$ompi_check_psm_happy" = "yes"], + [AC_CHECK_HEADERS( glob.h, [], [AC_MSG_WARN([glob.h not found. Can not build component.]) ompi_check_psm_happy="no"])]) + OPAL_SUMMARY_ADD([[Transports]],[[Intel TrueScale (PSM)]],[$1],[$ompi_check_psm_happy]) + fi + AS_IF([test "$ompi_check_psm_happy" = "yes"], - [$2], + [$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_psm_LDFLAGS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_psm_CPPFLAGS" + $1_LIBS="[$]$1_LIBS $ompi_check_psm_LIBS" + $2], [AS_IF([test ! -z "$with_psm" && test "$with_psm" != "no"], [AC_MSG_ERROR([PSM support requested but not found. Aborting])]) $3]) diff --git a/config/ompi_check_psm2.m4 b/config/ompi_check_psm2.m4 index e5f0a25555a..ff00cb54d77 100644 --- a/config/ompi_check_psm2.m4 +++ b/config/ompi_check_psm2.m4 @@ -11,10 +11,12 @@ # Copyright (c) 2004-2006 The Regents of the University of California. # All rights reserved. # Copyright (c) 2006 QLogic Corp. All rights reserved. -# Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2014 Intel Corporation. All rights reserved. # 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$ # # Additional copyrights may follow @@ -28,54 +30,60 @@ # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_PSM2],[ - AC_ARG_WITH([psm2], - [AC_HELP_STRING([--with-psm2(=DIR)], - [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([psm2], [$with_psm2], [include/psm2.h]) - AC_ARG_WITH([psm2-libdir], - [AC_HELP_STRING([--with-psm2-libdir=DIR], - [Search for PSM (Intel PSM2) libraries in DIR])]) - OPAL_CHECK_WITHDIR([psm2-libdir], [$with_psm2_libdir], [libpsm2.*]) + if test -z "$ompi_check_psm2_happy" ; then + AC_ARG_WITH([psm2], + [AC_HELP_STRING([--with-psm2(=DIR)], + [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + OPAL_CHECK_WITHDIR([psm2], [$with_psm2], [include/psm2.h]) + AC_ARG_WITH([psm2-libdir], + [AC_HELP_STRING([--with-psm2-libdir=DIR], + [Search for PSM (Intel PSM2) libraries in DIR])]) + OPAL_CHECK_WITHDIR([psm2-libdir], [$with_psm2_libdir], [libpsm2.*]) - ompi_check_psm2_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_psm2_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_psm2_$1_save_LIBS="$LIBS" + ompi_check_psm2_$1_save_CPPFLAGS="$CPPFLAGS" + ompi_check_psm2_$1_save_LDFLAGS="$LDFLAGS" + ompi_check_psm2_$1_save_LIBS="$LIBS" - AS_IF([test "$with_psm2" != "no"], - [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "yes"], - [ompi_check_psm2_dir="$with_psm2"]) - AS_IF([test ! -z "$with_psm2_libdir" && test "$with_psm2_libdir" != "yes"], - [ompi_check_psm2_libdir="$with_psm2_libdir"]) + AS_IF([test "$with_psm2" != "no"], + [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "yes"], + [ompi_check_psm2_dir="$with_psm2"]) + AS_IF([test ! -z "$with_psm2_libdir" && test "$with_psm2_libdir" != "yes"], + [ompi_check_psm2_libdir="$with_psm2_libdir"]) - OPAL_CHECK_PACKAGE([$1], - [psm2.h], - [psm2], - [psm2_mq_irecv2], - [], - [$ompi_check_psm2_dir], - [$ompi_check_psm2_libdir], - [ompi_check_psm2_happy="yes"], - [ompi_check_psm2_happy="no"])], - [ompi_check_psm2_happy="no"]) + OPAL_CHECK_PACKAGE([ompi_check_psm2], + [psm2.h], + [psm2], + [psm2_mq_irecv2], + [], + [$ompi_check_psm2_dir], + [$ompi_check_psm2_libdir], + [ompi_check_psm2_happy="yes"], + [ompi_check_psm2_happy="no"])], + [ompi_check_psm2_happy="no"]) - CPPFLAGS="$ompi_check_psm2_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_psm2_$1_save_LDFLAGS" - LIBS="$ompi_check_psm2_$1_save_LIBS" + CPPFLAGS="$ompi_check_psm2_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_psm2_$1_save_LDFLAGS" + LIBS="$ompi_check_psm2_$1_save_LIBS" - AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], - [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) - ompi_check_psm2_happy="no"]) + AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], + [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) + ompi_check_psm2_happy="no"]) - AS_IF([test "$ompi_check_psm2_happy" = "yes"], - [AC_CHECK_HEADERS( + AS_IF([test "$ompi_check_psm2_happy" = "yes"], + [AC_CHECK_HEADERS( glob.h, [], [AC_MSG_WARN([glob.h not found. Can not build component.]) ompi_check_psm2_happy="no"])]) - + OPAL_SUMMARY_ADD([[Transports]],[[Intel Omnipath (PSM2)]],[$1],[$ompi_check_psm2_happy]) + fi + AS_IF([test "$ompi_check_psm2_happy" = "yes"], - [$2], + [$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_psm2_LDFLAGS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_psm2_CPPFLAGS" + $1_LIBS="[$]$1_LIBS $ompi_check_psm2_LIBS" + $2], [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "no"], [AC_MSG_ERROR([PSM2 support requested but not found. Aborting])]) $3]) diff --git a/config/ompi_check_ucx.m4 b/config/ompi_check_ucx.m4 index 52143957412..93aceebca3e 100644 --- a/config/ompi_check_ucx.m4 +++ b/config/ompi_check_ucx.m4 @@ -1,8 +1,11 @@ # -*- shell-script -*- # # Copyright (C) 2015 Mellanox Technologies Ltd. ALL RIGHTS RESERVED. -# Copyright (c) 2015-2016 Research Organization for Information Science +# 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 @@ -16,65 +19,73 @@ # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OMPI_CHECK_UCX],[ - 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.*]) + 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.*]) - ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_ucx_$1_save_LIBS="$LIBS" + 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 ! -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"]) + 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"]) - ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir" + ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir" - OPAL_CHECK_PACKAGE([$1], - [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"]) + 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"]) - CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS" - LIBS="$ompi_check_ucx_$1_save_LIBS" + CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS" + LIBS="$ompi_check_ucx_$1_save_LIBS" - 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_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 ]], - [[ - ]])], + [[ + ]])], [ompi_ucx_version_ok="yes"], [ompi_ucx_version_ok="no"]) - AC_MSG_RESULT([$ompi_ucx_version_ok]) - CPPFLAGS=$old_CPPFLAGS + AC_MSG_RESULT([$ompi_ucx_version_ok]) + CPPFLAGS=$old_CPPFLAGS + + AS_IF([test "$ompi_ucx_version_ok" = "no"], [ompi_check_ucx_happy="no"]) + + OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy]) + fi - AS_IF([test "$ompi_ucx_version_ok" = "no"], [ompi_check_ucx_happy="no"]) AS_IF([test "$ompi_check_ucx_happy" = "yes"], - [$2], + [$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS" + $1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS" + $1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS" + $2], [AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"], [AC_MSG_ERROR([UCX support requested but not found. Aborting])]) $3]) diff --git a/config/opal_check_cma.m4 b/config/opal_check_cma.m4 index cfb7639c13b..2930debf911 100644 --- a/config/opal_check_cma.m4 +++ b/config/opal_check_cma.m4 @@ -3,9 +3,9 @@ # Copyright (c) 2009 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. -# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2010-2012 IBM Corporation. All rights reserved. -# Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights +# Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights # reserved. # $COPYRIGHT$ # @@ -18,29 +18,115 @@ # -------------------------------------------------------- # check if cma support is wanted. AC_DEFUN([OPAL_CHECK_CMA],[ - OPAL_VAR_SCOPE_PUSH([ompi_check_cma_happy ompi_check_cma_need_defs]) - - ompi_check_cma_happy="no" AC_ARG_WITH([cma], [AC_HELP_STRING([--with-cma], - [Build Cross Memory Attach support (default: no)])]) - - AC_MSG_CHECKING([if user requested CMA build]) - if test "$with_cma" = "yes" ; then - ompi_check_cma_happy="yes" - AC_MSG_RESULT([yes]) - AC_CHECK_FUNC(process_vm_readv, [ompi_check_cma_need_defs=0], - [ompi_check_cma_need_defs=1]) - AC_DEFINE_UNQUOTED([OPAL_CMA_NEED_SYSCALL_DEFS], - [$ompi_check_cma_need_defs], - [Need CMA syscalls defined]) - AC_CHECK_HEADERS([sys/prctl.h]) + [Build Cross Memory Attach support (default: autodetect)])]) + + # We only need to do the back-end test once + if test -z "$opal_check_cma_happy" ; then + OPAL_CHECK_CMA_BACKEND + fi + + AS_IF([test $opal_check_cma_happy -eq 1], + [$2], + [if test "$with_cma" = "yes"; then + AC_MSG_WARN([--with-cma support requested, but not available]) + AC_MSG_ERROR([Cannot continue]) + fi + $3]) +]) + +AC_DEFUN([OPAL_CHECK_CMA_BACKEND], +[ + OPAL_VAR_SCOPE_PUSH([opal_check_cma_need_defs opal_check_cma_kernel_version opal_check_cma_CFLAGS opal_check_cma_msg]) + + # Some systems have process_cm_readv() in libc, which means CMA is + # supported. Other systems do not have process_cm_readv() in + # libc, but have support for it in the kernel if we invoke it + # directly. Check for both. + AC_CHECK_HEADERS([sys/prctl.h]) + + AC_CHECK_FUNC([process_vm_readv], [opal_check_cma_need_defs=0], + [opal_check_cma_need_defs=1]) + AC_DEFINE_UNQUOTED([OPAL_CMA_NEED_SYSCALL_DEFS], + [$opal_check_cma_need_defs], + [Need CMA syscalls defined]) + if test $opal_check_cma_need_defs -eq 1 ; then + opal_check_cma_CFLAGS=$CFLAGS + # Need some extra include paths to locate the appropriate headers + CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/opal/include" + AC_MSG_CHECKING([if internal syscall numbers for Linux CMA work]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include +#include + +#include +#include +#include + +#include "opal/include/opal/sys/cma.h" + +static void do_check (pid_t pid, int *in, int *out) +{ + int check[4] = {0, 0, 0, 0}, i; + struct iovec rem_iov = {out, sizeof (check)}; + struct iovec loc_iov = {check, sizeof (check)}; + ssize_t rc; + + rc = process_vm_readv (pid, &loc_iov, 1, &rem_iov, 1, 0); + if (sizeof (check) != rc) { + exit (1); + } + + for (i = 0 ; i < 4 ; ++i) { + if (check[i] != i) { + exit (1); + } + + check[i] = i * 2; + } + + rem_iov.iov_base = in; + rc = process_vm_writev (pid, &loc_iov, 1, &rem_iov, 1, 0); + if (sizeof (check) != rc) { + exit (1); + } + + exit (0); +} +]],[[ + int i, in[4] = {-1, -1, -1, -1}, out[4] = {0, 1, 2, 3}; + + do_check (getpid (), in, out); + + for (i = 0 ; i < 4 ; ++i) { + if (in[i] != 2 * i) { + return 1; + } + } + + /* all good */ + return 0; +]])], + [AC_MSG_RESULT([yes]) + opal_check_cma_happy=1], + [AC_MSG_RESULT([no]) + opal_check_cma_happy=0], + [AC_MSG_RESULT([no (cross-compiling)]) + opal_check_cma_happy=0]) + CFLAGS=$opal_check_cma_CFLAGS else - AC_MSG_RESULT([no]) + # If we didn't need the defs, then we have process_vm_readv(), + # and CMA is happy. + opal_check_cma_happy=1 fi - AS_IF([test "$ompi_check_cma_happy" = "yes"], - [$2], - [$3]) OPAL_VAR_SCOPE_POP -])dnl + + AS_IF([test $opal_check_cma_happy -eq 1], + [opal_check_cma_msg=yes], + [opal_check_cma_msg=no]) + OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/Linux CMA]],[$1],[$opal_check_cma_msg]) +]) diff --git a/config/opal_check_cray_xpmem.m4 b/config/opal_check_cray_xpmem.m4 deleted file mode 100644 index f489cab3417..00000000000 --- a/config/opal_check_cray_xpmem.m4 +++ /dev/null @@ -1,64 +0,0 @@ -# -*- shell-script ; indent-tabs-mode:nil -*- -# -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -# University Research and Technology -# Corporation. All rights reserved. -# Copyright (c) 2004-2005 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2004-2005 The Regents of the University of California. -# All rights reserved. -# Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights -# reserved. -# Copyright (c) 2014 Intel, Inc. All rights reserved. -# Copyright (c) 2014-2015 Research Organization for Information Science -# and Technology (RIST). All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# - -# -# special check for cray xpmem, uses macro(s) from pkg.m4 -# -# OPAL_CHECK_CRAY_XPMEM(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -AC_DEFUN([OPAL_CHECK_CRAY_XPMEM],[ - AC_ARG_WITH([cray_xpmem], - [AC_HELP_STRING([--with-cray-xpmem(=yes/no)], - [Build Cray XPMEM support(default: auto)])], - [], with_cray_xpmem=auto) - - AC_MSG_CHECKING([for Cray XPMEM support]) - AS_IF([test "$with_cray_xpmem" = "no"], - [AC_MSG_RESULT([no]) - $3], - [AS_IF([test "$with_cray_xpmem" = "auto" || test "$with_cray_xpmem" = "yes"], - [PKG_CHECK_MODULES_STATIC([CRAY_XPMEM], [cray-xpmem], - [opal_check_cray_xpmem_happy="yes"], - [opal_check_cray_xpmem_happy="no"] - [AS_IF([test "$with_cray_xpmem" = "yes"], - [AC_MSG_WARN([Cray XPMEM support requested but pkg-config failed.]) - AC_MSG_ERROR([Aborting])],[])] - )], - []) - ]) - - AS_IF([test "$opal_check_cray_xpmem_happy" = "yes" && test "$enable_static" = "yes"], - [CRAY_XPMEM_LIBS = $CRAY_XPMEM_STATIC_LIBS],[]) - - AS_IF([test "$opal_check_cray_xpmem_happy" = "yes"], - [$1_LDFLAGS="$CRAY_XPMEM_LIBS" - $1_CPPFLAGS="$CRAY_XPMEM_CFLAGS" - $1_LIBS="$CRAY_XPMEM_LIBS" - AC_DEFINE_UNQUOTED([HAVE_XPMEM_H], [1],[is xpmem.h available]) - $2], [$3]) -]) - - - diff --git a/config/opal_check_cuda.m4 b/config/opal_check_cuda.m4 index 11456ef905e..fd7816e3ea7 100644 --- a/config/opal_check_cuda.m4 +++ b/config/opal_check_cuda.m4 @@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2005 The Regents of the University of California. dnl All rights reserved. -dnl Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. dnl Copyright (c) 2009 IBM Corporation. All rights reserved. dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights @@ -124,6 +124,8 @@ else CUDA_SUPPORT=0 fi +OPAL_SUMMARY_ADD([[Miscellaneous]],[[CUDA support]],[opal_cuda], [$opal_check_cuda_happy]) + AM_CONDITIONAL([OPAL_cuda_support], [test "x$CUDA_SUPPORT" = "x1"]) AC_DEFINE_UNQUOTED([OPAL_CUDA_SUPPORT],$CUDA_SUPPORT, [Whether we want cuda device pointer support]) diff --git a/config/opal_check_knem.m4 b/config/opal_check_knem.m4 index 6d2d7c0f0f0..2e999f1fd42 100644 --- a/config/opal_check_knem.m4 +++ b/config/opal_check_knem.m4 @@ -3,9 +3,9 @@ dnl dnl Copyright (c) 2009 The University of Tennessee and The University dnl of Tennessee Research Foundation. All rights dnl reserved. -dnl Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2010-2012 IBM Corporation. All rights reserved. -dnl Copyright (c) 2014 Los Alamos National Security, LLC. All rights +dnl Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights dnl reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. @@ -22,48 +22,53 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OPAL_CHECK_KNEM],[ - OPAL_VAR_SCOPE_PUSH([opal_check_knem_happy opal_check_knem_$1_save_CPPFLAGS opal_check_knem_dir]) - AC_ARG_WITH([knem], - [AC_HELP_STRING([--with-knem(=DIR)], - [Build knem Linux kernel module support, searching for headers in DIR/include])]) + if test -z "$opal_check_knem_happy" ; then + OPAL_VAR_SCOPE_PUSH([opal_check_knem_$1_save_CPPFLAGS opal_check_knem_dir]) + AC_ARG_WITH([knem], + [AC_HELP_STRING([--with-knem(=DIR)], + [Build knem Linux kernel module support, searching for headers in DIR/include])]) - OPAL_CHECK_WITHDIR([knem], [$with_knem], [include/knem_io.h]) - opal_check_knem_$1_save_CPPFLAGS="$CPPFLAGS" + OPAL_CHECK_WITHDIR([knem], [$with_knem], [include/knem_io.h]) + opal_check_knem_$1_save_CPPFLAGS="$CPPFLAGS" - AS_IF([test "$with_knem" != "no"], - [AS_IF([test ! -z "$with_knem" && test "$with_knem" != "yes"], - [opal_check_knem_dir="$with_knem"]) + opal_check_knem_happy=no - _OPAL_CHECK_PACKAGE_HEADER([$1], - [knem_io.h], - [$opal_check_knem_dir], - [opal_check_knem_happy="yes"], - [opal_check_knem_happy="no"])], - [opal_check_knem_happy="no"]) + AS_IF([test "$with_knem" != "no"], + [AS_IF([test ! -z "$with_knem" && test "$with_knem" != "yes"], + [opal_check_knem_dir="$with_knem"]) - CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS" + _OPAL_CHECK_PACKAGE_HEADER([ompi_check_knem], + [knem_io.h], + [$opal_check_knem_dir], + [opal_check_knem_happy="yes"], + [])], + []) - # need at least version 0x0000000b - AS_IF([test "$opal_check_knem_happy" = "yes"], - [AC_CACHE_CHECK([for knem ABI version 0xb or later], - [opal_cv_knem_version_ok], - [AC_PREPROC_IFELSE( - [AC_LANG_PROGRAM([ + CPPFLAGS="$CPPFLAGS $ompi_check_knem_CPPFLAGS" + + # need at least version 0x0000000b + if test "$opal_check_knem_happy" = "yes" ; then + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ #include - ],[ + ],[ #if KNEM_ABI_VERSION < 0xc #error "Version less than 0xc" #endif - ])], - [opal_cv_knem_version_ok=yes], - [opal_cv_knem_version_ok=no])])]) + ])], + [opal_check_knem_happy=yes], + [opal_check_knem_happy=no]) + fi - CPPFLAGS="$opal_check_knem_$1_save_CPPFLAGS" + CPPFLAGS="$opal_check_knem_$1_save_CPPFLAGS" - AS_IF([test "$opal_check_knem_happy" = "yes" && test "$opal_cv_knem_version_ok" = "yes"], - [$2], + OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/Linux KNEM]],[$1],[$opal_check_knem_happy]) + OPAL_VAR_SCOPE_POP + fi + + AS_IF([test "$opal_check_knem_happy" = "yes"], + [$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_knem_CPPFLAGS" + $2], [AS_IF([test ! -z "$with_knem" && test "$with_knem" != "no"], [AC_MSG_ERROR([KNEM support requested but not found. Aborting])]) $3]) - OPAL_VAR_SCOPE_POP ])dnl diff --git a/config/opal_check_libfabric.m4 b/config/opal_check_libfabric.m4 index bcedf993f80..142c7c61008 100644 --- a/config/opal_check_libfabric.m4 +++ b/config/opal_check_libfabric.m4 @@ -1,6 +1,8 @@ dnl -*- shell-script -*- dnl -dnl Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2015-2016 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights +dnl reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -18,66 +20,76 @@ dnl # action-if-not-found. # AC_DEFUN([OPAL_CHECK_LIBFABRIC],[ - OPAL_VAR_SCOPE_PUSH([opal_check_libfabric_$1_save_CPPFLAGS opal_check_libfabric_$1_save_LDFLAGS opal_check_libfabric_$1_save_LIBS]) + 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])]) + # 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.*]) + # 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_$1_save_CPPFLAGS=$CPPFLAGS + opal_check_libfabric_$1_save_LDFLAGS=$LDFLAGS + opal_check_libfabric_$1_save_LIBS=$LIBS - opal_check_libfabric_happy=1 - AS_IF([test "$with_libfabric" = "no"], - [opal_check_libfabric_happy=0]) + opal_check_libfabric_happy=yes + AS_IF([test "$with_libfabric" = "no"], + [opal_check_libfabric_happy=no]) - AS_IF([test $opal_check_libfabric_happy -eq 1], - [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], + [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 -eq 1], - [OPAL_CHECK_PACKAGE([$1], - [rdma/fabric.h], - [fabric], - [fi_getinfo], - [], - [$opal_libfabric_dir], - [$opal_libfabric_libdir], - [opal_check_libfabric_happy=1], - [opal_check_libfabric_happy=0])]) + 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 + CPPFLAGS=$opal_check_libfabric_$1_save_CPPFLAGS + LDFLAGS=$opal_check_libfabric_$1_save_LDFLAGS + LIBS=$opal_check_libfabric_$1_save_LIBS - AC_SUBST($1_CPPFLAGS) - AC_SUBST($1_LDFLAGS) - AC_SUBST($1_LIBS) + OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics Libfabric]],[$1],[$opal_check_libfabric_happy]) - AS_IF([test $opal_check_libfabric_happy -eq 1], + OPAL_VAR_SCOPE_POP + fi + + 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" + + AC_SUBST($1_CPPFLAGS) + AC_SUBST($1_LDFLAGS) + AC_SUBST($1_LIBS) + 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.]) AC_MSG_ERROR([Cannot continue.])]) $3]) - - OPAL_VAR_SCOPE_POP ])dnl diff --git a/config/opal_check_openfabrics.m4 b/config/opal_check_openfabrics.m4 index 60d61d08b90..0ead428eb56 100644 --- a/config/opal_check_openfabrics.m4 +++ b/config/opal_check_openfabrics.m4 @@ -10,14 +10,14 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. -# Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights +# Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2016 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved. # Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. # Copyright (c) 2014 Bull SAS. All rights reserved. -# Copyright (c) 2014-2016 Research Organization for Information Science +# Copyright (c) 2014-2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. # $COPYRIGHT$ # @@ -38,253 +38,265 @@ AC_DEFUN([OPAL_CHECK_OPENFABRICS],[ # verbs stuff lives. AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) - # - # Add padding to OpenIB header - # - AC_ARG_ENABLE([openib-control-hdr-padding], - [AC_HELP_STRING([--enable-openib-control-hdr-padding], - [Add padding bytes to the openib BTL control header (default:disabled)])]) - AC_MSG_CHECKING([if want to add padding to the openib BTL control header]) - if test "$enable_openib_control_hdr_padding" = "yes"; then - AC_MSG_RESULT([yes]) - ompi_openib_pad_hdr=1 - elif test "$enable_openib_control_hdr_padding" = "no"; then - AC_MSG_RESULT([no]) - ompi_openib_pad_hdr=0 - else - # - # Enable padding for SPARC platforms by default because the - # btl will segv otherwise. Keep padding disabled for other - # platforms since there are some performance implications with - # padding on for those plaforms. - # - case "${host}" in - sparc*) - AC_MSG_RESULT([yes (enabled by default on SPARC)]) + if test -z "$opal_check_openib_happy" ; then + # + # Add padding to OpenIB header + # + AC_ARG_ENABLE([openib-control-hdr-padding], + [AC_HELP_STRING([--enable-openib-control-hdr-padding], + [Add padding bytes to the openib BTL control header (default:disabled)])]) + AC_MSG_CHECKING([if want to add padding to the openib BTL control header]) + if test "$enable_openib_control_hdr_padding" = "yes"; then + AC_MSG_RESULT([yes]) ompi_openib_pad_hdr=1 - ;; - *) + elif test "$enable_openib_control_hdr_padding" = "no"; then AC_MSG_RESULT([no]) ompi_openib_pad_hdr=0 - ;; - esac - fi - AC_DEFINE_UNQUOTED([OPAL_OPENIB_PAD_HDR], [$ompi_openib_pad_hdr], - [Add padding bytes to the openib BTL control header]) - - AS_IF([test "$opal_want_verbs" = "no"], - [ompi_check_openib_happy="no"], - [ompi_check_openib_happy="yes"]) - - ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_openib_$1_save_LIBS="$LIBS" - - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [AC_CHECK_HEADERS( - fcntl.h sys/poll.h, - [], - [AC_MSG_WARN([fcntl.h sys/poll.h not found. Can not build component.]) - ompi_check_openib_happy="no"])]) - - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [OPAL_CHECK_PACKAGE([$1], - [infiniband/verbs.h], - [ibverbs], - [ibv_open_device], - [], - [$opal_verbs_dir], - [$opal_verbs_libdir], - [ompi_check_openib_happy="yes"], - [ompi_check_openib_happy="no"])]) + else + # + # Enable padding for SPARC platforms by default because the + # btl will segv otherwise. Keep padding disabled for other + # platforms since there are some performance implications with + # padding on for those plaforms. + # + case "${host}" in + sparc*) + AC_MSG_RESULT([yes (enabled by default on SPARC)]) + ompi_openib_pad_hdr=1 + ;; + *) + AC_MSG_RESULT([no]) + ompi_openib_pad_hdr=0 + ;; + esac + fi + AC_DEFINE_UNQUOTED([OPAL_OPENIB_PAD_HDR], [$ompi_openib_pad_hdr], + [Add padding bytes to the openib BTL control header]) + + AS_IF([test "$opal_want_verbs" = "no"], + [opal_check_openib_happy="no"], + [opal_check_openib_happy="yes"]) + + ompi_check_openib_$1_save_CPPFLAGS="$CPPFLAGS" + ompi_check_openib_$1_save_LDFLAGS="$LDFLAGS" + ompi_check_openib_$1_save_LIBS="$LIBS" + + AS_IF([test "$opal_check_openib_happy" = "yes"], + [AC_CHECK_HEADERS( + fcntl.h sys/poll.h, + [], + [AC_MSG_WARN([fcntl.h sys/poll.h not found. Can not build component.]) + opal_check_openib_happy="no"])]) + + AS_IF([test "$opal_check_openib_happy" = "yes"], + [OPAL_CHECK_PACKAGE([opal_check_openib], + [infiniband/verbs.h], + [ibverbs], + [ibv_open_device], + [], + [$opal_verbs_dir], + [$opal_verbs_libdir], + [opal_check_openib_happy="yes"], + [opal_check_openib_happy="no"])]) + + CPPFLAGS="$CPPFLAGS $opal_check_openib_CPPFLAGS" + LDFLAGS="$LDFLAGS $opal_check_openib_LDFLAGS" + LIBS="$LIBS $opal_check_openib_LIBS" + + AS_IF([test "$opal_check_openib_happy" = "yes"], + [AC_CACHE_CHECK( + [number of arguments to ibv_create_cq], + [ompi_cv_func_ibv_create_cq_args], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ibv_create_cq(NULL, 0, NULL, NULL, 0);]])], + [ompi_cv_func_ibv_create_cq_args=5], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ibv_create_cq(NULL, 0, NULL);]])], + [ompi_cv_func_ibv_create_cq_args=3], + [ompi_cv_func_ibv_create_cq_args="unknown"])])]) + AS_IF([test "$ompi_cv_func_ibv_create_cq_args" = "unknown"], + [AC_MSG_WARN([Can not determine number of args to ibv_create_cq.]) + AC_MSG_WARN([Not building component.]) + opal_check_openib_happy="no"], + [AC_DEFINE_UNQUOTED([OPAL_IBV_CREATE_CQ_ARGS], + [$ompi_cv_func_ibv_create_cq_args], + [Number of arguments to ibv_create_cq])])]) + + # + # OpenIB dynamic SL + # + AC_ARG_ENABLE([openib-dynamic-sl], + [AC_HELP_STRING([--enable-openib-dynamic-sl], + [Enable openib BTL to query Subnet Manager for IB SL (default: enabled)])]) + + # Set these up so that we can do an AC_DEFINE below + # (unconditionally) + opal_check_openib_have_xrc=0 + opal_check_openib_have_xrc_domains=0 + opal_check_openib_have_opensm_devel=0 + + # If we have the openib stuff available, find out what we've got + AS_IF([test "$opal_check_openib_happy" = "yes"], + [AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO, IBV_ATOMIC_HCA], [], [], + [#include ]) + AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq]) + + # struct ibv_device.transport_type was added in OFED v1.2 + AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [], + [#include ]) + + # We have to check functions both exits *and* are declared + # since some distro ship broken ibverbs devel headers + # IBV_DEVICE_XRC is common to all OFED versions + # ibv_create_xrc_rcv_qp was added in OFED 1.3 + # ibv_cmd_open_xrcd (aka XRC Domains) was added in OFED 3.12 + if test "$enable_connectx_xrc" = "yes"; then + AC_CHECK_DECLS([IBV_DEVICE_XRC], + [opal_check_openib_have_xrc=1 + opal_check_openib_have_xrc_domains=1], + [], + [#include ]) + fi + if test "$enable_connectx_xrc" = "yes" \ + && test $opal_check_openib_have_xrc -eq 1; then + AC_CHECK_DECLS([ibv_create_xrc_rcv_qp], + [AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], + [], [opal_check_openib_have_xrc=0])], + [opal_check_openib_have_xrc=0], + [#include ]) + fi + if test "$enable_connectx_xrc" = "yes" \ + && test $opal_check_openib_have_xrc_domains -eq 1; then + AC_CHECK_DECLS([ibv_cmd_open_xrcd], + [AC_CHECK_DECLS([IBV_SRQT_XRC], + [AC_CHECK_FUNCS([ibv_cmd_open_xrcd], + [], [opal_check_openib_have_xrc_domains=0])], + [opal_check_openib_have_xrc_domains=0], + [#include ])], + [opal_check_openib_have_xrc_domains=0], + [#include ]) + # XRC and XRC Domains should be considered as exclusive + if test "$opal_check_openib_have_xrc" -eq 1 && \ + test "$opal_check_openib_have_xrc_domains" -eq 1; then + opal_check_openib_have_xrc=0 + fi + fi - CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS" - LDFLAGS="$LDFLAGS $$1_LDFLAGS" - LIBS="$LIBS $$1_LIBS" + if test "no" != "$enable_openib_dynamic_sl"; then + # We need ib_types.h file, which is installed with opensm-devel + # package. However, ib_types.h has a bad include directive, + # which will cause AC_CHECK_HEADER to fail. + # So instead, we will look for another file that is also + # installed as part of opensm-devel package and included in + # ib_types.h, but it doesn't include any other IB-related files. + AC_CHECK_HEADER([infiniband/complib/cl_types_osd.h], + [AC_CHECK_LIB([osmcomp], [cl_map_init], + [opal_check_openib_have_opensm_devel=1],[])], + [], + []) + # Abort if dynamic SL support was explicitly requested but opensm-devel + # package wasn't found. Otherwise, OMPI will be built w/o dynamic SL. + AC_MSG_CHECKING([if can use dynamic SL support]) + AS_IF([test "$opal_check_openib_have_opensm_devel" = "1"], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AS_IF([test "$enable_openib_dynamic_sl" = "yes"], + [AC_MSG_WARN([--enable-openib-dynamic-sl was specified but the]) + AC_MSG_WARN([appropriate header/library files could not be found]) + AC_MSG_WARN([Please install opensm-devel if you need dynamic SL support]) + AC_MSG_ERROR([Cannot continue])])]) + fi - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [AC_CACHE_CHECK( - [number of arguments to ibv_create_cq], - [ompi_cv_func_ibv_create_cq_args], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[ibv_create_cq(NULL, 0, NULL, NULL, 0);]])], - [ompi_cv_func_ibv_create_cq_args=5], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[ibv_create_cq(NULL, 0, NULL);]])], - [ompi_cv_func_ibv_create_cq_args=3], - [ompi_cv_func_ibv_create_cq_args="unknown"])])]) - AS_IF([test "$ompi_cv_func_ibv_create_cq_args" = "unknown"], - [AC_MSG_WARN([Can not determine number of args to ibv_create_cq.]) - AC_MSG_WARN([Not building component.]) - ompi_check_openib_happy="no"], - [AC_DEFINE_UNQUOTED([OPAL_IBV_CREATE_CQ_ARGS], - [$ompi_cv_func_ibv_create_cq_args], - [Number of arguments to ibv_create_cq])])]) - # - # OpenIB dynamic SL - # - AC_ARG_ENABLE([openib-dynamic-sl], - [AC_HELP_STRING([--enable-openib-dynamic-sl], - [Enable openib BTL to query Subnet Manager for IB SL (default: enabled)])]) - - # Set these up so that we can do an AC_DEFINE below - # (unconditionally) - $1_have_xrc=0 - $1_have_xrc_domains=0 - $1_have_opensm_devel=0 - - # If we have the openib stuff available, find out what we've got - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO, IBV_ATOMIC_HCA], [], [], - [#include ]) - AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq]) - - # struct ibv_device.transport_type was added in OFED v1.2 - AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [], - [#include ]) - - # We have to check functions both exits *and* are declared - # since some distro ship broken ibverbs devel headers - # IBV_DEVICE_XRC is common to all OFED versions - # ibv_create_xrc_rcv_qp was added in OFED 1.3 - # ibv_cmd_open_xrcd (aka XRC Domains) was added in OFED 3.12 - if test "$enable_connectx_xrc" = "yes"; then - AC_CHECK_DECLS([IBV_DEVICE_XRC], - [$1_have_xrc=1 - $1_have_xrc_domains=1], - [], + # Check support for RDMAoE devices + $1_have_rdmaoe=0 + AC_CHECK_DECLS([IBV_LINK_LAYER_ETHERNET], + [$1_have_rdmaoe=1], [], [#include ]) - fi - if test "$enable_connectx_xrc" = "yes" \ - && test $$1_have_xrc -eq 1; then - AC_CHECK_DECLS([ibv_create_xrc_rcv_qp], - [AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], - [], [$1_have_xrc=0])], - [$1_have_xrc=0], - [#include ]) - fi - if test "$enable_connectx_xrc" = "yes" \ - && test $$1_have_xrc_domains -eq 1; then - AC_CHECK_DECLS([ibv_cmd_open_xrcd], - [AC_CHECK_DECLS([IBV_SRQT_XRC], - [AC_CHECK_FUNCS([ibv_cmd_open_xrcd], - [], [$1_have_xrc_domains=0])], - [$1_have_xrc_domains=0], - [#include ])], - [$1_have_xrc_domains=0], - [#include ]) - # XRC and XRC Domains should be considered as exclusive - if test "$$1_have_xrc" -eq 1 && \ - test "$$1_have_xrc_domains" -eq 1; then - $1_have_xrc=0 - fi - fi - - if test "no" != "$enable_openib_dynamic_sl"; then - # We need ib_types.h file, which is installed with opensm-devel - # package. However, ib_types.h has a bad include directive, - # which will cause AC_CHECK_HEADER to fail. - # So instead, we will look for another file that is also - # installed as part of opensm-devel package and included in - # ib_types.h, but it doesn't include any other IB-related files. - AC_CHECK_HEADER([infiniband/complib/cl_types_osd.h], - [AC_CHECK_LIB([osmcomp], [cl_map_init], - [$1_have_opensm_devel=1],[])], - [], - []) - # Abort if dynamic SL support was explicitly requested but opensm-devel - # package wasn't found. Otherwise, OMPI will be built w/o dynamic SL. - AC_MSG_CHECKING([if can use dynamic SL support]) - AS_IF([test "$$1_have_opensm_devel" = "1"], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AS_IF([test "$enable_openib_dynamic_sl" = "yes"], - [AC_MSG_WARN([--enable-openib-dynamic-sl was specified but the]) - AC_MSG_WARN([appropriate header/library files could not be found]) - AC_MSG_WARN([Please install opensm-devel if you need dynamic SL support]) - AC_MSG_ERROR([Cannot continue])])]) - fi + AC_MSG_CHECKING([if RDMAoE support is enabled]) + AC_DEFINE_UNQUOTED([OPAL_HAVE_RDMAOE], [$$1_have_rdmaoe], [Enable RDMAoE support]) + if test "1" = "$$1_have_rdmaoe"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi - # Check support for RDMAoE devices - $1_have_rdmaoe=0 - AC_CHECK_DECLS([IBV_LINK_LAYER_ETHERNET], - [$1_have_rdmaoe=1], [], - [#include ]) + ]) + + # Check to see if works. It is known to + # create problems on some platforms with some compilers (e.g., + # RHEL4U3 with the PGI 32 bit compiler). Use undocumented (in AC + # 2.63) feature of AC_CHECK_HEADERS: if you explicitly pass in + # AC_INCLUDES_DEFAULT as the 4th arg to AC_CHECK_HEADERS, the test + # will fail if the header is present but not compilable, *but it + # will not print the big scary warning*. See + # http://lists.gnu.org/archive/html/autoconf/2008-10/msg00143.html. + AS_IF([test "$opal_check_openib_happy" = "yes"], + [AC_CHECK_HEADERS([infiniband/driver.h], [], [], + [AC_INCLUDES_DEFAULT])]) + + AC_MSG_CHECKING([if ConnectX XRC support is enabled]) + AC_DEFINE_UNQUOTED([OPAL_HAVE_CONNECTX_XRC], [$opal_check_openib_have_xrc], + [Enable features required for ConnectX XRC support]) + if test "1" = "$opal_check_openib_have_xrc"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([if ConnectIB XRC support is enabled]) + AC_DEFINE_UNQUOTED([OPAL_HAVE_CONNECTX_XRC_DOMAINS], [$opal_check_openib_have_xrc_domains], + [Enable features required for XRC domains support]) + if test "1" = "$opal_check_openib_have_xrc_domains"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([if dynamic SL is enabled]) + AC_DEFINE_UNQUOTED([OPAL_ENABLE_DYNAMIC_SL], [$opal_check_openib_have_opensm_devel], + [Enable features required for dynamic SL support]) + if test "1" = "$opal_check_openib_have_opensm_devel"; then + AC_MSG_RESULT([yes]) + $1_LIBS="-losmcomp $$1_LIBS" + else + AC_MSG_RESULT([no]) + fi - AC_MSG_CHECKING([if RDMAoE support is enabled]) - AC_DEFINE_UNQUOTED([OPAL_HAVE_RDMAOE], [$$1_have_rdmaoe], [Enable RDMAoE support]) - if test "1" = "$$1_have_rdmaoe"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi + AS_IF([test -z "$opal_verbs_dir"], + [openib_include_dir="/usr/include"], + [openib_include_dir="$opal_verbs_dir/include"]) + opal_check_openib_CPPFLAGS="$opal_check_openib_CPPFLAGS -I$openib_include_dir/infiniband" - ]) - - # Check to see if works. It is known to - # create problems on some platforms with some compilers (e.g., - # RHEL4U3 with the PGI 32 bit compiler). Use undocumented (in AC - # 2.63) feature of AC_CHECK_HEADERS: if you explicitly pass in - # AC_INCLUDES_DEFAULT as the 4th arg to AC_CHECK_HEADERS, the test - # will fail if the header is present but not compilable, *but it - # will not print the big scary warning*. See - # http://lists.gnu.org/archive/html/autoconf/2008-10/msg00143.html. - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [AC_CHECK_HEADERS([infiniband/driver.h], [], [], - [AC_INCLUDES_DEFAULT])]) - - AC_MSG_CHECKING([if ConnectX XRC support is enabled]) - AC_DEFINE_UNQUOTED([OPAL_HAVE_CONNECTX_XRC], [$$1_have_xrc], - [Enable features required for ConnectX XRC support]) - if test "1" = "$$1_have_xrc"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi + CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS" + LIBS="$ompi_check_openib_$1_save_LIBS" - AC_MSG_CHECKING([if ConnectIB XRC support is enabled]) - AC_DEFINE_UNQUOTED([OPAL_HAVE_CONNECTX_XRC_DOMAINS], [$$1_have_xrc_domains], - [Enable features required for XRC domains support]) - if test "1" = "$$1_have_xrc_domains"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi + OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics Verbs]],[$1],[$opal_check_openib_happy]) - AC_MSG_CHECKING([if dynamic SL is enabled]) - AC_DEFINE_UNQUOTED([OPAL_ENABLE_DYNAMIC_SL], [$$1_have_opensm_devel], - [Enable features required for dynamic SL support]) - if test "1" = "$$1_have_opensm_devel"; then - AC_MSG_RESULT([yes]) - $1_LIBS="-losmcomp $$1_LIBS" - else - AC_MSG_RESULT([no]) + OPAL_VAR_SCOPE_POP fi - AS_IF([test -z "$opal_verbs_dir"], - [openib_include_dir="/usr/include"], - [openib_include_dir="$opal_verbs_dir/include"]) - $1_CPPFLAGS="$$1_CPPFLAGS -I$openib_include_dir/infiniband" - - CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS" - LIBS="$ompi_check_openib_$1_save_LIBS" + $1_have_xrc=$opal_check_openib_have_xrc + $1_have_xrc_domains=$opal_check_openib_have_xrc_domains + $1_have_opensm_devel=$opal_check_openib_have_opensm_devel - AS_IF([test "$ompi_check_openib_happy" = "yes"], - [$2], + AS_IF([test "$opal_check_openib_happy" = "yes"], + [$1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_openib_CPPFLAGS" + $1_LDFLAGS="[$]$1_LDFLAGS $opal_check_openib_LDFLAGS" + $1_LIBS="[$]$1_LIBS $opal_check_openib_LIBS" + $2], [AS_IF([test "$opal_want_verbs" = "yes"], [AC_MSG_WARN([Verbs support requested (via --with-verbs) but not found.]) AC_MSG_WARN([If you are using libibverbs v1.0 (i.e., OFED v1.0 or v1.1), you *MUST* have both the libsysfs headers and libraries installed. Later versions of libibverbs do not require libsysfs.]) AC_MSG_ERROR([Aborting.])]) $3]) - OPAL_VAR_SCOPE_POP ]) AC_DEFUN([OPAL_CHECK_OPENFABRICS_CM_ARGS],[ @@ -332,7 +344,7 @@ AC_DEFUN([OPAL_CHECK_OPENFABRICS_CM],[ LDFLAGS="$LDFLAGS $$1_LDFLAGS" LIBS="$LIBS $$1_LIBS" - AS_IF([test "$ompi_check_openib_happy" = "yes"], + AS_IF([test "$opal_check_openib_happy" = "yes"], [# Do we have a recent enough RDMA CM? Need to have the # rdma_get_peer_addr (inline) function (originally appeared # in OFED v1.3). @@ -400,9 +412,9 @@ AC_DEFUN([OPAL_CHECK_EXP_VERBS],[ AC_DEFINE_UNQUOTED([HAVE_EXP_VERBS], [$have_struct_ibv_exp_send_wr], [Experimental verbs]) AC_CHECK_DECLS([IBV_EXP_ATOMIC_HCA_REPLY_BE, IBV_EXP_QP_CREATE_ATOMIC_BE_REPLY, ibv_exp_create_qp, ibv_exp_query_device, IBV_EXP_QP_INIT_ATTR_ATOMICS_ARG], [], [], [#include ]) - AC_CHECK_MEMBERS([struct ibv_exp_device_attr.ext_atom, struct ibv_exp_device_attr.exp_atomic_cap], [], [], + AC_CHECK_MEMBERS([struct ibv_exp_device_attr.ext_atom, struct ibv_exp_device_attr.ext_atomic_cap], [], [], [[#include ]]) - AS_IF([test '$have_struct_ibv_exp_send_wr' = 1], [$1], [$2]) +AS_IF([test '$have_struct_ibv_exp_send_wr' = 1], [$1], [$2]) OPAL_VAR_SCOPE_POP ])dnl @@ -410,7 +422,7 @@ AC_DEFUN([OPAL_CHECK_MLNX_OPENFABRICS],[ $1_have_mverbs=0 $1_have_mqe=0 - AS_IF([test "$ompi_check_openib_happy" = "yes"], + AS_IF([test "$opal_check_openib_happy" = "yes"], [OPAL_CHECK_PACKAGE([$1], [infiniband/mverbs.h], [mverbs], @@ -421,7 +433,7 @@ AC_DEFUN([OPAL_CHECK_MLNX_OPENFABRICS],[ [$1_have_mverbs=1], [])]) - AS_IF([test "$ompi_check_openib_happy" = "yes"], + AS_IF([test "$opal_check_openib_happy" = "yes"], [OPAL_CHECK_PACKAGE([$1], [infiniband/mqe.h], [mqe], diff --git a/config/opal_check_portals4.m4 b/config/opal_check_portals4.m4 index d8a27ffe8ef..086bb3f665d 100644 --- a/config/opal_check_portals4.m4 +++ b/config/opal_check_portals4.m4 @@ -11,9 +11,11 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2006 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2006 QLogic Corp. All rights reserved. -dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. +dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights +dnl reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -27,72 +29,79 @@ dnl # LDFLAGS, LIBS} as needed and runs action-if-found if there is # support, otherwise executes action-if-not-found AC_DEFUN([OPAL_CHECK_PORTALS4],[ - AC_ARG_WITH([portals4], - [AC_HELP_STRING([--with-portals4(=DIR)], - [Build Portals4 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) - OPAL_CHECK_WITHDIR([portals4], [$with_portals4], [include/portals4.h]) - AC_ARG_WITH([portals4-libdir], - [AC_HELP_STRING([--with-portals4-libdir=DIR], - [Search for Portals4 libraries in DIR])]) - OPAL_CHECK_WITHDIR([portals4-libdir], [$with_portals4_libdir], [libportals.*]) + if test -z "$ompi_check_portals4_happy" ; then + AC_ARG_WITH([portals4], + [AC_HELP_STRING([--with-portals4(=DIR)], + [Build Portals4 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + OPAL_CHECK_WITHDIR([portals4], [$with_portals4], [include/portals4.h]) + AC_ARG_WITH([portals4-libdir], + [AC_HELP_STRING([--with-portals4-libdir=DIR], + [Search for Portals4 libraries in DIR])]) + OPAL_CHECK_WITHDIR([portals4-libdir], [$with_portals4_libdir], [libportals.*]) - ompi_check_portals4_$1_save_CPPFLAGS="$CPPFLAGS" - ompi_check_portals4_$1_save_LDFLAGS="$LDFLAGS" - ompi_check_portals4_$1_save_LIBS="$LIBS" + ompi_check_portals4_$1_save_CPPFLAGS="$CPPFLAGS" + ompi_check_portals4_$1_save_LDFLAGS="$LDFLAGS" + ompi_check_portals4_$1_save_LIBS="$LIBS" - AS_IF([test "$with_portals4" != "no"], - [AS_IF([test ! -z "$with_portals4" && test "$with_portals4" != "yes"], - [ompi_check_portals4_dir="$with_portals4"]) - AS_IF([test ! -z "$with_portals4_libdir" && test "$with_portals4_libdir" != "yes"], - [ompi_check_portals4_libdir="$with_portals4_libdir"]) + AS_IF([test "$with_portals4" != "no"], + [AS_IF([test ! -z "$with_portals4" && test "$with_portals4" != "yes"], + [ompi_check_portals4_dir="$with_portals4"]) + AS_IF([test ! -z "$with_portals4_libdir" && test "$with_portals4_libdir" != "yes"], + [ompi_check_portals4_libdir="$with_portals4_libdir"]) - OPAL_CHECK_PACKAGE([$1], - [portals4.h], - [portals], - [PtlLEAppend], - [], - [$ompi_check_portals4_dir], - [$ompi_check_portals4_libdir], - [ompi_check_portals4_happy="yes"], - [ompi_check_portals4_happy="no"])], - [ompi_check_portals4_happy="no"]) + OPAL_CHECK_PACKAGE([opal_check_portals4], + [portals4.h], + [portals], + [PtlLEAppend], + [], + [$ompi_check_portals4_dir], + [$ompi_check_portals4_libdir], + [ompi_check_portals4_happy="yes"], + [ompi_check_portals4_happy="no"])], + [ompi_check_portals4_happy="no"]) - CPPFLAGS="$ompi_check_portals4_$1_save_CPPFLAGS" - LDFLAGS="$ompi_check_portals4_$1_save_LDFLAGS" - LIBS="$ompi_check_portals4_$1_save_LIBS" + CPPFLAGS="$ompi_check_portals4_$1_save_CPPFLAGS" + LDFLAGS="$ompi_check_portals4_$1_save_LDFLAGS" + LIBS="$ompi_check_portals4_$1_save_LIBS" - max_md_size=0 - AC_ARG_WITH([portals4-max-md-size], - [AC_HELP_STRING([--with-portals4-max-md-size=SIZE], - [Log base 2 of the maximum size in bytes of a memory descriptor. Should only be set for implementations which do not support binding all of virtual address space.])]) - AS_IF([test "$with_portals4_max_md_size" = "yes" || test "$with_portals4_max_md_size" = "no"], - [AC_MSG_ERROR([--with-portals4-max-md-size requires an integer argument])], - [AS_IF([test -n "$with_portals4_max_md_size"], - [max_md_size="$with_portals4_max_md_size"])]) - AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_MD_SIZE], [$max_md_size], - [Log base 2 of the maximum size in bytes of a memory descriptor. Set to 0 if MD can bind all of memory.]) + max_md_size=0 + AC_ARG_WITH([portals4-max-md-size], + [AC_HELP_STRING([--with-portals4-max-md-size=SIZE], + [Log base 2 of the maximum size in bytes of a memory descriptor. Should only be set for implementations which do not support binding all of virtual address space.])]) + AS_IF([test "$with_portals4_max_md_size" = "yes" || test "$with_portals4_max_md_size" = "no"], + [AC_MSG_ERROR([--with-portals4-max-md-size requires an integer argument])], + [AS_IF([test -n "$with_portals4_max_md_size"], + [max_md_size="$with_portals4_max_md_size"])]) + AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_MD_SIZE], [$max_md_size], + [Log base 2 of the maximum size in bytes of a memory descriptor. Set to 0 if MD can bind all of memory.]) - max_va_size=0 - AC_ARG_WITH([portals4-max-va-size], - [AC_HELP_STRING([--with-portals4-max-va-size=SIZE], - [Log base 2 of the maximum size in bytes of the user virtual address space. Should only be set for implementations which do not support binding all of virtual address space.])]) - AS_IF([test "$with_portals4_max_va_size" = "yes" || test "$with_portals4_max_va_size" = "no"], - [AC_MSG_ERROR([--with-portals4-max-va-size requires an integer argument])], - [AS_IF([test -n "$with_portals4_max_va_size"], - [max_va_size="$with_portals4_max_va_size"])]) - AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_VA_SIZE], [$max_va_size], - [Log base 2 of the maximum size in bytes of the user virtual address space. Set to 0 if MD can bind all of memory.]) + max_va_size=0 + AC_ARG_WITH([portals4-max-va-size], + [AC_HELP_STRING([--with-portals4-max-va-size=SIZE], + [Log base 2 of the maximum size in bytes of the user virtual address space. Should only be set for implementations which do not support binding all of virtual address space.])]) + AS_IF([test "$with_portals4_max_va_size" = "yes" || test "$with_portals4_max_va_size" = "no"], + [AC_MSG_ERROR([--with-portals4-max-va-size requires an integer argument])], + [AS_IF([test -n "$with_portals4_max_va_size"], + [max_va_size="$with_portals4_max_va_size"])]) + AC_DEFINE_UNQUOTED([OPAL_PORTALS4_MAX_VA_SIZE], [$max_va_size], + [Log base 2 of the maximum size in bytes of the user virtual address space. Set to 0 if MD can bind all of memory.]) - AS_IF([(test $max_md_size -eq 0 && test $max_va_size -ne 0 ) || (test $max_md_size -ne 0 && test $max_va_size -eq 0 )], + AS_IF([(test $max_md_size -eq 0 && test $max_va_size -ne 0 ) || (test $max_md_size -ne 0 && test $max_va_size -eq 0 )], [AC_ERROR([If either --with-portals4-max-md-size or --with-portals4-max-va-size is set, both must be set.])]) - AS_IF([test $max_md_size -ge $max_va_size], - [max_md_size=0 - max_va_size=0]) - AS_IF([test $max_md_size -ne 0 && test $max_va_size -ne 0], - [AC_MSG_NOTICE([Portals 4 address space size: $max_md_size, $max_va_size])]) + AS_IF([test $max_md_size -ge $max_va_size], + [max_md_size=0 + max_va_size=0]) + AS_IF([test $max_md_size -ne 0 && test $max_va_size -ne 0], + [AC_MSG_NOTICE([Portals 4 address space size: $max_md_size, $max_va_size])]) + + OPAL_SUMMARY_ADD([[Transports]],[[Portals4]],[$1],[$ompi_check_portals4_happy]) + fi AS_IF([test "$ompi_check_portals4_happy" = "yes"], - [$2], + [$1_LDFLAGS="[$]$1_LDFLAGS $opal_check_portals4_LDFLAGS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_portals4_CPPFLAGS" + $1_LIBS="[$]$1_LIBS $opal_check_portals4_LIBS" + $2], [AS_IF([test ! -z "$with_portals4" && test "$with_portals4" != "no"], [AC_MSG_ERROR([Portals4 support requested but not found. Aborting])]) $3]) diff --git a/config/opal_check_ugni.m4 b/config/opal_check_ugni.m4 index 6acc7fa74b3..6ae8bc25d6e 100644 --- a/config/opal_check_ugni.m4 +++ b/config/opal_check_ugni.m4 @@ -1,4 +1,4 @@ -dnl -*- Mode: Shell ; indent-tabs-mode:nil -*- +dnl -*- Mode: Shell-script ; indent-tabs-mode:nil -*- dnl dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana dnl University Research and Technology @@ -11,9 +11,9 @@ dnl University of Stuttgart. All rights reserved. dnl Copyright (c) 2004-2006 The Regents of the University of California. dnl All rights reserved. dnl Copyright (c) 2006 QLogic Corp. All rights reserved. -dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. -dnl Copyright (c) 2011-2014 Los Alamos National Security, LLC. -dnl All rights reserved. +dnl Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights +dnl reserved. dnl Copyright (c) 2014 Intel, Inc. All rights reserved dnl Copyright (c) 2015 Research Organization for Information Science dnl and Technology (RIST). All rights reserved. @@ -32,25 +32,24 @@ dnl # AC_DEFUN([OPAL_CHECK_UGNI], [ - AC_ARG_WITH([ugni], [AC_HELP_STRING([--with-ugni], - [Build support for Cray GNI. Set PKG_CONFIG_PATH env. variable to specify alternate path.])]) + if test -z "$opal_check_ugni_happy" ; then + AC_ARG_WITH([ugni], [AC_HELP_STRING([--with-ugni], + [Build support for Cray GNI. Set PKG_CONFIG_PATH env. variable to specify alternate path.])]) - opal_check_ugni_happy="no" + opal_check_ugni_happy="no" - AS_IF([test "$with_ugni" = "no"], - [opal_check_ugni_happy="no"], - [PKG_CHECK_MODULES([CRAY_UGNI], [cray-ugni], - [$1_LDFLAGS="$CRAY_UGNI_LIBS" - $1_CPPFLAGS="$CRAY_UGNI_CFLAGS" - opal_check_ugni_happy="yes"], - [ opal_check_ugni_happy="no"])]) + AS_IF([test "$with_ugni" = "no"], + [opal_check_ugni_happy="no"], + [PKG_CHECK_MODULES([CRAY_UGNI], [cray-ugni], + [opal_check_ugni_happy="yes"], + [opal_check_ugni_happy="no"])]) - opal_check_ugni_$1_save_CPPFLAGS="$CPPFLAGS" - opal_check_ugni_$1_save_LDFLAGS="$LDFLAGS" - opal_check_ugni_$1_save_LIBS="$LIBS" + opal_check_ugni_$1_save_CPPFLAGS="$CPPFLAGS" + opal_check_ugni_$1_save_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS" - LDFLAGS="$LDFLAGS $$1_LDFLAGS" + if test "$opal_check_ugni_happy" = "yes" ; then + CPPFLAGS="$CPPFLAGS $CRAY_UGNI_CFLAGS" + LIBS="$LIBS $CRAY_UGNI_LIBS" # echo "+++++++++++++++++++++++CPPFLAGS",$CPPFLAGS # echo "+++++++++++++++++++++++LDFLAGSS",$LDFLAGS # echo "+++++++++++++++++++++++1_CPPFLAGS",$$1_CPPFLAGS @@ -58,23 +57,24 @@ AC_DEFUN([OPAL_CHECK_UGNI], [ # sanity checks - AS_IF([test "$opal_check_ugni_happy" = "yes"], - [AC_CHECK_HEADER([gni_pub.h],[],AC_MSG_ERROR(['gni_pub.h not found.'])) - AC_CHECK_FUNCS([GNI_GetJobResInfo])]) + AC_CHECK_HEADER([gni_pub.h],[],AC_MSG_ERROR(['gni_pub.h not found.'])) + AC_CHECK_FUNCS([GNI_GetJobResInfo]) -# AS_IF([test "$opal_check_ugni_happy" = "yes"], -# [AC_CHECK_FUNCS([GNI_GetJobResInfo])]) + CPPFLAGS="$opal_check_ugni_$1_save_CPPFLAGS" + LIBS="$opal_check_ugni_$1_save_LIBS" + fi - CPPFLAGS="$opal_check_ugni_$1_save_CPPFLAGS" - LDFLAGS="$opal_check_ugni_$1_save_LDFLAGS" - LIBS="$opal_check_ugni_$1_save_LIBS" + AS_IF([test "$opal_check_ugni_happy" = "yes" && test "$enable_progress_threads" = "yes"], + [AC_MSG_WARN([GNI driver does not currently support progress threads. Disabling.]) + opal_check_ugni_happy="no"]) - AS_IF([test "$opal_check_ugni_happy" = "yes" && test "$enable_progress_threads" = "yes"], - [AC_MSG_WARN([GNI driver does not currently support progress threads. Disabling.]) - opal_check_ugni_happy="no"]) + OPAL_SUMMARY_ADD([[Transports]],[[Cray uGNI (Gemini/Aries)]],[$1],[$opal_check_ugni_happy]) + fi AS_IF([test "$opal_check_ugni_happy" = "yes"], - [$2], + [$1_CPPFLAGS="[$]$1_CPPFLAGS $CRAY_UGNI_CFLAGS" + $1_LIBS="[$]$1_LIBS $CRAY_UGNI_LIBS" + $2], [AS_IF([test ! -z "$with_ugni" && test "$with_ugni" != "no"], [AC_MSG_ERROR([GNI support requested but not found. Cannot continue.])]) $3]) diff --git a/config/opal_check_xpmem.m4 b/config/opal_check_xpmem.m4 new file mode 100644 index 00000000000..ee1fd42027a --- /dev/null +++ b/config/opal_check_xpmem.m4 @@ -0,0 +1,112 @@ +# -*- shell-script ; indent-tabs-mode:nil -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana +# University Research and Technology +# Corporation. All rights reserved. +# Copyright (c) 2004-2005 The University of Tennessee and The University +# of Tennessee Research Foundation. All rights +# reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2011-2016 Los Alamos National Security, LLC. All rights +# reserved. +# Copyright (c) 2014 Intel, Inc. All rights reserved. +# Copyright (c) 2014-2015 Research Organization for Information Science +# and Technology (RIST). All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# +# special check for cray xpmem, uses macro(s) from pkg.m4 +# +# OPAL_CHECK_CRAY_XPMEM(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +AC_DEFUN([OPAL_CHECK_CRAY_XPMEM],[ + if test -z "$opal_check_cray_xpmem_happy" ; then + AC_ARG_WITH([cray_xpmem], + [AC_HELP_STRING([--with-cray-xpmem(=yes/no)], + [Build Cray XPMEM support(default: auto)])], + [], with_cray_xpmem=auto) + + AC_MSG_CHECKING([for Cray XPMEM support]) + AS_IF([test "$with_cray_xpmem" = "no"], + [AC_MSG_RESULT([no]) + $3], + [AS_IF([test "$with_cray_xpmem" = "auto" || test "$with_cray_xpmem" = "yes"], + [PKG_CHECK_MODULES_STATIC([CRAY_XPMEM], [cray-xpmem], + [opal_check_cray_xpmem_happy="yes"], + [opal_check_cray_xpmem_happy="no"] + [AS_IF([test "$with_cray_xpmem" = "yes"], + [AC_MSG_WARN([Cray XPMEM support requested but pkg-config failed.]) + AC_MSG_ERROR([Aborting])],[])] + )], + []) + ]) + + AS_IF([test "$opal_check_cray_xpmem_happy" = "yes" && test "$enable_static" = "yes"], + [CRAY_XPMEM_LIBS = $CRAY_XPMEM_STATIC_LIBS],[]) + fi + + AS_IF([test "$opal_check_cray_xpmem_happy" = "yes"], + [$1_LDFLAGS="[$]$1_LDFLAGS $CRAY_XPMEM_LIBS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $CRAY_XPMEM_CFLAGS" + $1_LIBS="[$]$1_LIBS $CRAY_XPMEM_LIBS" + AC_DEFINE_UNQUOTED([HAVE_XPMEM_H], [1],[is xpmem.h available]) + $2], [$3]) +]) + +# OPAL_CHECK_XPMEM(prefix, [action-if-found], [action-if-not-found]) +# -------------------------------------------------------- +# check if XPMEM 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_XPMEM], [ + if test -z "$opal_check_xpmem_happy" ; then + # check for a cray installed xpmem first + OPAL_CHECK_CRAY_XPMEM([opal_check_xpmem],[opal_check_xpmem_happy=yes],[opal_check_xpmem_happy=no]) + + if test "$opal_check_xpmem_happy" = no ; then + AC_ARG_WITH([xpmem], + [AC_HELP_STRING([--with-xpmem(=DIR)], + [Build with XPMEM kernel module support, searching for headers in DIR])]) + OPAL_CHECK_WITHDIR([xpmem], [$with_xpmem], [include/xpmem.h]) + + AC_ARG_WITH([xpmem-libdir], + [AC_HELP_STRING([--with-xpmem-libdir=DIR], + [Search for XPMEM library in DIR])]) + OPAL_CHECK_WITHDIR([xpmem-libdir], [$with_xpmem_libdir], [libxpmem.*]) + + if test ! "$with_xpmem" = "no" ; then + if test ! -z "$with_xpmem" && test "$with_xpmem" != "yes" ; then + opal_check_xpmem_dir="$with_xpmem" + fi + + if test ! -z "$with_xpmem_libdir" && test "$with_xpmem_libdir" != "yes" ; then + opal_check_xpmem_libdir="$with_xpmem_libdir" + fi + + OPAL_CHECK_PACKAGE([opal_check_xpmem],[xpmem.h],[xpmem],[xpmem_make],[], + [$opal_check_xpmem_dir],[$opal_check_xpmem_libdir], [opal_check_xpmem_happy="yes"], []) + + if test "$opal_check_xpmem_happy" = "no" && test -n "$with_xpmem" && test "$with_xpmem" != "yes" ; then + AC_MSG_ERROR([XPMEM support requested but not found. Aborting]) + fi + fi + fi + + OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/XPMEM]],[$1],[$opal_check_cray_xpmem_happy]) + fi + + AS_IF([test "$opal_check_xpmem_happy" = "yes"], [ + $1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_xpmem_CPPFLAGS" + $1_LDFLAGS="[$]$1_LDFLAGS $opal_check_xpmem_LDFLAGS" + $1_LIBS="[$]$1_LIBS $opal_check_xpmem_LIBS" + $2], [$3]) +])dnl diff --git a/config/opal_summary.m4 b/config/opal_summary.m4 new file mode 100644 index 00000000000..084896df125 --- /dev/null +++ b/config/opal_summary.m4 @@ -0,0 +1,115 @@ +dnl -*- shell-script -*- +dnl +dnl Copyright (c) 2016 Los Alamos National Security, LLC. All rights +dnl reserved. +dnl Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2016 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. +dnl $COPYRIGHT$ +dnl +dnl Additional copyrights may follow +dnl +dnl $HEADER$ +dnl +AC_DEFUN([OPAL_SUMMARY_ADD],[ + OPAL_VAR_SCOPE_PUSH([ompi_summary_section ompi_summary_line ompi_summary_section_current]) + + dnl need to replace spaces in the section name with somethis else. _ seems like a reasonable + dnl choice. if this changes remember to change OMPI_PRINT_SUMMARY as well. + ompi_summary_section=$(echo $1 | tr ' ' '_') + ompi_summary_line="$2: $4" + ompi_summary_section_current=$(eval echo \$ompi_summary_values_$ompi_summary_section) + + if test -z "$ompi_summary_section_current" ; then + if test -z "$ompi_summary_sections" ; then + ompi_summary_sections=$ompi_summary_section + else + ompi_summary_sections="$ompi_summary_sections $ompi_summary_section" + fi + eval ompi_summary_values_$ompi_summary_section=\"$ompi_summary_line\" + else + eval ompi_summary_values_$ompi_summary_section=\"$ompi_summary_section_current,$ompi_summary_line\" + fi + + OPAL_VAR_SCOPE_POP +]) + +AC_DEFUN([OPAL_SUMMARY_PRINT],[ + OPAL_VAR_SCOPE_PUSH([ompi_summary_section ompi_summary_section_name]) + cat </dev/null 2>&1], - [orte_check_tm_pbs_config="pbs-config"])]) - AC_MSG_RESULT([$orte_check_tm_pbs_config])]) - - # If we have pbs-config, get the flags we need from there and then - # do simplistic tests looking for the tm headers and symbols - - AS_IF([test "$orte_check_tm_happy" = "yes" && test "$orte_check_tm_pbs_config" != "not found"], - [$1_CPPFLAGS=`$orte_check_tm_pbs_config --cflags` - OPAL_LOG_MSG([$1_CPPFLAGS from pbs-config: $$1_CPPFLAGS], 1) - - ORTE_CHECK_TM_LIBS_FLAGS([$1], [LDFLAGS]) - OPAL_LOG_MSG([$1_LDFLAGS from pbs-config: $$1_LDFLAGS], 1) - - ORTE_CHECK_TM_LIBS_FLAGS([$1], [LIBS]) - OPAL_LOG_MSG([$1_LIBS from pbs-config: $$1_LIBS], 1) - - # Now that we supposedly have the right flags, try them out. - - CPPFLAGS_save="$CPPFLAGS" - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" - - CPPFLAGS="$CPPFLAGS $$1_CPPFLAGS" - LIBS="$LIBS $$1_LIBS" - LDFLAGS="$LDFLAGS $$1_LDFLAGS" - - AC_CHECK_HEADER([tm.h], - [AC_CHECK_FUNC([tm_finalize], - [orte_check_tm_found="yes"])]) - - CPPFLAGS="$CPPFLAGS_save" - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save"]) - - # If we don't have pbs-config, then we have to look around - # manually. - - # Note that Torque 2.1.0 changed the name of their back-end - # library to "libtorque". So we have to check for both libpbs and - # libtorque. First, check for libpbs. - - orte_check_package_$1_save_CPPFLAGS="$CPPFLAGS" - orte_check_package_$1_save_LDFLAGS="$LDFLAGS" - orte_check_package_$1_save_LIBS="$LIBS" - - orte_check_package_$1_orig_CPPFLAGS="$$1_CPPFLAGS" - orte_check_package_$1_orig_LDFLAGS="$$1_LDFLAGS" - orte_check_package_$1_orig_LIBS="$$1_LIBS" - - AS_IF([test "$orte_check_tm_found" = "no"], - [AS_IF([test "$orte_check_tm_happy" = "yes"], - [_OPAL_CHECK_PACKAGE_HEADER([$1], - [tm.h], - [$orte_check_tm_dir], - [orte_check_tm_found="yes"], - [orte_check_tm_found="no"])]) - - AS_IF([test "$orte_check_tm_found" = "yes"], - [_OPAL_CHECK_PACKAGE_LIB([$1], - [pbs], - [tm_init], - [], - [$orte_check_tm_dir], - [$orte_check_tm_libdir], - [orte_check_tm_found="yes"], - [_OPAL_CHECK_PACKAGE_LIB([$1], - [torque], - [tm_init], - [], - [$orte_check_tm_dir], - [$orte_check_tm_libdir], - [orte_check_tm_found="yes"], - [orte_check_tm_found="no"])])])]) - - CPPFLAGS="$orte_check_package_$1_save_CPPFLAGS" - LDFLAGS="$orte_check_package_$1_save_LDFLAGS" - LIBS="$orte_check_package_$1_save_LIBS" - - # add the TM libraries to static builds as they are required - $1_WRAPPER_EXTRA_LDFLAGS=[$]$1_LDFLAGS - $1_WRAPPER_EXTRA_LIBS=[$]$1_LIBS + if test -z $orte_check_tm_happy ; then + OPAL_VAR_SCOPE_PUSH([orte_check_tm_found orte_check_tm_dir orte_check_tm_pbs_config orte_check_tm_LDFLAGS_save orte_check_tm_CPPFLAGS_save orte_check_tm_LIBS_save]) + + AC_ARG_WITH([tm], + [AC_HELP_STRING([--with-tm(=DIR)], + [Build TM (Torque, PBSPro, and compatible) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) + OPAL_CHECK_WITHDIR([tm], [$with_tm], [include/tm.h]) + + orte_check_tm_found=no + AS_IF([test "$with_tm" = "no"], + [orte_check_tm_happy="no"], + [orte_check_tm_happy="yes" + AS_IF([test ! -z "$with_tm" && test "$with_tm" != "yes"], + [orte_check_tm_dir="$with_tm"], + [orte_check_tm_dir=""])]) + + AS_IF([test "$orte_check_tm_happy" = "yes"], + [AC_MSG_CHECKING([for pbs-config]) + orte_check_tm_pbs_config="not found" + AS_IF([test "$orte_check_tm_dir" != "" && test -d "$orte_check_tm_dir" && test -x "$orte_check_tm_dir/bin/pbs-config"], + [orte_check_tm_pbs_config="$orte_check_tm_dir/bin/pbs-config"], + [AS_IF([pbs-config --prefix >/dev/null 2>&1], + [orte_check_tm_pbs_config="pbs-config"])]) + AC_MSG_RESULT([$orte_check_tm_pbs_config])]) + + # If we have pbs-config, get the flags we need from there and then + # do simplistic tests looking for the tm headers and symbols + + AS_IF([test "$orte_check_tm_happy" = "yes" && test "$orte_check_tm_pbs_config" != "not found"], + [orte_check_tm_CPPFLAGS=`$orte_check_tm_pbs_config --cflags` + OPAL_LOG_MSG([orte_check_tm_CPPFLAGS from pbs-config: $orte_check_tm_CPPFLAGS], 1) + + ORTE_CHECK_TM_LIBS_FLAGS([orte_check_tm], [LDFLAGS]) + OPAL_LOG_MSG([orte_check_tm_LDFLAGS from pbs-config: $orte_check_tm_LDFLAGS], 1) + + ORTE_CHECK_TM_LIBS_FLAGS([orte_check_tm], [LIBS]) + OPAL_LOG_MSG([orte_check_tm_LIBS from pbs-config: $orte_check_tm_LIBS], 1) + + # Now that we supposedly have the right flags, try them out. + + orte_check_tm_CPPFLAGS_save="$CPPFLAGS" + orte_check_tm_LDFLAGS_save="$LDFLAGS" + orte_check_tm_LIBS_save="$LIBS" + + CPPFLAGS="$CPPFLAGS $orte_check_tm_CPPFLAGS" + LIBS="$LIBS $orte_check_tm_LIBS" + LDFLAGS="$LDFLAGS $orte_check_tm_LDFLAGS" + + AC_CHECK_HEADER([tm.h], + [AC_CHECK_FUNC([tm_finalize], + [orte_check_tm_found="yes"])]) + + CPPFLAGS="$orte_check_tm_CPPFLAGS_save" + LDFLAGS="$orte_check_tm_LDFLAGS_save" + LIBS="$orte_check_tm_LIBS_save"]) + + # If we don't have pbs-config, then we have to look around + # manually. + + # Note that Torque 2.1.0 changed the name of their back-end + # library to "libtorque". So we have to check for both libpbs and + # libtorque. First, check for libpbs. + + orte_check_package_$1_save_CPPFLAGS="$CPPFLAGS" + orte_check_package_$1_save_LDFLAGS="$LDFLAGS" + orte_check_package_$1_save_LIBS="$LIBS" + + AS_IF([test "$orte_check_tm_found" = "no"], + [AS_IF([test "$orte_check_tm_happy" = "yes"], + [_OPAL_CHECK_PACKAGE_HEADER([orte_check_tm], + [tm.h], + [$orte_check_tm_dir], + [orte_check_tm_found="yes"], + [orte_check_tm_found="no"])]) + + AS_IF([test "$orte_check_tm_found" = "yes"], + [_OPAL_CHECK_PACKAGE_LIB([orte_check_tm], + [pbs], + [tm_init], + [], + [$orte_check_tm_dir], + [$orte_check_tm_libdir], + [orte_check_tm_found="yes"], + [_OPAL_CHECK_PACKAGE_LIB([orte_check_tm], + [torque], + [tm_init], + [], + [$orte_check_tm_dir], + [$orte_check_tm_libdir], + [orte_check_tm_found="yes"], + [orte_check_tm_found="no"])])])]) + + CPPFLAGS="$orte_check_package_$1_save_CPPFLAGS" + LDFLAGS="$orte_check_package_$1_save_LDFLAGS" + LIBS="$orte_check_package_$1_save_LIBS" + + if test "$orte_check_tm_found" = "no" ; then + orte_check_tm_happy=no + fi + + OPAL_SUMMARY_ADD([[Resource Managers]],[[Torque]],[$1],[$orte_check_tm_happy]) + + OPAL_VAR_SCOPE_POP + fi # Did we find the right stuff? - AS_IF([test "$orte_check_tm_happy" = "yes" && test "$orte_check_tm_found" = "yes"], - [$2], + AS_IF([test "$orte_check_tm_happy" = "yes"], + [$1_LIBS="[$]$1_LIBS $orte_check_tm_LIBS" + $1_LDFLAGS="[$]$1_LDFLAGS $orte_check_tm_LDFLAGS" + $1_CPPFLAGS="[$]$1_CPPFLAGS $orte_check_tm_CPPFLAGS" + # add the TM libraries to static builds as they are required + $1_WRAPPER_EXTRA_LDFLAGS=[$]$1_LDFLAGS + $1_WRAPPER_EXTRA_LIBS=[$]$1_LIBS + $2], [AS_IF([test ! -z "$with_tm" && test "$with_tm" != "no"], [AC_MSG_ERROR([TM support requested but not found. Aborting])]) - $3]) - - OPAL_VAR_SCOPE_POP + orte_check_tm_happy="no" + $3]) ]) diff --git a/configure.ac b/configure.ac index fbdafda8f10..032e60956f2 100644 --- a/configure.ac +++ b/configure.ac @@ -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-2015 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2016 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. @@ -1404,3 +1404,5 @@ m4_ifdef([project_ompi], [OMPI_CONFIG_FILES]) m4_ifdef([project_oshmem], [OSHMEM_CONFIG_FILES]) AC_OUTPUT + +OPAL_SUMMARY_PRINT diff --git a/opal/include/opal/sys/cma.h b/opal/include/opal/sys/cma.h index f12e1890a42..8e2c2601c2b 100644 --- a/opal/include/opal/sys/cma.h +++ b/opal/include/opal/sys/cma.h @@ -16,7 +16,10 @@ #ifndef OPAL_SYS_CMA_H #define OPAL_SYS_CMA_H 1 +#if !defined(OPAL_ASSEMBLY_ARCH) +/* need opal_config.h for the assembly architecture */ #include "opal_config.h" +#endif #include "opal/sys/architecture.h" diff --git a/opal/mca/btl/openib/configure.m4 b/opal/mca/btl/openib/configure.m4 index f333851527f..d91c8edd78b 100644 --- a/opal/mca/btl/openib/configure.m4 +++ b/opal/mca/btl/openib/configure.m4 @@ -39,7 +39,7 @@ AC_DEFUN([MCA_opal_btl_openib_POST_CONFIG], [ AC_DEFUN([MCA_opal_btl_openib_CONFIG],[ AC_CONFIG_FILES([opal/mca/btl/openib/Makefile]) - OPAL_VAR_SCOPE_PUSH([cpcs LDFLAGS_save LIBS_save]) + OPAL_VAR_SCOPE_PUSH([cpcs btl_openib_LDFLAGS_save btl_openib_LIBS_save]) cpcs="oob" OPAL_CHECK_OPENFABRICS([btl_openib], @@ -50,13 +50,13 @@ AC_DEFUN([MCA_opal_btl_openib_CONFIG],[ AS_IF([test "$btl_openib_happy" = "yes"], [# With the new openib flags, look for ibv_fork_init - LDFLAGS_save="$LDFLAGS" - LIBS_save="$LIBS" + btl_openib_LDFLAGS_save="$LDFLAGS" + btl_openib_LIBS_save="$LIBS" LDFLAGS="$LDFLAGS $btl_openib_LDFLAGS" LIBS="$LIBS $btl_openib_LIBS" AC_CHECK_FUNCS([ibv_fork_init]) - LDFLAGS="$LDFLAGS_save" - LIBS="$LIBS_save" + LDFLAGS="$btl_openib_LDFLAGS_save" + LIBS="$btl_openib_LIBS_save" $1], [$2]) diff --git a/opal/mca/btl/scif/configure.m4 b/opal/mca/btl/scif/configure.m4 index b8826b0bd11..f8b814e2e70 100644 --- a/opal/mca/btl/scif/configure.m4 +++ b/opal/mca/btl/scif/configure.m4 @@ -4,6 +4,7 @@ # reserved. # Copyright (c) 2015 Research Organization for Information Science # and Technology (RIST). All rights reserved. +# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -36,6 +37,8 @@ AC_DEFUN([MCA_opal_btl_scif_CONFIG],[ AS_IF([test "$opal_btl_scif_happy" = "yes"], [$1], [$2]) + OPAL_SUMMARY_ADD([[Transports]],[[Intel SCIF]],[[btl_scif]],[$opal_btl_scif_happy]) + # substitute in the things needed to build scif AC_SUBST([btl_scif_CPPFLAGS]) AC_SUBST([btl_scif_LDFLAGS]) diff --git a/opal/mca/btl/tcp/configure.m4 b/opal/mca/btl/tcp/configure.m4 index cb68705be8c..9eb66631ce1 100644 --- a/opal/mca/btl/tcp/configure.m4 +++ b/opal/mca/btl/tcp/configure.m4 @@ -10,7 +10,9 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2010-2016 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2016 Los Alamos National Security, LLC. All rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -25,10 +27,14 @@ AC_DEFUN([MCA_opal_btl_tcp_CONFIG],[ # check for sockaddr_in (a good sign we have TCP) AC_CHECK_TYPES([struct sockaddr_in], - [$1], - [$2], + [opal_btl_tcp_happy=yes + $1], + [opal_btl_tcp_happy=no + $2], [AC_INCLUDES_DEFAULT #ifdef HAVE_NETINET_IN_H #include -#endif]) +#endif + ]) + OPAL_SUMMARY_ADD([[Transports]],[[TCP]],[[btl_tcp]],[$opal_btl_tcp_happy]) ])dnl diff --git a/opal/mca/btl/vader/configure.m4 b/opal/mca/btl/vader/configure.m4 index 6d9e2650663..328d8f3094a 100644 --- a/opal/mca/btl/vader/configure.m4 +++ b/opal/mca/btl/vader/configure.m4 @@ -3,7 +3,7 @@ # Copyright (c) 2009 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. -# Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2015 Research Organization for Information Science @@ -15,47 +15,6 @@ # $HEADER$ # -# OPAL_CHECK_XPMEM(prefix, [action-if-found], [action-if-not-found]) -# -------------------------------------------------------- -# check if XPMEM 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_XPMEM], [ - OPAL_VAR_SCOPE_PUSH([opal_check_xpmem_happy]) - AC_ARG_WITH([xpmem], - [AC_HELP_STRING([--with-xpmem(=DIR)], - [Build with XPMEM kernel module support, searching for headers in DIR])]) - OPAL_CHECK_WITHDIR([xpmem], [$with_xpmem], [include/xpmem.h]) - - AC_ARG_WITH([xpmem-libdir], - [AC_HELP_STRING([--with-xpmem-libdir=DIR], - [Search for XPMEM library in DIR])]) - OPAL_CHECK_WITHDIR([xpmem-libdir], [$with_xpmem_libdir], [libxpmem.*]) - - opal_check_xpmem_happy="no" - - if test ! "$with_xpmem" = "no" ; then - if test ! -z "$with_xpmem" && test "$with_xpmem" != "yes" ; then - opal_check_xpmem_dir="$with_xpmem" - fi - - if test ! -z "$with_xpmem_libdir" && test "$with_xpmem_libdir" != "yes" ; then - opal_check_xpmem_libdir="$with_xpmem_libdir" - fi - - OPAL_CHECK_PACKAGE([$1],[xpmem.h],[xpmem],[xpmem_make],[], - [$opal_check_xpmem_dir],[$opal_check_xpmem_libdir], [opal_check_xpmem_happy="yes"], []) - - if test "$opal_check_xpmem_happy" = "no" && test -n "$with_xpmem" && test "$with_xpmem" != "yes" ; then - AC_MSG_ERROR([XPMEM support requested but not found. Aborting]) - fi - fi - - AS_IF([test "$opal_check_xpmem_happy" = "yes"], [$2], [$3]) - - OPAL_VAR_SCOPE_POP -])dnl - # MCA_btl_vader_CONFIG([action-if-can-compile], # [action-if-cant-compile]) # ------------------------------------------------ @@ -66,11 +25,7 @@ AC_DEFUN([MCA_opal_btl_vader_CONFIG],[ # Check for single-copy APIs - OPAL_CHECK_CRAY_XPMEM([btl_vader], [btl_vader_xpmem_happy=1], [btl_vader_xpmem_happy=0]) - - AS_IF([test "$btl_vader_xpmem_happy" -eq 0], - [OPAL_CHECK_XPMEM([btl_vader], [btl_vader_xpmem_happy=1], [btl_vader_xpmem_happy=0])],[]) - + OPAL_CHECK_XPMEM([btl_vader], [btl_vader_xpmem_happy=1], [btl_vader_xpmem_happy=0]) OPAL_CHECK_KNEM([btl_vader], [btl_vader_knem_happy=1],[btl_vader_knem_happy=0]) OPAL_CHECK_CMA([btl_vader], [AC_CHECK_HEADER([sys/prctl.h]) btl_vader_cma_happy=1], [btl_vader_cma_happy=0]) @@ -88,7 +43,9 @@ AC_DEFUN([MCA_opal_btl_vader_CONFIG],[ # always happy [$1] - # substitute in the things needed to build with XPMEM support + OPAL_SUMMARY_ADD([[Transports]],[[Shared memory/copy in+copy out]],[$1],[yes]) + +# substitute in the things needed to build with XPMEM support AC_SUBST([btl_vader_CFLAGS]) AC_SUBST([btl_vader_CPPFLAGS]) AC_SUBST([btl_vader_LDFLAGS]) diff --git a/orte/mca/plm/rsh/configure.m4 b/orte/mca/plm/rsh/configure.m4 index e1956e025bd..246dde9731c 100644 --- a/orte/mca/plm/rsh/configure.m4 +++ b/orte/mca/plm/rsh/configure.m4 @@ -12,7 +12,7 @@ # All rights reserved. # Copyright (c) 2011-2013 Los Alamos National Security, LLC. # All rights reserved. -# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2010-2016 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -27,5 +27,6 @@ AC_DEFUN([MCA_orte_plm_rsh_CONFIG],[ AC_CHECK_FUNC([fork], [plm_rsh_happy="yes"], [plm_rsh_happy="no"]) + OPAL_SUMMARY_ADD([[Resource Managers]],[[ssh/rsh]],[$1],[$plm_rsh_happy]) AS_IF([test "$plm_rsh_happy" = "yes"], [$1], [$2]) ])dnl