Skip to content

Commit 8e8b6be

Browse files
authored
Merge pull request #11190 from jsquyres/pr/port-sphinx-to-oac-macros
Migrate to OAC_SUMMARY_* and OAC_SETUP_SPHINX
2 parents d35f655 + 8d2eae7 commit 8e8b6be

File tree

4 files changed

+35
-211
lines changed

4 files changed

+35
-211
lines changed

config/opal_setup_sphinx.m4

Lines changed: 0 additions & 112 deletions
This file was deleted.

config/opal_summary.m4

Lines changed: 28 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -14,80 +14,20 @@ dnl
1414
dnl $HEADER$
1515
dnl
1616

17-
# OPAL_SUMMARY_ADD(section, topic, unused, result)
18-
#
19-
# queue a summary line in the given section of the form:
20-
# topic: result
21-
#
22-
# section:topic lines are only added once; first to add wins.
23-
# The key for uniqification is a shell-variable-ified representation
24-
# of section followed by an underscore followed by a
25-
# shell-variable-ified representation of line.
26-
#
27-
# There are no restrictions on the contents of section and topic; they
28-
# can be variable references (although the use case for this is
29-
# dubious) and they can contain most ASCII characters (escape
30-
# characters excluded). Note that some care must be taken with the
31-
# unique check and this liberal rule, as the unique check is after the
32-
# string has been run through AS_TR_SH. Basically, any character that
33-
# is not legal in a shell variable name will be turned into an
34-
# underscore. So the strings "Section_foo" and "Section-foo" would be
35-
# the same as far as the unique check is concerned.
36-
#
37-
# The input strings are evaluated during OPAL_SUMMARY_ADD, not during
38-
# OPAL_SUMMARY_PRINT. This seems to meet the principle of least
39-
# astonishment. A common pattern is to call
40-
# OPAL_SUMMARY_ADD([Resource Type], [Component Name], [], [$results])
41-
# and then unset $results to avoid namespace pollution. This will
42-
# work properly with the current behavior, but would result in odd
43-
# errors if we delayed evaluation.
44-
#
45-
# As a historical note, the third argument has never been used in
46-
# OPAL_SUMMARY_ADD and its meaning is unclear. Preferred behavior is
47-
# to leave it empty.
48-
#
49-
# As a final historical note, the initial version of SUMMARY_ADD was
50-
# added with implementation of the callers having all of the section
51-
# and topic headers double quoted. This was never necessary, and
52-
# certainly is not with the current implementation. While harmless,
53-
# it is not great practice to over-quote, so we recommend against
54-
# doing so.
55-
# -----------------------------------------------------------
17+
dnl OPAL_SUMMARY_ADD(section, topic, unused, result)
18+
dnl
19+
dnl Turn around and call OAC_SUMMARY_ADD
20+
dnl -----------------------------------------------------------
5621
AC_DEFUN([OPAL_SUMMARY_ADD],[
57-
OPAL_VAR_SCOPE_PUSH([opal_summary_line opal_summary_newline opal_summary_key])
58-
59-
# The end quote on the next line is intentional!
60-
opal_summary_newline="
61-
"
62-
opal_summary_line="$2: $4"
63-
opal_summary_key="AS_TR_SH([$1])_AS_TR_SH([$2])"
64-
65-
# Use the section name variable as an indicator for whether or not
66-
# the section has already been created.
67-
AS_IF([AS_VAR_TEST_SET([opal_summary_section_]AS_TR_SH([$1])[_name])],
68-
[],
69-
[AS_VAR_SET([opal_summary_section_]AS_TR_SH([$1])[_name], ["$1"])
70-
OPAL_APPEND([opal_summary_sections], [AS_TR_SH([$1])])])
71-
72-
# Use the summary key as indicator if the section:topic has already
73-
# been added to the results for the given section.
74-
AS_IF([AS_VAR_TEST_SET([${opal_summary_key}])],
75-
[],
76-
[AS_VAR_SET([${opal_summary_key}], [1])
77-
dnl this is a bit overcomplicated, but we are basically implementing
78-
dnl a poor mans AS_VAR_APPEND with the ability to specify a separator,
79-
dnl because we have a newline separator in the string.
80-
AS_IF([AS_VAR_TEST_SET([opal_summary_section_]AS_TR_SH([$1])[_value])],
81-
[AS_VAR_APPEND([opal_summary_section_]AS_TR_SH([$1])[_value],
82-
["${opal_summary_newline}${opal_summary_line}"])],
83-
[AS_VAR_SET([opal_summary_section_]AS_TR_SH([$1])[_value],
84-
["${opal_summary_line}"])])])
85-
86-
OPAL_VAR_SCOPE_POP
22+
OAC_SUMMARY_ADD([$1], [$2], [$4])
8723
])
8824

