Skip to content

Commit f744b78

Browse files
committed
opal/mca/if: fix "struct sockaddr_in" and OS checks
Found a few more places we needed to adjust for changing from OPAL_CHECK_OS_FLAVORS to OAC_CHECK_OS_FLAVORS. Also, in the opal/mca/if components, we have configure.m4 scripts that explicitly check $opal_found_sockaddr. This was a problem for a few reasons: 1. We just deleted the setting of $opal_found_sockaddr from the previous OPAL_CHECK_OS_FLAVORS macro (*why* it was set in that macro isn't really clear -- "struct sockaddr" doesn't really have anything to do with checking OS flavors). 2. The old OPAL_CHECK_OS_FLAVORS macro actually checking for "struct sockaddr_in", not "struct sockaddr". This led to a lot of confusion in this round of debugging. Also, the additional network header checks and check for struct sockaddr_in in OPAL_CHECK_OS_FLAVORS were redundant: they were already being performed in OMPI's top-level configure.ac. Deleting these redundant tests -- and indeed, deleting all of OPAL_CHECK_OS_FLAVORS -- is fine. But we did need to set a global variable for the opal/mca/if/*/configure.m4 scripts to check. This commit therefore does the following: * Adjusts the configure.m4 in the various opal/mca/if components that were previously looking at $opal_found_sockaddr. * Each configure.m4 now looks for ac_cv_type_struct_sockaddr_in[6] as relevant. * Also update them to use the OAC OS result variables. * Update relevant comments to explain that we're using $ac_cv_type_... instead of calling AC_CHECK_TYPES again because that test is a bit cumbersome with all the required #includes. * Slightly modify the test/results output emitted by these configure tests to make it clear that we're not calling AC_CHECK_TYPES. Do this because the "(cached)" output that it previously emitted caused considerable confusion during this round of debugging (i.e., I assumed it was coming from regular Autoconf test caching, which is an entirely different mechanism). Signed-off-by: Jeff Squyres <[email protected]>
1 parent f1201ab commit f744b78

File tree

4 files changed

+42
-32
lines changed

4 files changed

+42
-32
lines changed

opal/mca/if/bsdx_ipv4/configure.m4

