diff --git a/3rd-party/romio341/mpl/configure.ac b/3rd-party/romio341/mpl/configure.ac index 4812d8a30dc..5c271f5d6f8 100644 --- a/3rd-party/romio341/mpl/configure.ac +++ b/3rd-party/romio341/mpl/configure.ac @@ -138,7 +138,7 @@ if test "$pac_cv_have___typeof" = "yes" ; then fi dnl Check if the necessary headers are available -AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h unistd.h errno.h windows.h sys/mman.h) +AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h sys/types.h sys/uio.h execinfo.h unistd.h errno.h windows.h sys/mman.h sys/param.h) # A C99 compliant compiler should have inttypes.h for fixed-size int types AC_CHECK_HEADERS(inttypes.h stdint.h) diff --git a/3rd-party/romio341/mpl/src/str/mpl_str.c b/3rd-party/romio341/mpl/src/str/mpl_str.c index 925793dec64..0704b22ea83 100644 --- a/3rd-party/romio341/mpl/src/str/mpl_str.c +++ b/3rd-party/romio341/mpl/src/str/mpl_str.c @@ -6,15 +6,19 @@ #include "mpl.h" #include -#ifdef HAVE_UNISTD_H +#ifdef MPL_HAVE_UNISTD_H #include #endif -#ifdef HAVE_SYS_TYPES_H +#ifdef MPL_HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_TIME_H +#ifdef MPL_HAVE_SYS_PARAM_H +#include +#endif + +#ifdef MPL_HAVE_TIME_H #include #endif diff --git a/configure.ac b/configure.ac index b7cad3c66c1..0113bb110bb 100644 --- a/configure.ac +++ b/configure.ac @@ -686,7 +686,7 @@ AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.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]) + ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h ieee754.h syslimits.h]) AC_CHECK_HEADERS([sys/mount.h], [], [], [AC_INCLUDES_DEFAULT diff --git a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c index 944fecdffdf..fcb94ec02a8 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c @@ -13,6 +13,7 @@ * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,6 +27,9 @@ #include "mpi.h" #include #include +#ifdef HAVE_SYSLIMITS_H +#include +#endif /* HAVE_SYSLIMITS_H */ #include "ompi/constants.h" #include "ompi/mca/fbtl/fbtl.h" diff --git a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c index 9b99f968f7c..9f43feec24b 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c @@ -12,6 +12,7 @@ * Copyright (c) 2008-2021 University of Houston. All rights reserved. * Copyright (c) 2015-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,8 +26,10 @@ #include "mpi.h" #include -#include #include +#ifdef HAVE_SYSLIMITS_H +#include +#endif /* HAVE_SYSLIMITS_H */ #include "ompi/constants.h" #include "ompi/mca/fbtl/fbtl.h" diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index a7337ab6cbd..39a8839a0d0 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -17,6 +17,7 @@ * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2017 Intel, Inc. All rights reserved. * Copyright (c) 2021 FUJITSU LIMITED. All rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -568,6 +569,17 @@ typedef struct { } opal_short_float_complex_t; # endif +/* gcc 13 does not define SSIZE_MAX as required by the POSIX standard. + * As a workaround we define ours. + */ +#ifndef SSIZE_MAX +# if SIZEOF_SSIZE_T == SIZEOF_LONG +# define SSIZE_MAX LONG_MAX +# elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG +# define SSIZE_MAX LONG_LONG_MAX +# endif +#endif + #else /* For a similar reason to what is listed in opal_config_top.h, we diff --git a/opal/mca/btl/smcuda/btl_smcuda.c b/opal/mca/btl/smcuda/btl_smcuda.c index e9b202a14d2..95d5693d1cb 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.c +++ b/opal/mca/btl/smcuda/btl_smcuda.c @@ -14,7 +14,7 @@ * Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010-2017 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved. * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -471,7 +471,7 @@ static struct mca_btl_base_endpoint_t *create_sm_endpoint(int local_proc, struct struct mca_btl_base_endpoint_t *ep; #if OPAL_ENABLE_PROGRESS_THREADS == 1 - char path[PATH_MAX]; + char path[OPAL_PATH_MAX]; #endif ep = (struct mca_btl_base_endpoint_t *) malloc(sizeof(struct mca_btl_base_endpoint_t)); diff --git a/opal/mca/btl/smcuda/btl_smcuda.h b/opal/mca/btl/smcuda/btl_smcuda.h index 791809e23de..962e9c268a0 100644 --- a/opal/mca/btl/smcuda/btl_smcuda.h +++ b/opal/mca/btl/smcuda/btl_smcuda.h @@ -14,7 +14,7 @@ * Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010-2015 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -164,7 +164,7 @@ struct mca_btl_smcuda_component_t { int num_mem_nodes; #if OPAL_ENABLE_PROGRESS_THREADS == 1 - char sm_fifo_path[PATH_MAX]; /**< path to fifo used to signal this process */ + char sm_fifo_path[OPAL_PATH_MAX]; /**< path to fifo used to signal this process */ int sm_fifo_fd; /**< file descriptor corresponding to opened fifo */ opal_thread_t sm_fifo_thread; #endif diff --git a/opal/mca/btl/usnic/btl_usnic_map.c b/opal/mca/btl/usnic/btl_usnic_map.c index 29443109490..948b639a23c 100644 --- a/opal/mca/btl/usnic/btl_usnic_map.c +++ b/opal/mca/btl/usnic/btl_usnic_map.c @@ -2,6 +2,7 @@ * Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014-2020 Intel, Inc. All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -245,7 +246,7 @@ void opal_btl_usnic_connectivity_map(void) fp = fopen(filename, "w"); if (NULL == fp) { - char dirname[PATH_MAX]; + char dirname[OPAL_PATH_MAX]; getcwd(dirname, sizeof(dirname)); dirname[sizeof(dirname) - 1] = '\0'; opal_show_help("help-mpi-btl-usnic.txt", "cannot write to map file", true, diff --git a/opal/mca/common/ucx/common_ucx.c b/opal/mca/common/ucx/common_ucx.c index 905938fd98a..7435a7d2a8b 100644 --- a/opal/mca/common/ucx/common_ucx.c +++ b/opal/mca/common/ucx/common_ucx.c @@ -8,6 +8,7 @@ * reserved. * Copyright (c) 2022 Google, LLC. All rights reserved. * Copyright (c) 2022 IBM Corporation. All rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * * $COPYRIGHT$ * @@ -182,8 +183,8 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void) #if HAVE_DECL_OPEN_MEMSTREAM static bool opal_common_ucx_check_device(const char *device_name, char **device_list) { - char sysfs_driver_link[PATH_MAX]; - char driver_path[PATH_MAX]; + char sysfs_driver_link[OPAL_PATH_MAX]; + char driver_path[OPAL_PATH_MAX]; char ib_device_name[NAME_MAX]; char *driver_name; char **list_item; diff --git a/oshmem/mca/memheap/base/memheap_base_static.c b/oshmem/mca/memheap/base/memheap_base_static.c index 99f613340a9..12a05dcbecd 100644 --- a/oshmem/mca/memheap/base/memheap_base_static.c +++ b/oshmem/mca/memheap/base/memheap_base_static.c @@ -2,6 +2,7 @@ * Copyright (c) 2013 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. + * Copyright (c) 2023 NVIDIA Corporation. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -165,8 +166,8 @@ static int _check_pathname(uint64_t inode, const char *pathname) { static const char *proc_self_exe = "/proc/self/exe"; static int warned = 0; - char exe_path[PATH_MAX]; - char module_path[PATH_MAX]; + char exe_path[OPAL_PATH_MAX]; + char module_path[OPAL_PATH_MAX]; char *path; if (0 == inode) {