|
33 | 33 | # LDFLAGS, LIBS} as needed and runs action-if-found if there is |
34 | 34 | # support, otherwise executes action-if-not-found |
35 | 35 | AC_DEFUN([OMPI_CHECK_PSM2],[ |
36 | | - if test -z "$ompi_check_psm2_happy" ; then |
37 | | - AC_ARG_WITH([psm2], |
38 | | - [AS_HELP_STRING([--with-psm2(=DIR)], |
39 | | - [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) |
40 | | - OPAL_CHECK_WITHDIR([psm2], [$with_psm2], [include/psm2.h]) |
41 | | - AC_ARG_WITH([psm2-libdir], |
42 | | - [AS_HELP_STRING([--with-psm2-libdir=DIR], |
43 | | - [Search for PSM (Intel PSM2) libraries in DIR])]) |
44 | | - OPAL_CHECK_WITHDIR([psm2-libdir], [$with_psm2_libdir], [libpsm2.*]) |
| 36 | + OPAL_VAR_SCOPE_PUSH([opal_psm2_CPPFLAGS_save opal_psm2_LDFLAGS_save opal_psm2_LIBS_save]) |
45 | 37 |
|
46 | | - AC_ARG_ENABLE([psm2-version-check], |
47 | | - [AS_HELP_STRING([--disable-psm2-version-check], |
48 | | - [Disable PSM2 version checking. Not recommended to disable. (default: enabled)])]) |
| 38 | + AC_ARG_WITH([psm2], |
| 39 | + [AS_HELP_STRING([--with-psm2(=DIR)], |
| 40 | + [Build PSM2 (Intel PSM2) support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])]) |
| 41 | + AC_ARG_WITH([psm2-libdir], |
| 42 | + [AS_HELP_STRING([--with-psm2-libdir=DIR], |
| 43 | + [Search for PSM (Intel PSM2) libraries in DIR])]) |
49 | 44 |
|
50 | | - ompi_check_psm2_$1_save_CPPFLAGS="$CPPFLAGS" |
51 | | - ompi_check_psm2_$1_save_LDFLAGS="$LDFLAGS" |
52 | | - ompi_check_psm2_$1_save_LIBS="$LIBS" |
| 45 | + AC_ARG_ENABLE([psm2-version-check], |
| 46 | + [AS_HELP_STRING([--disable-psm2-version-check], |
| 47 | + [Disable PSM2 version checking. Not recommended to disable. (default: enabled)])]) |
53 | 48 |
|
54 | | - AS_IF([test "$with_psm2" != "no"], |
55 | | - [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "yes"], |
56 | | - [ompi_check_psm2_dir="$with_psm2"]) |
57 | | - AS_IF([test ! -z "$with_psm2_libdir" && test "$with_psm2_libdir" != "yes"], |
58 | | - [ompi_check_psm2_libdir="$with_psm2_libdir"]) |
| 49 | + OAC_CHECK_PACKAGE([psm2], |
| 50 | + [$1], |
| 51 | + [psm2.h], |
| 52 | + [psm2], |
| 53 | + [psm2_mq_irecv2], |
| 54 | + [ompi_check_psm2_happy="yes"], |
| 55 | + [ompi_check_psm2_happy="no"]) |
59 | 56 |
|
60 | | - OPAL_CHECK_PACKAGE([ompi_check_psm2], |
61 | | - [psm2.h], |
62 | | - [psm2], |
63 | | - [psm2_mq_irecv2], |
64 | | - [], |
65 | | - [$ompi_check_psm2_dir], |
66 | | - [$ompi_check_psm2_libdir], |
67 | | - [ompi_check_psm2_happy="yes"], |
68 | | - [ompi_check_psm2_happy="no"])], |
69 | | - [ompi_check_psm2_happy="no"]) |
| 57 | + AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], |
| 58 | + [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) |
| 59 | + $1_SUMMARY="no (progress threads not supported)" |
| 60 | + ompi_check_psm2_happy="no"]) |
70 | 61 |
|
71 | | - AS_IF([test "$ompi_check_psm2_happy" = "yes" && test "$enable_progress_threads" = "yes"], |
72 | | - [AC_MSG_WARN([PSM2 driver does not currently support progress threads. Disabling MTL.]) |
73 | | - ompi_check_psm2_happy="no"]) |
| 62 | + opal_psm2_CPPFLAGS_save="$CPPFLAGS" |
| 63 | + CPPFLAGS="${$1_CPPFLAGS} ${CPPFLAGS}" |
74 | 64 |
|
75 | | - AS_IF([test "$ompi_check_psm2_happy" = "yes"], |
76 | | - [AC_CHECK_HEADERS( |
77 | | - glob.h, |
78 | | - [], |
| 65 | + AS_IF([test "$ompi_check_psm2_happy" = "yes"], |
| 66 | + [AC_CHECK_HEADERS([glob.h], [] |
79 | 67 | [AC_MSG_WARN([glob.h not found. Can not build component.]) |
80 | | - ompi_check_psm2_happy="no"])]) |
| 68 | + $1_SUMMARY="no (glob.h not found))" |
| 69 | + ompi_check_psm2_happy="no"])]) |
81 | 70 |
|
82 | | - AS_IF([test "$ompi_check_psm2_happy" = "yes"], |
83 | | - [AS_IF([ test ! -z "$ompi_check_psm2_dir"], |
84 | | - [CPPFLAGS="-I $ompi_check_psm2_dir/include $CPPFLAGS"]) |
85 | | - AC_CHECK_DECL([PSM2_LIB_REFCOUNT_CAP], |
86 | | - [AC_DEFINE([HAVE_PSM2_LIB_REFCOUNT_CAP], [1], |
87 | | - [have PSM2_LIB_REFCOUNT_CAP in psm2.h])], |
88 | | - [AS_IF([test "x$enable_psm2_version_check" != "xno"], |
89 | | - [ompi_check_psm2_happy="no" |
90 | | - AC_MSG_WARN([PSM2 needs to be version 11.2.173 or later. Disabling MTL.])] |
91 | | - )], |
92 | | - [#include <psm2.h>])] |
93 | | - ) |
| 71 | + AS_IF([test "$ompi_check_psm2_happy" = "yes"], |
| 72 | + [AC_CHECK_DECL([PSM2_LIB_REFCOUNT_CAP], |
| 73 | + [AC_DEFINE([HAVE_PSM2_LIB_REFCOUNT_CAP], [1], |
| 74 | + [have PSM2_LIB_REFCOUNT_CAP in psm2.h])], |
| 75 | + [AS_IF([test "x$enable_psm2_version_check" != "xno"], |
| 76 | + [ompi_check_psm2_happy="no" |
| 77 | + $1_SUMMARY="no (version too old)" |
| 78 | + AC_MSG_WARN([PSM2 needs to be version 11.2.173 or later. Disabling MTL.])] |
| 79 | + )], |
| 80 | + [#include <psm2.h>])]) |
94 | 81 |
|
95 | | - CPPFLAGS="$ompi_check_psm2_$1_save_CPPFLAGS" |
96 | | - LDFLAGS="$ompi_check_psm2_$1_save_LDFLAGS" |
97 | | - LIBS="$ompi_check_psm2_$1_save_LIBS" |
| 82 | + CPPFLAGS="${opal_psm2_CPPFLAGS_save}" |
98 | 83 |
|
99 | | - OPAL_SUMMARY_ADD([Transports], [Intel Omnipath (PSM2)], [], [$ompi_check_psm2_happy]) |
100 | | - fi |
| 84 | + OPAL_SUMMARY_ADD([Transports], [Intel Omnipath (PSM2)], [], [${$1_SUMMARY}]) |
101 | 85 |
|
102 | 86 | AS_IF([test "$ompi_check_psm2_happy" = "yes"], |
103 | | - [$1_LDFLAGS="[$]$1_LDFLAGS $ompi_check_psm2_LDFLAGS" |
104 | | - $1_CPPFLAGS="[$]$1_CPPFLAGS $ompi_check_psm2_CPPFLAGS" |
105 | | - $1_LIBS="[$]$1_LIBS $ompi_check_psm2_LIBS" |
106 | | - $2], |
| 87 | + [$2], |
107 | 88 | [AS_IF([test ! -z "$with_psm2" && test "$with_psm2" != "no"], |
108 | 89 | [AC_MSG_ERROR([PSM2 support requested but not found. Aborting])]) |
109 | 90 | $3]) |
|
0 commit comments