Skip to content

Commit f0261cb

Browse files
authored
Merge pull request #12117 from bosilca/fix/compile_with_gcc13
Allow OMPI to compile on OSX with gcc13
2 parents e534611 + 9347a55 commit f0261cb

File tree

11 files changed

+41
-15
lines changed

11 files changed

+41
-15
lines changed

3rd-party/romio341/mpl/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ if test "$pac_cv_have___typeof" = "yes" ; then
138138
fi
139139

140140
dnl Check if the necessary headers are available
141-
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)
141+
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)
142142

143143
# A C99 compliant compiler should have inttypes.h for fixed-size int types
144144
AC_CHECK_HEADERS(inttypes.h stdint.h)

3rd-party/romio341/mpl/src/str/mpl_str.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
#include "mpl.h"
77
#include <assert.h>
88

9-
#ifdef HAVE_UNISTD_H
9+
#ifdef MPL_HAVE_UNISTD_H
1010
#include <unistd.h>
1111
#endif
1212

13-
#ifdef HAVE_SYS_TYPES_H
13+
#ifdef MPL_HAVE_SYS_TYPES_H
1414
#include <sys/types.h>
1515
#endif
1616

17-
#ifdef HAVE_TIME_H
17+
#ifdef MPL_HAVE_SYS_PARAM_H
18+
#include <sys/param.h>
19+
#endif
20+
21+
#ifdef MPL_HAVE_TIME_H
1822
#include <time.h>
1923
#endif
2024

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \
686686
sys/types.h sys/uio.h sys/un.h net/uio.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h \
687687
termios.h ulimit.h unistd.h util.h utmp.h malloc.h \
688688
ifaddrs.h crt_externs.h regex.h mntent.h paths.h \
689-
ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h ieee754.h])
689+
ioLib.h sockLib.h hostLib.h shlwapi.h sys/synch.h db.h ndbm.h ieee754.h syslimits.h])
690690

691691
AC_CHECK_HEADERS([sys/mount.h], [], [],
692692
[AC_INCLUDES_DEFAULT

ompi/mca/fbtl/posix/fbtl_posix_preadv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
16+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -26,6 +27,9 @@
2627
#include "mpi.h"
2728
#include <unistd.h>
2829
#include <limits.h>
30+
#ifdef HAVE_SYSLIMITS_H
31+
#include <syslimits.h>
32+
#endif /* HAVE_SYSLIMITS_H */
2933
#include "ompi/constants.h"
3034
#include "ompi/mca/fbtl/fbtl.h"
3135

ompi/mca/fbtl/posix/fbtl_posix_pwritev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2021 University of Houston. All rights reserved.
1313
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -25,8 +26,10 @@
2526

2627
#include "mpi.h"
2728
#include <unistd.h>
28-
#include <sys/uio.h>
2929
#include <limits.h>
30+
#ifdef HAVE_SYSLIMITS_H
31+
#include <syslimits.h>
32+
#endif /* HAVE_SYSLIMITS_H */
3033
#include "ompi/constants.h"
3134
#include "ompi/mca/fbtl/fbtl.h"
3235

opal/include/opal_config_bottom.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
1919
* Copyright (c) 2021 FUJITSU LIMITED. All rights reserved.
20+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
2021
* $COPYRIGHT$
2122
*
2223
* Additional copyrights may follow
@@ -568,6 +569,17 @@ typedef struct {
568569
} opal_short_float_complex_t;
569570
# endif
570571

572+
/* gcc 13 does not define SSIZE_MAX as required by the POSIX standard.
573+
* As a workaround we define ours.
574+
*/
575+
#ifndef SSIZE_MAX
576+
# if SIZEOF_SSIZE_T == SIZEOF_LONG
577+
# define SSIZE_MAX LONG_MAX
578+
# elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG
579+
# define SSIZE_MAX LONG_LONG_MAX
580+
# endif
581+
#endif
582+
571583
#else
572584

573585
/* For a similar reason to what is listed in opal_config_top.h, we

opal/mca/btl/smcuda/btl_smcuda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2010-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
17-
* Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved.
17+
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
1818
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1919
* Copyright (c) 2014-2017 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
@@ -471,7 +471,7 @@ static struct mca_btl_base_endpoint_t *create_sm_endpoint(int local_proc, struct
471471
struct mca_btl_base_endpoint_t *ep;
472472

473473
#if OPAL_ENABLE_PROGRESS_THREADS == 1
474-
char path[PATH_MAX];
474+
char path[OPAL_PATH_MAX];
475475
#endif
476476

477477
ep = (struct mca_btl_base_endpoint_t *) malloc(sizeof(struct mca_btl_base_endpoint_t));

opal/mca/btl/smcuda/btl_smcuda.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
1616
* All rights reserved.
17-
* Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved.
17+
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
1818
* $COPYRIGHT$
1919
*
2020
* Additional copyrights may follow
@@ -164,7 +164,7 @@ struct mca_btl_smcuda_component_t {
164164
int num_mem_nodes;
165165

166166
#if OPAL_ENABLE_PROGRESS_THREADS == 1
167-
char sm_fifo_path[PATH_MAX]; /**< path to fifo used to signal this process */
167+
char sm_fifo_path[OPAL_PATH_MAX]; /**< path to fifo used to signal this process */
168168
int sm_fifo_fd; /**< file descriptor corresponding to opened fifo */
169169
opal_thread_t sm_fifo_thread;
170170
#endif

opal/mca/btl/usnic/btl_usnic_map.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
44
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
5+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -245,7 +246,7 @@ void opal_btl_usnic_connectivity_map(void)
245246

246247
fp = fopen(filename, "w");
247248
if (NULL == fp) {
248-
char dirname[PATH_MAX];
249+
char dirname[OPAL_PATH_MAX];
249250
getcwd(dirname, sizeof(dirname));
250251
dirname[sizeof(dirname) - 1] = '\0';
251252
opal_show_help("help-mpi-btl-usnic.txt", "cannot write to map file", true,

opal/mca/common/ucx/common_ucx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* reserved.
99
* Copyright (c) 2022 Google, LLC. All rights reserved.
1010
* Copyright (c) 2022 IBM Corporation. All rights reserved.
11+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
1112
*
1213
* $COPYRIGHT$
1314
*
@@ -182,8 +183,8 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
182183
#if HAVE_DECL_OPEN_MEMSTREAM
183184
static bool opal_common_ucx_check_device(const char *device_name, char **device_list)
184185
{
185-
char sysfs_driver_link[PATH_MAX];
186-
char driver_path[PATH_MAX];
186+
char sysfs_driver_link[OPAL_PATH_MAX];
187+
char driver_path[OPAL_PATH_MAX];
187188
char ib_device_name[NAME_MAX];
188189
char *driver_name;
189190
char **list_item;

0 commit comments

Comments
 (0)