Skip to content

Commit 7e80e2f

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 adjusts the top-level configure.ac script to explicitly save the result of checking for "struct sockaddr_in" into $opal_found_sockaddr_in. Finally, slightly change the AC_MSG_RESULT output in the opal/mca/if/*/configure.m4 scripts to make it clear that the check for "struct sockaddr_in" is *not* using the regular AC_CHECK_TYPES method. Instead, the "cached" results it is getting are from OPAL caching, not regular Autoconf test caching. 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 7e80e2f

File tree

5 files changed

+49
-27
lines changed

5 files changed

+49
-27
lines changed

configure.ac

+21-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2929
# Copyright (c) 2019 Triad National Security, LLC. All rights
3030
# reserved.
31-
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
31+
# Copyright (c) 2023-2025 Jeffrey M. Squyres. All rights reserved.
3232
# Copyright (c) 2025 Nanook Consulting All rights reserved.
3333
# $COPYRIGHT$
3434
#
@@ -735,7 +735,26 @@ AC_CACHE_SAVE
735735

736736
opal_show_title "Type tests"
737737

738-
AC_CHECK_TYPES([socklen_t, struct sockaddr_in, struct sockaddr_in6,
738+
# We check elsewhere in configure tests if sockaddr_in is supported,
739+
# so explicitly save the result of that test.
740+
AC_CHECK_TYPES([struct sockaddr_in],
741+
[opal_found_sockaddr_in=yes],
742+
[opal_found_sockaddr_in=no],
743+
[AC_INCLUDES_DEFAULT
744+
#if HAVE_SYS_SOCKET_H
745+
#include <sys/socket.h>
746+
#endif
747+
#ifdef HAVE_NETINET_IN_H
748+
#include <netinet/in.h>
749+
#endif
750+
#ifdef HAVE_LINUX_ETHTOOL_H
751+
#include <linux/ethtool.h>
752+
#endif
753+
#ifdef HAVE_NET_IF_H
754+
#include <net/if.h>
755+
#endif])
756+
757+
AC_CHECK_TYPES([socklen_t, struct sockaddr_in6,
739758
struct sockaddr_storage, struct ifreq, struct ethtool_cmd],
740759
[], [], [AC_INCLUDES_DEFAULT
741760
#if HAVE_SYS_SOCKET_H

opal/mca/if/bsdx_ipv4/configure.m4

+9-9
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
@@ -29,19 +30,18 @@ AC_DEFUN([MCA_opal_if_bsdx_ipv4_CONFIG], [
2930
# happy. I.e., this:
3031
#if defined(__NetBSD__) || defined(__FreeBSD__) || \
3132
# defined(__OpenBSD__) || defined(__DragonFly__)
32-
AC_MSG_CHECKING([struct sockaddr])
33-
AS_IF([test "$opal_found_sockaddr" = "yes"],
34-
[AC_MSG_RESULT([yes (cached)])
33+
AC_MSG_CHECKING([struct sockaddr_in])
34+
AS_IF([test "$opal_found_sockaddr_in" = "yes"],
35+
[AC_MSG_RESULT([yes (OPAL cached)])
3536
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"],
37+
AS_IF([test "$oac_found_netbsd" = "yes" || \
38+
test "$oac_found_freebsd" = "yes" || \
39+
test "$oac_found_openbsd" = "yes" || \
40+
test "$oac_found_dragonfly" = "yes"],
4041
[AC_MSG_RESULT([yes])
4142
$1],
4243
[AC_MSG_RESULT([no])
4344
$2])],
44-
[AC_MSG_RESULT([no (cached)])
45+
[AC_MSG_RESULT([no (OPAL cached)])
4546
$2])
4647
])
47-

opal/mca/if/bsdx_ipv6/configure.m4

+11-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
@@ -29,20 +30,20 @@ AC_DEFUN([MCA_opal_if_bsdx_ipv6_CONFIG], [
2930
# happy. I.e., this:
3031
#if defined( __NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
3132
# 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)])
33+
AC_MSG_CHECKING([struct sockaddr_in])
34+
AS_IF([test "$opal_found_sockaddr_in" = "yes"],
35+
[AC_MSG_RESULT([yes (OPAL cached)])
3536
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"],
37+
AS_IF([test "$oac_found_netbsd" = "yes" || \
38+
test "$oac_found_freebsd" = "yes" || \
39+
test "$oac_found_openbsd" = "yes" || \
40+
test "$oac_found_386bsd" = "yes" || \
41+
test "$oac_found_bsdi" = "yes" ||
42+
test "$oac_found_apple" = "yes"],
4243
[AC_MSG_RESULT([yes])
4344
$1],
4445
[AC_MSG_RESULT([no])
4546
$2])],
46-
[AC_MSG_RESULT([no (cached)])
47+
[AC_MSG_RESULT([no (OPAL cached)])
4748
$2])
4849
])dnl

opal/mca/if/linux_ipv6/configure.m4

+2-1
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,7 +29,7 @@ AC_DEFUN([MCA_opal_if_linux_ipv6_CONFIG], [
2829
AC_MSG_CHECKING([if we are on Linux with TCP])
2930
# If we have struct sockaddr and we're on Linux, then we're
3031
# happy.
31-
AS_IF([test "$opal_found_sockaddr" = "yes" && test "$opal_found_linux" = "yes"],
32+
AS_IF([test "$opal_found_sockaddr_in" = "yes" && test "$oac_found_linux" = "yes"],
3233
[AC_MSG_RESULT([yes])
3334
$1],
3435
[AC_MSG_RESULT([no])

opal/mca/if/posix_ipv4/configure.m4

+6-5
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
@@ -32,16 +33,16 @@ AC_DEFUN([MCA_opal_if_posix_ipv4_CONFIG], [
3233
# we're happy. I.e., if posix but not:
3334
#if defined(__NetBSD__) || defined(__FreeBSD__) || \
3435
# defined(__OpenBSD__) || defined(__DragonFly__)
35-
AC_MSG_CHECKING([struct sockaddr])
36-
AS_IF([test "$opal_found_sockaddr" = "yes"],
37-
[AC_MSG_RESULT([yes (cached)])
36+
AC_MSG_CHECKING([struct sockaddr_in])
37+
AS_IF([test "$opal_found_sockaddr_in" = "yes"],
38+
[AC_MSG_RESULT([yes (OPAL cached)])
3839
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"],
40+
AS_IF([test "$oac_found_netbsd" = "no" && test "$oac_found_freebsd" = "no" && test "$oac_found_openbsd" = "no" && test "$oac_found_dragonfly" = "no"],
4041
[AC_MSG_RESULT([yes])
4142
opal_if_posix_ipv4_happy=yes],
4243
[AC_MSG_RESULT([no])]
4344
)],
44-
[AC_MSG_RESULT([no (cached)])]
45+
[AC_MSG_RESULT([no (OPAL cached)])]
4546
)
4647

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

0 commit comments

Comments
 (0)