Skip to content

Commit 6e4f7e1

Browse files
committed
Use OPAL_3RDPARTY_WITH with PRRTE
Extend the OPAL_3RDPARTY_WITH code to support packages which can be disabled (notably, PRRTE) and remove a bunch of duplicated code in the PRRTE configure check. Signed-off-by: Brian Barrett <bbarrett@amazon.com> (cherry picked from commit 880ba67)
1 parent b58ad5e commit 6e4f7e1

File tree

2 files changed

+40
-53
lines changed

2 files changed

+40
-53
lines changed

config/ompi_setup_prrte.m4

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dnl Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
1616
dnl reserved.
1717
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1818
dnl Copyright (c) 2019-2020 Intel, Inc. All rights reserved.
19-
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
19+
dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates.
2020
dnl All Rights reserved.
2121
dnl Copyright (c) 2021 Nanook Consulting. All rights reserved.
2222
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
@@ -43,40 +43,11 @@ AC_DEFUN([OMPI_SETUP_PRRTE],[
4343
4444
opal_show_subtitle "Configuring PRRTE"
4545
46-
# Don't use OPAL_3RDPARTY_WITH because it will not allow packages
47-
# to be disabled
48-
m4_ifdef([package_prrte],
49-
[AC_ARG_WITH([prrte],
50-
[AS_HELP_STRING([--with-prrte(=DIR)],
51-
[Build PRTE support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of PRRTE. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and fall back to an internal version if one is not found.])])],
52-
[AC_ARG_WITH([prrte],
53-
[AS_HELP_STRING([--with-prrte(=DIR)],
54-
[Build PRRTE support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of PRRTE. Supplying a valid directory name also forces Open MPI to use an external installation of PRRTE, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. If no argument is specified, Open MPI will search default locations for PRRTE and disable creating mpirun symlinks if one is not found.])])])
46+
OPAL_3RDPARTY_WITH([prrte], [prrte], [package_prrte], [1])
5547
5648
m4_ifdef([package_prrte],
5749
[OMPI_PRRTE_ADD_ARGS])
5850
59-
# clean up $with_prrte so that it contains only a path or empty
60-
# string. To determine internal or external preferences, use
61-
# $opal_prrte_mode.
62-
AS_IF([test "$with_prrte" = "yes"], [with_prrte=])
63-
AS_CASE([$with_prrte],
64-
["internal"], [with_prrte=""
65-
opal_prrte_mode="internal"],
66-
["external"], [with_prrte=""
67-
opal_prrte_mode="external"],
68-
[""], [opal_prrte_mode="unspecified"],
69-
["no"], [opal_prrte_mode="disabled"],
70-
[opal_prrte_mode="external"])
71-
72-
echo "with_prrte: $with_prrte"
73-
echo "opal_prrte_mode: $opal_prrte_mode"
74-
75-
m4_ifdef([package_prrte], [],
76-
[AS_IF([test "$opal_prrte_mode" = "internal"],
77-
[AC_MSG_WARN([Invalid argument to --with-prrte: internal.])
78-
AC_MSG_ERROR([Cannot continue])])])
79-
8051
prrte_setup_internal_happy=0
8152
m4_ifdef([package_prrte], [
8253
# always configure the internal prrte, so that

config/opal_config_3rdparty.m4

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved
44
dnl Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
55
dnl Copyright (c) 2015-2018 Research Organization for Information Science
66
dnl and Technology (RIST). All rights reserved.
7-
dnl Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
7+
dnl Copyright (c) 2020-2021 Amazon.com, Inc. or its affiliates. All Rights
88
dnl reserved.
99
dnl $COPYRIGHT$
1010
dnl
@@ -13,44 +13,58 @@ dnl
1313
dnl $HEADER$
1414
dnl
1515

16-
dnl OPAL_3RDPARTY_WITH(short package name, long package name, internal supported)
16+
dnl OPAL_3RDPARTY_WITH(short package name, long package name,
17+
dnl internal supported, disabled ok)
1718
dnl
1819
dnl Basic --with-pkg/--with-pkg-libdir handling for 3rd party
1920
dnl packages, with the big long description of internal/external/path
2021
dnl handling.
2122
dnl
2223
dnl At the end of this macro, with_pkg will contain an empty string or
23-
dnl a path (implying external). Further, the shell variable opal_pkg_mode
24-
dnl will be set to "internal", "external", or "unspecified". If a path is
25-
dnl given to --with-pkg, then opal_pkg_mode will be set to external.
24+
dnl a path (the later implying external). Further, the shell variable
25+
dnl opal_pkg_mode will be set to "internal", "external",
26+
dnl "unspecified", or "disabled". If a path is given to --with-pkg, then
27+
dnl opal_pkg_mode will be set to external. If "internal supported" is
28+
dnl not defined, then opal_pkg_mode will not be internal. If
29+
dnl "disabled ok" is not defined, then opal_pkg_mode will not be
30+
dnl "disabled".
2631
dnl
2732
dnl If m4_ifdef(internal support) does not evaluate to true (ie, at
2833
dnl autogen time), the references to internal in the help strings will
2934
dnl be removed and internal will not be a supported option.
3035
dnl
36+
dnl If m4_ifval(ddisbaled ok) does not evaluete to true (ie, at autogen
37+
dnl time), then --without-pkg will not be a valid configure option and
38+
dnl will raise an error.
39+
dnl
3140
dnl $1: short package name
3241
dnl $2: long pacakage name
3342
AC_DEFUN([OPAL_3RDPARTY_WITH], [
34-
m4_ifdef([$3],
35-
[AC_ARG_WITH([$1],
36-
[AS_HELP_STRING([--with-$1(=DIR)],
37-
[Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])
38-
39-
AC_ARG_WITH([$1-libdir],
40-
[AS_HELP_STRING([--with-$1-libdir=DIR],
41-
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])],
42-
[AC_ARG_WITH([$1],
43-
[AS_HELP_STRING([--with-$1(=DIR)],
44-
[Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])
43+
m4_ifval([$4],
44+
[m4_ifdef([$3],
45+
[AC_ARG_WITH([$1],
46+
[AS_HELP_STRING([--with-$1(=DIR)],
47+
[Build $2 support. DIR can take one of four values: "internal", "external", "no", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])],
48+
[AC_ARG_WITH([$1],
49+
[AS_HELP_STRING([--with-$1(=DIR)],
50+
[Build $2 support. DIR can take one of three values: "external", "no", or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. "no" means that Open MPI will not build components that require this package. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])],
51+
[m4_ifdef([$3],
52+
[AC_ARG_WITH([$1],
53+
[AS_HELP_STRING([--with-$1(=DIR)],
54+
[Build $2 support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" forces Open MPI to use its internal copy of $2. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and fall back to an internal version if one is not found.])])],
55+
[AC_ARG_WITH([$1],
56+
[AS_HELP_STRING([--with-$1(=DIR)],
57+
[Build $2 support. DIR can take one of two values: "external" or a valid directory name. "external" forces Open MPI to use an external installation of $2. Supplying a valid directory name also forces Open MPI to use an external installation of $2, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI no longer supports --without-$1. If no argument is specified, Open MPI will search default locations for $2 and error if one is not found.])])])])
4558
46-
AC_ARG_WITH([$1-libdir],
47-
[AS_HELP_STRING([--with-$1-libdir=DIR],
48-
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])])
59+
AC_ARG_WITH([$1-libdir],
60+
[AS_HELP_STRING([--with-$1-libdir=DIR],
61+
[Search for $2 libraries in DIR. Should only be used if an external copy of $2 is being used.])])
4962
5063
# Bozo check
51-
AS_IF([test "$with_$1" = "no"],
52-
[AC_MSG_WARN([It is not possible to configure Open MPI --without-$1])
53-
AC_MSG_ERROR([Cannot continue])])
64+
m4_ifval([$4], [],
65+
[AS_IF([test "$with_$1" = "no"],
66+
[AC_MSG_WARN([It is not possible to configure Open MPI --without-$1])
67+
AC_MSG_ERROR([Cannot continue])])])
5468
5569
AS_IF([test "$with_$1_libdir" = "no" -o "$with_$1_libdir" = "yes"],
5670
[AC_MSG_WARN([yes/no are invalid responses for --with-$1-libdir. Please specify a path.])
@@ -73,6 +87,8 @@ AC_DEFUN([OPAL_3RDPARTY_WITH], [
7387
opal_$1_mode="internal"],
7488
["external"], [with_$1=""
7589
opal_$1_mode="external"],
90+
["no"], [with_$1=""
91+
opal_$1_mode="disabled"],
7692
[""], [opal_$1_mode="unspecified"],
7793
[opal_$1_mode="external"])
7894

0 commit comments

Comments
 (0)