+12-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2025 Nanook Consulting All rights reserved.
7+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
78
# $COPYRIGHT$
89
#
910
# Additional copyrights may follow
@@ -25,23 +26,24 @@ AC_DEFUN([MCA_opal_if_bsdx_ipv4_CONFIG], [
2526

2627
AC_REQUIRE([OAC_CHECK_OS_FLAVORS])
2728

28-
# If we found struct sockaddr and we're on any of the BSDs, we're
29+
# If we previously found struct sockaddr_in (we don't repeat the
30+
# AC CHECK_TYPES test here simply because it's cumbersome with all
31+
# the required #includes) and we're on any of the BSDs, we're
2932
# happy. I.e., this:
3033
#if defined(__NetBSD__) || defined(__FreeBSD__) || \
3134
# defined(__OpenBSD__) || defined(__DragonFly__)
32-
AC_MSG_CHECKING([struct sockaddr])
33-
AS_IF([test "$opal_found_sockaddr" = "yes"],
34-
[AC_MSG_RESULT([yes (cached)])
35+
AC_MSG_CHECKING([struct sockaddr_in again])
36+
AS_IF([test "$ac_cv_type_struct_sockaddr_in" = "yes"],
37+
[AC_MSG_RESULT([yes (OPAL cached)])
3538
AC_MSG_CHECKING([NetBSD, FreeBSD, OpenBSD, or DragonFly])
36-
AS_IF([test "$opal_found_netbsd" = "yes" || \
37-
test "$opal_found_freebsd" = "yes" || \
38-
test "$opal_found_openbsd" = "yes" || \
39-
test "$opal_found_dragonfly" = "yes"],
39+
AS_IF([test "$oac_found_netbsd" = "yes" || \
40+
test "$oac_found_freebsd" = "yes" || \
41+
test "$oac_found_openbsd" = "yes" || \
42+
test "$oac_found_dragonfly" = "yes"],
4043
[AC_MSG_RESULT([yes])
4144
$1],
4245
[AC_MSG_RESULT([no])
4346
$2])],
44-
[AC_MSG_RESULT([no (cached)])
47+
[AC_MSG_RESULT([no (OPAL cached)])
4548
$2])
4649
])
47-

opal/mca/if/bsdx_ipv6/configure.m4

+14-11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2025 Nanook Consulting All rights reserved.
7+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
78
# $COPYRIGHT$
89
#
910
# Additional copyrights may follow
@@ -25,24 +26,26 @@ AC_DEFUN([MCA_opal_if_bsdx_ipv6_CONFIG], [
2526

2627
AC_REQUIRE([OAC_CHECK_OS_FLAVORS])
2728

28-
# If we found struct sockaddr and we're on any of the BSDs, we're
29+
# If we previously found struct sockaddr_in6 (we don't repeat the
30+
# AC CHECK_TYPES test here simply because it's cumbersome with all
31+
# the required #includes) and we're on any of the BSDs, we're
2932
# happy. I.e., this:
3033
#if defined( __NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
3134
# defined(__386BSD__) || defined(__bsdi__) || defined(__APPLE__)
32-
AC_MSG_CHECKING([struct sockaddr])
33-
AS_IF([test "$opal_found_sockaddr" = "yes"],
34-
[AC_MSG_RESULT([yes (cached)])
35+
AC_MSG_CHECKING([struct sockaddr_in6 again])
36+
AS_IF([test "$ac_cv_type_struct_sockaddr_in6" = "yes"],
37+
[AC_MSG_RESULT([yes (OPAL cached)])
3538
AC_MSG_CHECKING([some flavor of BSD])
36-
AS_IF([test "$opal_found_netbsd" = "yes" || \
37-
test "$opal_found_freebsd" = "yes" || \
38-
test "$opal_found_openbsd" = "yes" || \
39-
test "$opal_found_386bsd" = "yes" || \
40-
test "$opal_found_bsdi" = "yes" ||
41-
test "$opal_found_apple" = "yes"],
39+
AS_IF([test "$oac_found_netbsd" = "yes" || \
40+
test "$oac_found_freebsd" = "yes" || \
41+
test "$oac_found_openbsd" = "yes" || \
42+
test "$oac_found_386bsd" = "yes" || \
43+
test "$oac_found_bsdi" = "yes" ||
44+
test "$oac_found_apple" = "yes"],
4245
[AC_MSG_RESULT([yes])
4346
$1],
4447
[AC_MSG_RESULT([no])
4548
$2])],
46-
[AC_MSG_RESULT([no (cached)])
49+
[AC_MSG_RESULT([no (OPAL cached)])
4750
$2])
4851
])dnl

opal/mca/if/linux_ipv6/configure.m4

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2025 Nanook Consulting All rights reserved.
7+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
78
# $COPYRIGHT$
89
#
910
# Additional copyrights may follow
@@ -25,10 +26,11 @@ AC_DEFUN([MCA_opal_if_linux_ipv6_CONFIG], [
2526

2627
AC_REQUIRE([OAC_CHECK_OS_FLAVORS])
2728

28-
AC_MSG_CHECKING([if we are on Linux with TCP])
29-
# If we have struct sockaddr and we're on Linux, then we're
30-
# happy.
31-
AS_IF([test "$opal_found_sockaddr" = "yes" && test "$opal_found_linux" = "yes"],
29+
# If we previously found struct sockaddr_in6 (we don't repeat the
30+
# AC CHECK_TYPES test here simply because it's cumbersome with all
31+
# the required #includes) and we're on Linux, we're happy.
32+
AC_MSG_CHECKING([for Linux with struct sockaddr_in6])
33+
AS_IF([test "$ac_cv_type_struct_sockaddr_in6" = "yes" && test "$oac_found_linux" = "yes"],
3234
[AC_MSG_RESULT([yes])
3335
$1],
3436
[AC_MSG_RESULT([no])

opal/mca/if/posix_ipv4/configure.m4

+10-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Copyright (c) 2015 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
# Copyright (c) 2025 Nanook Consulting All rights reserved.
7+
# Copyright (c) 2025 Jeffrey M. Squyres. All rights reserved.
78
# $COPYRIGHT$
89
#
910
# Additional copyrights may follow
@@ -28,20 +29,22 @@ AC_DEFUN([MCA_opal_if_posix_ipv4_CONFIG], [
2829

2930
AC_REQUIRE([OAC_CHECK_OS_FLAVORS])
3031

31-
# If we found struct sockaddr and we're NOT on most of the BSDs,
32-
# we're happy. I.e., if posix but not:
32+
# If we previously found struct sockaddr_in (we don't repeat the
33+
# AC CHECK_TYPES test here simply because it's cumbersome with all
34+
# the required #includes) and we're NOT on most of the BSDs, we're
35+
# happy. I.e., this:
3336
#if defined(__NetBSD__) || defined(__FreeBSD__) || \
3437
# defined(__OpenBSD__) || defined(__DragonFly__)
35-
AC_MSG_CHECKING([struct sockaddr])
36-
AS_IF([test "$opal_found_sockaddr" = "yes"],
37-
[AC_MSG_RESULT([yes (cached)])
38+
AC_MSG_CHECKING([struct sockaddr_in again])
39+
AS_IF([test "$ac_cv_type_struct_sockaddr_in" = "yes"],
40+
[AC_MSG_RESULT([yes (OPAL cached)])
3841
AC_MSG_CHECKING([not NetBSD, FreeBSD, OpenBSD, or DragonFly])
39-
AS_IF([test "$opal_found_netbsd" = "no" && test "$opal_found_freebsd" = "no" && test "$opal_found_openbsd" = "no" && test "$opal_found_dragonfly" = "no"],
42+
AS_IF([test "$oac_found_netbsd" = "no" && test "$oac_found_freebsd" = "no" && test "$oac_found_openbsd" = "no" && test "$oac_found_dragonfly" = "no"],
4043
[AC_MSG_RESULT([yes])
4144
opal_if_posix_ipv4_happy=yes],
4245
[AC_MSG_RESULT([no])]
4346
)],
44-
[AC_MSG_RESULT([no (cached)])]
47+
[AC_MSG_RESULT([no (OPAL cached)])]
4548
)
4649

4750
AS_IF([test "$opal_if_posix_ipv4_happy" = "yes"],

0 commit comments

Comments
 (0)