From 0e610d8a1febba7478a60f9a5ab49f26dc9c0951 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 16 Mar 2022 03:08:10 +0000 Subject: [PATCH] build: Remove unnecessary configure tests Many of the configure tests that PRRTE runs are either not used (ie, checking for a case sensitive file system or 128 bit integers) or we use the tested item without conditionals throughout the code (ie, we use stdbool.h in multiple places and none of them have conditional checks). The second really isn't an issue; of the places I found that behaivor, we're likely leaving behind some ancient systems, but that hasn't proven to be a problem at this point. This patch removes all the tests where we didn't use the results. There is likely more shortening of the configure script that we could do, but this was the low hanging fruit. Signed-off-by: Brian Barrett --- config/c_weak_symbols.m4 | 135 ---------- config/prte_case_sensitive_fs_setup.m4 | 106 -------- config/prte_check_ps.m4 | 43 ---- configure.ac | 337 +------------------------ src/tools/prte_info/param.c | 2 - 5 files changed, 14 insertions(+), 609 deletions(-) delete mode 100644 config/c_weak_symbols.m4 delete mode 100644 config/prte_case_sensitive_fs_setup.m4 delete mode 100644 config/prte_check_ps.m4 diff --git a/config/c_weak_symbols.m4 b/config/c_weak_symbols.m4 deleted file mode 100644 index 84fc5ae869..0000000000 --- a/config/c_weak_symbols.m4 +++ /dev/null @@ -1,135 +0,0 @@ -dnl -*- shell-script -*- -dnl -dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -dnl University Research and Technology -dnl Corporation. All rights reserved. -dnl Copyright (c) 2004-2005 The University of Tennessee and The University -dnl of Tennessee Research Foundation. All rights -dnl reserved. -dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -dnl University of Stuttgart. All rights reserved. -dnl Copyright (c) 2004-2005 The Regents of the University of California. -dnl All rights reserved. -dnl Copyright (c) 2014 Research Organization for Information Science -dnl and Technology (RIST). All rights reserved. -dnl Copyright (c) 2014-2020 Cisco Systems, Inc. All rights reserved -dnl Copyright (c) 2019 Intel, Inc. All rights reserved. -dnl $COPYRIGHT$ -dnl -dnl Additional copyrights may follow -dnl -dnl $HEADER$ -dnl - -# _PRTE_C_WEAK_SYMBOLS(action_if_found, [action_if_not_found]) -# ------------------------------------------------------------ -AC_DEFUN([_PRTE_C_WEAK_SYMBOLS],[ - # need two files because icc will incorrectly not create the - # symbols if they are not used in the object file in which they - # are defined. Blah! - # To get to compile with icc, have them in a separate header. - cat > conftest_weak.h < conftest_weak.c < conftest.c < conftest_weak.h < conftest_weak.c < conftest.c < conf_fs_test.$$ < CONF_FS_TEST.$$ < /dev/null 2>&1 - -if test "$?" = "0"; then - PS_FLAVOR="ps -A -o fname,pid,uid" -else - ps -A -o command > /dev/null 2>&1 - if test "$?" = "0"; then - PS_FLAVOR="ps -A -o command,pid,uid" - fi -fi -AC_MSG_RESULT([$PS_FLAVOR]) -AC_DEFINE_UNQUOTED([PRTE_CLEAN_PS_CMD], ["$PS_FLAVOR"], [Specific ps command to use in prte-clean]) -]) diff --git a/configure.ac b/configure.ac index e95c7d4e02..501c1fe074 100644 --- a/configure.ac +++ b/configure.ac @@ -338,131 +338,30 @@ PRTE_SETUP_CC PRTE_CHECK_IDENT([CC], [CFLAGS], [c], [C]) -# -# Check for some types -# - -AC_CHECK_TYPES(int8_t) -AC_CHECK_TYPES(uint8_t) -AC_CHECK_TYPES(int16_t) -AC_CHECK_TYPES(uint16_t) -AC_CHECK_TYPES(int32_t) -AC_CHECK_TYPES(uint32_t) -AC_CHECK_TYPES(int64_t) -AC_CHECK_TYPES(uint64_t) -AC_CHECK_TYPES(int128_t) -AC_CHECK_TYPES(__int128) -AC_CHECK_TYPES(uint128_t) -AC_CHECK_TYPES(long long) -AC_CHECK_TYPES(__float128) -AC_CHECK_TYPES(long double) -# We only need these types if we're building the OMPI project, but -# PRTE currently doesn't protect for their lack of presence well. -AC_CHECK_HEADERS(complex.h) -AC_CHECK_TYPES(float _Complex) -AC_CHECK_TYPES(double _Complex) -AC_CHECK_TYPES(long double _Complex) -AC_CHECK_TYPES(intptr_t) -AC_CHECK_TYPES(uintptr_t) -AC_CHECK_TYPES(mode_t) -AC_CHECK_TYPES(ssize_t) -AC_CHECK_TYPES(ptrdiff_t) - # # Check for type sizes # -AC_CHECK_SIZEOF(_Bool) -AC_CHECK_SIZEOF(char) -AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) -AC_CHECK_SIZEOF(float) -AC_CHECK_SIZEOF(double) - -if test "$ac_cv_type_long_double" = yes; then - AC_CHECK_SIZEOF(long double) -fi - -AC_CHECK_SIZEOF(long double) -if test "$ac_cv_type___float128" = yes; then - AC_CHECK_SIZEOF(__float128) -fi - -# We only need these types if we're building the OMPI project, but -# PRTE currently doesn't protect for their lack of presence well. -AC_CHECK_SIZEOF(float _Complex) -AC_CHECK_SIZEOF(double _Complex) -AC_CHECK_SIZEOF(long double _Complex) - AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(size_t) -if test "$ac_cv_type_ssize_t" = yes ; then - AC_CHECK_SIZEOF(ssize_t) -fi - -if test "$ac_cv_type_ptrdiff_t" = yes; then - AC_CHECK_SIZEOF(ptrdiff_t) -else - AC_MSG_ERROR([ptrdiff_t type is not available, this is required by C99 standard. Cannot continue]) -fi - -AC_CHECK_SIZEOF(wchar_t) -AC_CHECK_SIZEOF(pid_t) - -# Check sizes of atomic types so we can define fixed-width types in PRTE -AC_CHECK_SIZEOF(atomic_short, [],[[#include ]]) -AC_CHECK_SIZEOF(atomic_int,[],[[#include ]]) -AC_CHECK_SIZEOF(atomic_long,[],[[#include ]]) -AC_CHECK_SIZEOF(atomic_llong,[],[[#include ]]) - # # Check for type alignments # AC_CHECK_ALIGNOF(bool, [AC_INCLUDES_DEFAULT #include ]) -AC_CHECK_ALIGNOF(int8_t) -AC_CHECK_ALIGNOF(int16_t) AC_CHECK_ALIGNOF(int32_t) AC_CHECK_ALIGNOF(int64_t) - -if test "$ac_cv_type_int128_t" = yes ; then - AC_CHECK_ALIGNOF(int128_t) -fi - -AC_CHECK_ALIGNOF(char) -AC_CHECK_ALIGNOF(short) -AC_CHECK_ALIGNOF(wchar_t) AC_CHECK_ALIGNOF(int) AC_CHECK_ALIGNOF(long) AC_CHECK_ALIGNOF(long long) -AC_CHECK_ALIGNOF(float) AC_CHECK_ALIGNOF(double) -AC_CHECK_ALIGNOF(long double) -if test "$ac_cv_type___float128" = yes; then - AC_CHECK_ALIGNOF(__float128) -fi - -# We only need these types if we're building the OMPI project, but -# PRTE currently doesn't protect for their lack of presence well. -AC_CHECK_ALIGNOF(float _Complex) -AC_CHECK_ALIGNOF(double _Complex) -AC_CHECK_ALIGNOF(long double _Complex) - -AC_CHECK_ALIGNOF(void *) AC_CHECK_ALIGNOF(size_t) -# -# Check for other compiler characteristics -# - -PRTE_C_WEAK_SYMBOLS -PRTE_C_MACRO_WEAK_SYMBOLS - - # Check if we support the offsetof compiler directive PRTE_CHECK_OFFSETOF @@ -510,33 +409,19 @@ PRTE_VAR_SCOPE_PUSH(PRTE_CFLAGS_save_for_headers) PRTE_CFLAGS_save_for_headers=$CFLAGS _PRTE_CHECK_SPECIFIC_CFLAGS(-Werror, Werror) -AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \ - dlfcn.h endian.h execinfo.h err.h fcntl.h grp.h libgen.h \ - libutil.h memory.h netdb.h netinet/in.h netinet/tcp.h \ - poll.h pthread.h pty.h pwd.h sched.h \ - strings.h stropts.h linux/ethtool.h linux/sockios.h \ - sys/fcntl.h sys/ipc.h sys/shm.h \ - sys/ioctl.h sys/mman.h sys/param.h sys/queue.h \ - sys/resource.h sys/select.h sys/socket.h sys/sockio.h \ - sys/stat.h sys/statfs.h sys/statvfs.h sys/time.h sys/tree.h \ - sys/types.h sys/uio.h sys/un.h net/uio.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h \ - termios.h ulimit.h unistd.h util.h utmp.h malloc.h \ - ifaddrs.h crt_externs.h regex.h mntent.h paths.h \ - ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h ieee754.h]) - -AC_CHECK_HEADERS([sys/mount.h], [], [], - [AC_INCLUDES_DEFAULT - #if HAVE_SYS_PARAM_H - #include - #endif - ]) - -AC_CHECK_HEADERS([sys/sysctl.h], [], [], - [AC_INCLUDES_DEFAULT - #if HAVE_SYS_PARAM_H - #include - #endif - ]) +AC_CHECK_HEADERS([arpa/inet.h dirent.h \ + dlfcn.h endian.h execinfo.h fcntl.h \ + libutil.h netdb.h netinet/in.h netinet/tcp.h \ + poll.h pty.h pwd.h sched.h \ + strings.h linux/ethtool.h linux/sockios.h \ + sys/fcntl.h \ + sys/ioctl.h sys/param.h sys/queue.h \ + sys/resource.h sys/select.h sys/socket.h \ + sys/stat.h sys/time.h \ + sys/types.h sys/uio.h sys/un.h net/uio.h sys/utsname.h sys/wait.h syslog.h \ + termios.h unistd.h util.h malloc.h \ + paths.h \ + ioLib.h sockLib.h hostLib.h]) # Needed to work around Darwin requiring sys/socket.h for # net/if.h @@ -556,36 +441,6 @@ AC_CHECK_HEADERS([net/if.h], [], [], #endif ]) -# Note that sometimes we have , but it doesn't work (e.g., -# have both Portland and GNU installed; using pgcc will find GNU's -# , which all it does -- by standard -- is define "bool" to -# "_Bool" [see -# http://pmixw.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html], -# and Portland has no idea what to do with _Bool). - -# So first figure out if we have (i.e., check the value of -# the macro HAVE_STDBOOL_H from the result of AC_CHECK_HEADERS, -# above). If we do have it, then check to see if it actually works. -# Define PMIX_USE_STDBOOL_H as approrpaite. -PRTE_VAR_SCOPE_PUSH([MSG]) -AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0]) -AC_MSG_CHECKING([if works]) -if test "$have_stdbool_h" = "1"; then - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT[ - #if HAVE_STDBOOL_H - #include - #endif - ]], - [[bool bar, foo = true; bar = foo;]])], - [PRTE_USE_STDBOOL_H=1 MSG=yes],[PRTE_USE_STDBOOL_H=0 MSG=no]) -else - PRTE_USE_STDBOOL_H=0 - MSG="no (don't have )" -fi -AC_DEFINE_UNQUOTED(PRTE_USE_STDBOOL_H, $PRTE_USE_STDBOOL_H, - [Whether to use or not]) -AC_MSG_RESULT([$MSG]) - CFLAGS=$PRTE_CFLAGS_save_for_headers PRTE_VAR_SCOPE_POP @@ -668,111 +523,10 @@ AC_CHECK_DECLS([AF_UNSPEC, PF_UNSPEC, AF_INET6, PF_INET6], #include #endif]) -# SA_RESTART in signal.h - -PRTE_VAR_SCOPE_PUSH([MSG]) -AC_MSG_CHECKING([if SA_RESTART defined in signal.h]) -AC_EGREP_CPP(yes, [ -#include -#ifdef SA_RESTART - yes -#endif ], [MSG=yes VALUE=1], [MSG=no VALUE=0]) -AC_DEFINE_UNQUOTED(PRTE_HAVE_SA_RESTART, $VALUE, - [Whether we have SA_RESTART in or not]) -AC_MSG_RESULT([$MSG]) -PRTE_VAR_SCOPE_POP - -AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [], [ -#include -#if HAVE_SYS_SOCKET_H -#include -#endif]) - -AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [ -#include -#include ]) - AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include ]) AC_CHECK_MEMBERS([siginfo_t.si_band],,,[#include ]) -# -# Checks for struct member names in struct statfs -# - -AC_CHECK_MEMBERS([struct statfs.f_type], [], [], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATFS_H -#include -#endif -]) - -AC_CHECK_MEMBERS([struct statfs.f_fstypename], [], [], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif -#ifdef HAVE_SYS_VFS_H -#include -#endif -#ifdef HAVE_SYS_STATFS_H -#include -#endif -]) - -# -# Checks for struct member names in struct statvfs -# - -AC_CHECK_MEMBERS([struct statvfs.f_basetype], [], [], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -]) - -AC_CHECK_MEMBERS([struct statvfs.f_fstypename], [], [], [ -AC_INCLUDES_DEFAULT -#ifdef HAVE_SYS_STATVFS_H -#include -#endif -]) - -# -# Check for ptrdiff type. Yes, there are platforms where -# sizeof(void*) != sizeof(long) (64 bit Windows, apparently). -# - -AC_MSG_CHECKING([for pointer diff type]) -if test $ac_cv_type_ptrdiff_t = yes ; then - prte_ptrdiff_t="ptrdiff_t" - prte_ptrdiff_size=$ac_cv_sizeof_ptrdiff_t -elif test $ac_cv_sizeof_void_p -eq $ac_cv_sizeof_long ; then - prte_ptrdiff_t="long" - prte_ptrdiff_size=$ac_cv_sizeof_long -elif test $ac_cv_type_long_long = yes && test $ac_cv_sizeof_void_p -eq $ac_cv_sizeof_long_long ; then - prte_ptrdiff_t="long long" - prte_ptrdiff_size=$ac_cv_sizeof_long_long -else - AC_MSG_ERROR([Could not find datatype to emulate ptrdiff_t. Cannot continue]) -fi - -AC_DEFINE_UNQUOTED([PRTE_PTRDIFF_TYPE], [$prte_ptrdiff_t], - [type to use for ptrdiff_t]) -AC_MSG_RESULT([$prte_ptrdiff_t (size: $prte_ptrdiff_size)]) - -# -# Find corresponding types for MPI_Aint, MPI_Count, and MPI_Offset. -# And if relevant, find the corresponding MPI_ADDRESS_KIND, -# MPI_COUNT_KIND, and MPI_OFFSET_KIND. -# - # checkpoint results AC_CACHE_SAVE @@ -800,9 +554,6 @@ PRTE_VAR_SCOPE_POP prte_show_title "Library and Function tests" -# Darwin doesn't need -lutil, as it's something other than this -lutil. -PRTE_SEARCH_LIBS_CORE([openpty], [util]) - PRTE_SEARCH_LIBS_CORE([gethostbyname], [nsl]) PRTE_SEARCH_LIBS_CORE([socket], [socket]) @@ -810,23 +561,10 @@ PRTE_SEARCH_LIBS_CORE([socket], [socket]) # Solaris has sched_yield in -lrt, usually in libc PRTE_SEARCH_LIBS_CORE([sched_yield], [rt]) -# IRIX and CentOS have dirname in -lgen, usually in libc -PRTE_SEARCH_LIBS_CORE([dirname], [gen]) - # Darwin doesn't need -lm, as it's a symlink to libSystem.dylib PRTE_SEARCH_LIBS_CORE([ceil], [m]) -# -lrt might be needed for clock_gettime -PRTE_SEARCH_LIBS_CORE([clock_gettime], [rt]) - -AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf openpty isatty getpwuid fork waitpid execve pipe ptsname setsid mmap tcgetpgrp posix_memalign strsignal sysconf syslog vsyslog regcmp regexec regfree _NSGetEnviron socketpair strncpy_s usleep mkfifo dbopen dbm_open statfs statvfs setpgid setenv __malloc_initialize_hook]) - -# Sanity check: ensure that we got at least one of statfs or statvfs. - -if test $ac_cv_func_statfs = no && test $ac_cv_func_statvfs = no; then - AC_MSG_WARN([neither statfs() and statvfs() were found]) - AC_MSG_ERROR([Cannot continue]) -fi +AC_CHECK_FUNCS([asprintf snprintf vasprintf vsnprintf fork setsid strsignal syslog setpgid]) # On some hosts, htonl is a define, so the AC_CHECK_FUNC will get # confused. On others, it's in the standard library, but stubbed with @@ -856,22 +594,6 @@ AS_IF([test "$prte_cv_htonl_define" = "yes" || test "$prte_have_htonl" = "yes"], [AC_DEFINE_UNQUOTED([HAVE_UNIX_BYTESWAP], [1], [whether unix byteswap routines -- htonl, htons, nothl, ntohs -- are available])]) -# -# Make sure we can copy va_lists (need check declared, not linkable) -# - -AC_CHECK_DECL(va_copy, PRTE_HAVE_VA_COPY=1, PRTE_HAVE_VA_COPY=0, - [#include ]) - -AC_DEFINE_UNQUOTED(PRTE_HAVE_VA_COPY, $PRTE_HAVE_VA_COPY, - [Whether we have va_copy or not]) - -AC_CHECK_DECL(__va_copy, PRTE_HAVE_UNDERSCORE_VA_COPY=1, - PRTE_HAVE_UNDERSCORE_VA_COPY=0, [#include ]) - -AC_DEFINE_UNQUOTED(PRTE_HAVE_UNDERSCORE_VA_COPY, $PRTE_HAVE_UNDERSCORE_VA_COPY, - [Whether we have __va_copy or not]) - AC_CHECK_DECLS(__func__) # checkpoint results @@ -883,26 +605,6 @@ AC_CACHE_SAVE prte_show_title "System-specific tests" -# Do we have _SC_NPROCESSORS_ONLN? (only going to pass if we also have -# and sysconf(), which is ok) OS X 10.4 has and -# sysconf(), but does not have _SC_NPROCESSORS_ONLN. Doh! - -AC_CACHE_CHECK([for _SC_NPROCESSORS_ONLN], - [ompi_cv_have__SC_NPROCESSORS_ONLN], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ -AC_INCLUDES_DEFAULT -#include -], - [int i = _SC_NPROCESSORS_ONLN;])], - [ompi_cv_have__SC_NPROCESSORS_ONLN="yes"], - [ompi_cv_have__SC_NPROCESSORS_ONLN="no"])]) - -AS_IF([test "$ompi_cv_have__SC_NPROCESSORS_ONLN" = "yes"], - [result=1], [result=0]) - -AC_DEFINE_UNQUOTED([PRTE_HAVE__SC_NPROCESSORS_ONLN], [$result], - [Define to 1 ifyou have the declaration of _SC_NPROCESSORS_ONLN, and to 0 otherwise]) - # all: endian AC_C_BIGENDIAN @@ -953,17 +655,6 @@ if test -z "$LEX" || \ fi fi -# -# Look for ps command and arguments -# -PRTE_PS_FLAVOR_CHECK - -# -# File system case sensitivity -# - -PRTE_CASE_SENSITIVE_FS_SETUP - # # Do we have RLIMIT_NPROC in ? (e.g., Solaris does not) # diff --git a/src/tools/prte_info/param.c b/src/tools/prte_info/param.c index bd6cdc1183..c6396d03bb 100644 --- a/src/tools/prte_info/param.c +++ b/src/tools/prte_info/param.c @@ -392,10 +392,8 @@ void prte_info_do_config(bool want_all) prte_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float)); prte_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double)); prte_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *)); - prte_info_out_int("C char align", "compiler:c:align:char", ALIGNOF_CHAR); prte_info_out("C bool align", "compiler:c:align:bool", "skipped"); prte_info_out_int("C int align", "compiler:c:align:int", ALIGNOF_INT); - prte_info_out_int("C float align", "compiler:c:align:float", ALIGNOF_FLOAT); prte_info_out_int("C double align", "compiler:c:align:double", ALIGNOF_DOUBLE); }