Skip to content

Commit

Permalink
configury: update much configury to ompi main
Browse files Browse the repository at this point in the history
aligns with ompi main branch ref:
cebad71e4f50d49e486ccd54668cf58698556a7c
  • Loading branch information
davidozog committed May 20, 2024
1 parent 934f44a commit c0dd8d0
Show file tree
Hide file tree
Showing 11 changed files with 446 additions and 700 deletions.
14 changes: 14 additions & 0 deletions config/getdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.

# Provide a way to override build date for reproducible build results
# See https://reproducible-builds.org/ for why this is good.

# There are several different flavors of date(1) out there.
# Try a few different CLI options for date(1) to see which one works.

SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
date -u -d "@$SOURCE_DATE_EPOCH" "$@" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$@" 2>/dev/null || date -u "$@"
246 changes: 110 additions & 136 deletions config/ompi_check_ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -20,156 +21,129 @@
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
# support, otherwise executes action-if-not-found
AC_DEFUN([OMPI_CHECK_UCX],[
OPAL_VAR_SCOPE_PUSH([ompi_check_ucx_dir])
OPAL_VAR_SCOPE_PUSH([ompi_check_ucx_happy ompi_check_ucx_CPPFLAGS_save ompi_check_ucx_LDFLAGS_save ompi_check_ucx_LIBS_save])

AS_IF([test -z "$ompi_check_ucx_happy"],
[AC_ARG_WITH([ucx],
[AC_HELP_STRING([--with-ucx(=DIR)],
[Build with Unified Communication X library support])])
OPAL_CHECK_WITHDIR([ucx], [$with_ucx], [include/ucp/api/ucp.h])
AC_ARG_WITH([ucx-libdir],
[AC_HELP_STRING([--with-ucx-libdir=DIR],
[Search for Unified Communication X libraries in DIR])])
OPAL_CHECK_WITHDIR([ucx-libdir], [$with_ucx_libdir], [libucp.*])
m4_ifblank([$1], [m4_fatal([First argument to OMPI_CHECK_UCX cannot be blank])])

AS_IF([test "$with_ucx" != "no"],
[AS_IF([test -n "$with_ucx" && test "$with_ucx" != "yes"],
[ompi_check_ucx_dir="$with_ucx"],
[PKG_CHECK_MODULES_STATIC([ucx],[ucx],
[ompi_check_ucx_dir=`$PKG_CONFIG --variable=prefix ucx`
AS_IF([test "$ompi_check_ucx_dir" = "/usr"],
[ompi_check_ucx_dir=])],
[true])])
ompi_check_ucx_happy="no"
AS_IF([test -z "$ompi_check_ucx_dir"],
[OPAL_CHECK_PACKAGE([ompi_check_ucx],
[ucp/api/ucp.h],
[ucp],
[ucp_cleanup],
[-luct -lucm -lucs],
[],
[],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
AS_IF([test "$ompi_check_ucx_happy" = yes],
[AC_MSG_CHECKING(for UCX version compatibility)
AC_REQUIRE_CPP
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],[[]])],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
AC_ARG_WITH([ucx],
[AS_HELP_STRING([--with-ucx(=DIR)],
[Build with Unified Communication X library support])])
AC_ARG_WITH([ucx-libdir],
[AS_HELP_STRING([--with-ucx-libdir=DIR],
[Search for Unified Communication X libraries in DIR])])

AC_MSG_RESULT([$ompi_check_ucx_happy])])
AS_IF([test "$ompi_check_ucx_happy" = "no"],
[ompi_check_ucx_dir=/opt/ucx])])
AS_IF([test "$ompi_check_ucx_happy" != yes],
[AS_IF([test -n "$with_ucx_libdir"],
[ompi_check_ucx_libdir="$with_ucx_libdir"],
[files=`ls $ompi_check_ucx_dir/lib64/libucp.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib64],
[ompi_check_ucx_libdir=$ompi_check_ucx_dir/lib])])
OAC_CHECK_PACKAGE([ucx],
[$1],
[ucp/api/ucp.h],
[ucp -luct -lucm -lucs],
[ucp_cleanup],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])

ompi_check_ucx_$1_save_CPPFLAGS="$CPPFLAGS"
ompi_check_ucx_$1_save_LDFLAGS="$LDFLAGS"
ompi_check_ucx_$1_save_LIBS="$LIBS"
ompi_check_ucx_CPPFLAGS_save=${CPPFLAGS}
ompi_check_ucx_LDFLAGS_save=${LDFLAGS}
ompi_check_ucx_LIBS_save=${LIBS}

OPAL_CHECK_PACKAGE([ompi_check_ucx],
[ucp/api/ucp.h],
[ucp],
[ucp_cleanup],
[-luct -lucm -lucs],
[$ompi_check_ucx_dir],
[$ompi_check_ucx_libdir],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
OPAL_FLAGS_APPEND_UNIQ([CPPFLAGS], [${$1_CPPFLAGS}])
OPAL_FLAGS_APPEND_UNIQ([LDFLAGS], [${$1_LDFLAGS}])
OPAL_FLAGS_APPEND_MOVE([LIBS], [${$1_LIBS}])

CPPFLAGS="$ompi_check_ucx_$1_save_CPPFLAGS"
LDFLAGS="$ompi_check_ucx_$1_save_LDFLAGS"
LIBS="$ompi_check_ucx_$1_save_LIBS"
AS_IF([test "$ompi_check_ucx_happy" = yes],
[AC_CACHE_CHECK([for UCX version header],
[ompi_check_ucx_cv_have_version_header],
[AC_REQUIRE_CPP
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],[[]])],
[ompi_check_ucx_cv_have_version_header="yes"],
[ompi_check_ucx_cv_have_version_header="no"])])
AS_IF([test "${ompi_check_ucx_cv_have_version_header}" != "yes"],
[ompi_check_ucx_happy=no])])

AS_IF([test "$ompi_check_ucx_happy" = yes],
[AC_MSG_CHECKING(for UCX version compatibility)
AC_REQUIRE_CPP
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <uct/api/version.h>]],[[]])],
[ompi_check_ucx_happy="yes"],
[ompi_check_ucx_happy="no"])
AS_IF([test "$ompi_check_ucx_happy" = yes],
[# Turn off UCX version v1.8 due to issue #8321
AC_CACHE_CHECK([UCX version 1.8.x],
[ompi_check_ucx_cv_have_version_1_8],
[AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <ucp/api/ucp_version.h>
]], [[
#if (UCP_API_MAJOR == 1) && (UCP_API_MINOR == 8)
#error "Invalid version"
#endif
]])],
[ompi_check_ucx_cv_have_version_1_8=no],
[ompi_check_ucx_cv_have_version_1_8=yes])])
AS_IF([test "${ompi_check_ucx_cv_have_version_1_8}" = "yes"],
[AC_MSG_WARN([UCX support skipped because version 1.8.x was found, which has a known catastrophic issue.])
ompi_check_ucx_happy=no])])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
#include <ucp/api/ucp_version.h>
]], [[
#if (UCP_API_MAJOR < 1) || ((UCP_API_MAJOR == 1) && (UCP_API_MINOR < 9))
#error "Version too low"
#endif
]])],
[], [AC_MSG_WARN([UCX version is too old, please upgrade to 1.9 or higher.])])

AC_MSG_RESULT([$ompi_check_ucx_happy])
CPPFLAGS=$old_CPPFLAGS])])
AS_IF([test "$ompi_check_ucx_happy" = yes],
[AC_CHECK_DECLS([ucp_tag_send_nbr],
[AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1],
[have ucp_tag_send_nbr()])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb,
ucp_request_check_status, ucp_put_nb, ucp_get_nb,
ucp_put_nbx, ucp_get_nbx, ucp_atomic_op_nbx,
ucp_ep_flush_nbx],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucm_test_events,
ucm_test_external_events],
[], [],
[#include <ucm/api/ucm.h>])
AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND,
UCP_ATOMIC_POST_OP_OR,
UCP_ATOMIC_POST_OP_XOR,
UCP_ATOMIC_FETCH_OP_FAND,
UCP_ATOMIC_FETCH_OP_FOR,
UCP_ATOMIC_FETCH_OP_FXOR,
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN,
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK,
UCP_OP_ATTR_FLAG_MULTI_SEND,
UCS_MEMORY_TYPE_RDMA,
UCP_MEM_MAP_SYMMETRIC_RKEY],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],
[AC_DEFINE([HAVE_UCP_WORKER_ADDRESS_FLAGS], [1],
[have worker address attribute])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_ATTR_FIELD_MEMORY_TYPES],
[AC_DEFINE([HAVE_UCP_ATTR_MEMORY_TYPES], [1],
[have memory types attribute])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_EP_ATTR_FIELD_TRANSPORTS],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucp_tag_send_nbx,
ucp_tag_send_sync_nbx,
ucp_tag_recv_nbx,
ucp_rkey_compare],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_TYPES([ucp_request_param_t],
[], [],
[[#include <ucp/api/ucp.h>]])
])

old_CPPFLAGS="$CPPFLAGS"
AS_IF([test -n "$ompi_check_ucx_dir"],
[CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"])
# Turn off UCX version v1.8 due to issue #8321
AC_MSG_CHECKING([UCX version])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#include <ucp/api/ucp_version.h>
#if (UCP_API_MAJOR == 1) && (UCP_API_MINOR == 8)
#error "Invalid version"
#endif], [])],
[AC_MSG_RESULT([ok (not 1.8.x)])],
[AC_MSG_RESULT([bad (1.8.x)])
AC_MSG_WARN([UCX support skipped because version 1.8.x was found, which has a known catastrophic issue.])
AC_MSG_WARN([Please upgrade to UCX version 1.9 or higher.])
ompi_check_ucx_happy=no])
AS_IF([test "$ompi_check_ucx_happy" = yes],
[
AC_CHECK_DECLS([ucp_tag_send_nbr],
[AC_DEFINE([HAVE_UCP_TAG_SEND_NBR],[1],
[have ucp_tag_send_nbr()])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucp_ep_flush_nb, ucp_worker_flush_nb,
ucp_request_check_status, ucp_put_nb, ucp_get_nb,
ucp_put_nbx, ucp_get_nbx, ucp_atomic_op_nbx],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucm_test_events,
ucm_test_external_events],
[], [],
[#include <ucm/api/ucm.h>])
AC_CHECK_DECLS([UCP_ATOMIC_POST_OP_AND,
UCP_ATOMIC_POST_OP_OR,
UCP_ATOMIC_POST_OP_XOR,
UCP_ATOMIC_FETCH_OP_FAND,
UCP_ATOMIC_FETCH_OP_FOR,
UCP_ATOMIC_FETCH_OP_FXOR,
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN,
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],
[AC_DEFINE([HAVE_UCP_WORKER_ADDRESS_FLAGS], [1],
[have worker address attribute])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_ATTR_FIELD_MEMORY_TYPES],
[AC_DEFINE([HAVE_UCP_ATTR_MEMORY_TYPES], [1],
[have memory types attribute])], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([ucp_tag_send_nbx,
ucp_tag_send_sync_nbx,
ucp_tag_recv_nbx],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_TYPES([ucp_request_param_t],
[], [],
[[#include <ucp/api/ucp.h>]])
])
CPPFLAGS=$old_CPPFLAGS
CPPFLAGS=${ompi_check_ucx_CPPFLAGS_save}
LDFLAGS=${ompi_check_ucx_LDFLAGS_save}
LIBS=${ompi_check_ucx_LIBS_save}

OPAL_SUMMARY_ADD([[Transports]],[[Open UCX]],[$1],[$ompi_check_ucx_happy])])])
OPAL_SUMMARY_ADD([Transports], [Open UCX], [], [$ompi_check_ucx_happy])

AS_IF([test "$ompi_check_ucx_happy" = "yes"],
[$1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_ucx_CPPFLAGS"
$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_ucx_LDFLAGS"
$1_LIBS="[$]$1_LIBS $ompi_check_ucx_LIBS"
AC_DEFINE([HAVE_UCX], [1], [have ucx])
$2],
[$2],
[AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "no"],
[AC_MSG_ERROR([UCX support requested but not found. Aborting])])
AC_DEFINE([HAVE_UCX], [0], [have ucx])
$3])

OPAL_VAR_SCOPE_POP
Expand Down
35 changes: 12 additions & 23 deletions config/opal_case_sensitive_fs_setup.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +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) 2022 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -59,9 +60,11 @@ rm -f conf_fs_test.$$ CONF_FS_TEST.$$
# Now see what the user wants to do...
#
AC_MSG_CHECKING([if configuring for case sensitive filesystem])
AC_ARG_WITH(cs_fs,
AC_HELP_STRING([--with-cs-fs],
[Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)]))
AC_ARG_WITH([cs_fs],
[AS_HELP_STRING([--with-cs-fs],
[Destination FS is case sensitive (default: set to value of the build FS's case sensitivity)])])
dnl Stupid emacs syntax highlighting: '

if test "$with_cs_fs" = "yes"; then
OPAL_WANT_CS_FS=1
Expand All @@ -78,26 +81,12 @@ else
fi

AM_CONDITIONAL(CASE_SENSITIVE_FS, test "$OPAL_WANT_CS_FS" = "1")
if test "$OPAL_WANT_CS_FS" = "0"; then
cat <<EOF
*******************************************************************************
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
*******************************************************************************
Because OPAL is being installed on a non-case sensitive file
system, the C++ wrapper compiler will be named opalc++ instead of the
traditional opalCC.
Please update any makefiles appropriately.
*******************************************************************************
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
*******************************************************************************
EOF
fi
# There is a case in the ompi/tools/wrappers/Makefile.am where we need
# to know if there is a case sensitive filesystem *and* if we have a
# C++ compiler. Since we can't use operators like "&&" or "and" to
# join together AM CONDITIONALs in a Makefile.am, effectively make a
# combo CONDITIONAL here.
AM_CONDITIONAL([CASE_SENSITIVE_FS_AND_HAVE_CXX_COMPILER], [test "$OPAL_WANT_CS_FS" = "1" && test "$CXX" != "no"])

# Clean up
unset have_cs_fs])dnl
Loading

0 comments on commit c0dd8d0

Please sign in to comment.