Skip to content

Commit 14def94

Browse files
authored
Merge pull request #9792 from jsquyres/pr/dont-be-lame-and-use-cxx-shell-variable
ompi_deleted_options.m4: minor cleanups
2 parents caa8911 + db41839 commit 14def94

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

config/ompi_deleted_options.m4

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- shell-script -*-
22
#
33
# Copyright (c) 2020 Intel, Inc. All rights reserved.
4-
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved
4+
# Copyright (c) 2020-2021 Cisco Systems, Inc. All rights reserved.
55
# $COPYRIGHT$
66
#
77
# Additional copyrights may follow
@@ -10,7 +10,7 @@
1010
#
1111

1212
AC_DEFUN([OMPI_CHECK_DELETED_OPTIONS],[
13-
OPAL_VAR_SCOPE_PUSH([with_pmi_given with_pmi_libdir_given cxx])
13+
OPAL_VAR_SCOPE_PUSH([with_pmi_given with_pmi_libdir_given ompi_cxx_warn ompi_cxx_error])
1414

1515
# --with-pmi options were removed in v5.0
1616
AC_ARG_WITH([pmi],
@@ -41,38 +41,55 @@ AC_DEFUN([OMPI_CHECK_DELETED_OPTIONS],[
4141
AC_MSG_ERROR([Build cannot continue.])
4242
fi
4343

44-
# Open MPI C++ bindings were removed in v5.0
45-
cxx=0
46-
cxxseek=0
47-
cxxex=0
44+
# Note that we always *warn* if someone used a CLI option for a
45+
# feature that has been deleted. If, however, they are disabling
46+
# the deleted feature (e.g., --disable-mpi-cxx), then emitting a
47+
# warning is good enough -- allow configure to continue. If,
48+
# however, the user asked to enable a deleted feature, then
49+
# configure needs to error out.
50+
ompi_cxx_warn=0
51+
ompi_cxx_error=0
4852
AC_ARG_ENABLE([mpi-cxx],
4953
[AS_HELP_STRING([--enable-mpi-cxx],
5054
[*DELETED* Build the MPI C++ bindings])],
51-
[cxx=1])
55+
[ompi_cxx_warn=1
56+
AS_IF([test "$enable_mpi_cxx" != "no"],
57+
[ompi_cxx_error=1])
58+
])
5259
AC_ARG_ENABLE([mpi-cxx-seek],
5360
[AS_HELP_STRING([--enable-mpi-cxx-seek],
5461
[*DELETED* Build support for MPI::SEEK])],
55-
[cxxseek=1])
62+
[ompi_cxx_warn=1
63+
AS_IF([test "$enable_mpi_cxx_seek" != "no"],
64+
[ompi_cxx_error=1])
65+
])
5666
AC_ARG_ENABLE([cxx-exceptions],
5767
[AS_HELP_STRING([--enable-cxx-exceptions],
5868
[*DELETED* Build support for C++ exceptions in the MPI C++ bindings])],
59-
[cxxex=1])
69+
[ompi_cxx_warn=1
70+
AS_IF([test "$enable_cxx_exceptions" != "no"],
71+
[ompi_cxx_error=1])
72+
])
6073

61-
AS_IF([test "$enable_mpi_cxx" = "no" ],
62-
[cxx=0])
63-
64-
AS_IF([test "$enable_mpi_cxx_seek" = "no" ],
65-
[cxxseek=0])
66-
67-
AS_IF([test "$enable_cxx_exceptions" = "no" ],
68-
[cxxex=0])
69-
70-
AS_IF([test $cxx -eq 1 || test $cxxseek -eq 1 || test $cxxex -eq 1],
71-
[AC_MSG_WARN([The MPI C++ bindings have been removed from Open MPI.])
74+
AS_IF([test $ompi_cxx_warn -eq 1],
75+
[AC_MSG_WARN([An MPI C++ bindings-related command line option])
76+
AC_MSG_WARN([was given to "configure".])
77+
AC_MSG_WARN([ ])
78+
AC_MSG_WARN([This command line option will be removed in a future])
79+
AC_MSG_WARN([version of Open MPI; you should discontinue using it.])
80+
AC_MSG_WARN([You have been warned!])
81+
AC_MSG_WARN([ ])
82+
AC_MSG_WARN([The MPI C++ bindings were deprecated in the MPI-2.2])
83+
AC_MSG_WARN([standard in 2009, and removed from the MPI-3.0])
84+
AC_MSG_WARN([standard in 2012. The MPI C++ bindings were then])
85+
AC_MSG_WARN([removed from Open MPI v5.0.0 in 2022.])
86+
AC_MSG_WARN([ ])
7287
AC_MSG_WARN([If you need support for the MPI C++ bindings, you])
7388
AC_MSG_WARN([will need to use an older version of Open MPI.])
74-
AC_MSG_ERROR([Build cannot continue.])
7589
])
7690

91+
AS_IF([test $ompi_cxx_error -eq 1],
92+
[AC_MSG_ERROR([Build cannot continue.])])
93+
7794
OPAL_VAR_SCOPE_POP
7895
])

0 commit comments

Comments
 (0)