25+
dnl OPAL_SUMMARY_PRINT
26+
dnl
27+
dnl Print a bunch of Open MPI summary configuration information and
28+
dnl then turn around and call OAC_SUMMARY_PRINT.
29+
dnl -----------------------------------------------------------
8930
AC_DEFUN([OPAL_SUMMARY_PRINT],[
90-
OPAL_VAR_SCOPE_PUSH([opal_summary_section opal_summary_section_name])
9131
cat <<EOF
9232
9333
Open MPI configuration:
@@ -97,69 +37,60 @@ MPI Standard Version: $MPI_VERSION.$MPI_SUBVERSION
9737
EOF
9838
9939
if test "$project_ompi_amc" = "true" ; then
100-
echo "Build MPI C bindings: yes"
40+
echo "Build MPI C bindings: yes" >&AS_MESSAGE_FD
10141
else
102-
echo "Build MPI C bindings: no"
42+
echo "Build MPI C bindings: no" >&AS_MESSAGE_FD
10343
fi
10444
10545
dnl Print out the bindings if we are building OMPI
10646
if test "$project_ompi_amc" = "true" ; then
10747
if test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_MPIFH_BINDINGS ; then
108-
echo "Build MPI Fortran bindings: mpif.h"
48+
echo "Build MPI Fortran bindings: mpif.h" >&AS_MESSAGE_FD
10949
elif test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_USEMPI_BINDINGS ; then
110-
echo "Build MPI Fortran bindings: mpif.h, use mpi"
50+
echo "Build MPI Fortran bindings: mpif.h, use mpi" >&AS_MESSAGE_FD
11151
elif test $OMPI_BUILD_FORTRAN_BINDINGS = $OMPI_FORTRAN_USEMPIF08_BINDINGS ; then
112-
echo "Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08"
52+
echo "Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08" >&AS_MESSAGE_FD
11353
else
114-
echo "Build MPI Fortran bindings: no"
54+
echo "Build MPI Fortran bindings: no" >&AS_MESSAGE_FD
11555
fi
11656
11757
if test $WANT_MPI_JAVA_BINDINGS -eq 1 ; then
118-
echo "Build MPI Java bindings (experimental): yes"
58+
echo "Build MPI Java bindings (experimental): yes" >&AS_MESSAGE_FD
11959
else
120-
echo "Build MPI Java bindings (experimental): no"
60+
echo "Build MPI Java bindings (experimental): no" >&AS_MESSAGE_FD
12161
fi
12262
fi
12363
12464
if test "$project_oshmem_amc" = "true" ; then
125-
echo "Build Open SHMEM support: yes"
65+
echo "Build Open SHMEM support: yes" >&AS_MESSAGE_FD
12666
elif test -z "$project_oshmem_amc" ; then
127-
echo "Build Open SHMEM support: no"
67+
echo "Build Open SHMEM support: no" >&AS_MESSAGE_FD
12868
else
129-
echo "Build Open SHMEM support: $project_oshmem_amc"
69+
echo "Build Open SHMEM support: $project_oshmem_amc" >&AS_MESSAGE_FD
13070
fi
13171
13272
if test $WANT_DEBUG = 0 ; then
133-
echo "Debug build: no"
73+
echo "Debug build: no" >&AS_MESSAGE_FD
13474
else
135-
echo "Debug build: yes"
75+
echo "Debug build: yes" >&AS_MESSAGE_FD
13676
fi
13777
13878
if test ! -z $with_platform ; then
139-
echo "Platform file: $with_platform"
79+
echo "Platform file: $with_platform" >&AS_MESSAGE_FD
14080
else
141-
echo "Platform file: (none)"
81+
echo "Platform file: (none)" >&AS_MESSAGE_FD
14282
fi
14383
144-
echo
84+
echo " " >&AS_MESSAGE_FD
14585
146-
for opal_summary_section in ${opal_summary_sections} ; do
147-
AS_VAR_COPY([opal_summary_section_name], [opal_summary_section_${opal_summary_section}_name])
148-
AS_VAR_COPY([opal_summary_section_value], [opal_summary_section_${opal_summary_section}_value])
149-
echo "${opal_summary_section_name}"
150-
echo "-----------------------"
151-
echo "${opal_summary_section_value}" | sort -f
152-
echo " "
153-
done
86+
OAC_SUMMARY_PRINT
15487
15588
if test $WANT_DEBUG = 1 ; then
156-
cat <<EOF
89+
cat >&AS_MESSAGE_FD <<EOF
15790
*****************************************************************************
15891
THIS IS A DEBUG BUILD! DO NOT USE THIS BUILD FOR PERFORMANCE MEASUREMENTS!
15992
*****************************************************************************
16093
16194
EOF
16295
fi
163-
164-
OPAL_VAR_SCOPE_POP
16596
])

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ AC_PREREQ(2.60)
6060
AC_CONFIG_AUX_DIR(config)
6161
AC_CONFIG_MACRO_DIR(config)
6262

63+
OAC_PUSH_PREFIX([OPAL])
64+
6365
OPAL_CAPTURE_CONFIGURE_CLI([OPAL_CONFIGURE_CLI])
6466

6567
# Get our platform support file. This has to be done very, very early
@@ -1064,7 +1066,10 @@ AS_IF([test -z "$LEX" || \
10641066
# Setup HTML and man page processing
10651067
#
10661068

1067-
OPAL_SETUP_SPHINX
1069+
OAC_SETUP_SPHINX([$srcdir/docs/_build/man/MPI_T.5],
1070+
dnl Note that we have to double escape the string below
1071+
dnl so that the # it contains doesn't confuse the Autotools
1072+
[[https://docs.open-mpi.org/en/main/developers/prerequisites.html#sphinx-and-therefore-python]])
10681073

10691074
#
10701075
# File system case sensitivity

0 commit comments

Comments
 (0)