1616# All rights reserved.
1717# Copyright (c) 2018 Research Organization for Information Science
1818# and Technology (RIST). All rights reserved.
19+ # Copyright (c) 2019 Triad National Security, LLC. All rights
20+ # reserved.
1921# $COPYRIGHT$
2022#
2123# Additional copyrights may follow
@@ -35,6 +37,41 @@ AC_DEFUN([MCA_opal_btl_uct_CONFIG],[
3537 OMPI_CHECK_UCX([btl_uct],
3638 [btl_uct_happy= " yes" ],
3739 [btl_uct_happy= " no" ])
40+ dnl
41+ dnl check UCT version. UCT API can change at any given release
42+ dnl so we only allow compiling against ones we know work.
43+ dnl
44+ AC_ARG_ENABLE([uct-version-check],
45+ [AC_HELP_STRING([--enable-uct-version-check],
46+ [enable UCT version check (default: enabled)])])
47+ AC_MSG_CHECKING([check uct version])
48+ if test " $enable_uct_version_check " ! = " no" ; then
49+ AC_MSG_RESULT([yes])
50+ else
51+ AC_MSG_RESULT([no])
52+ fi
53+
54+ max_allowed_uct_major= 1
55+ max_allowed_uct_minor= 7
56+ if test " $btl_uct_happy " = " yes" && test " $enable_uct_version_check " ! = " no" ; then
57+ AC_MSG_CHECKING([UCT version compatibility])
58+ OPAL_VAR_SCOPE_PUSH([CPPFLAGS_save])
59+ CPPFLAGS_save=" $CPPFLAGS "
60+ CPPFLAGS=" $CPPFLAGS $btl_uct_CPPFLAGS "
61+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([# include <uct/api/version.h>
62+ # if (UCT_VERNO_MAJOR > $max_allowed_uct_major)
63+ # error "UCT MAJOR VERNO > $max_allowed_uct_major"
64+ # endif
65+ # if (UCT_VERNO_MINOR > $max_allowed_uct_minor)
66+ # error "UCT MINOR VERNO > $max_allowed_uct_minor"
67+ # endif], [])],
68+ [AC_MSG_RESULT([UCT version compatible])],
69+ [AC_MSG_RESULT([UCT version not compatible - need UCX $max_allowed_uct_major .$max_allowed_uct_minor or older])
70+ btl_uct_happy= " no" ])
71+ CPPFLAGS= " $CPPFLAGS_save "
72+ OPAL_VAR_SCOPE_POP
73+ fi
74+
3875 if test " $btl_uct_happy " = " yes" ; then
3976 OPAL_VAR_SCOPE_PUSH([CPPFLAGS_save])
4077
0 commit comments