Skip to content

Commit 778cbf3

Browse files
authored
Merge pull request #9478 from jsquyres/pr/v5.0.x/platform-file-and-compiler-fixes
v5.0.x: update portable platform file and disable GCC < 4.8.1
2 parents 3438530 + e6cf4b8 commit 778cbf3

File tree

12 files changed

+1265
-425
lines changed

12 files changed

+1265
-425
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Master (not on release branches yet)
7777

7878
v5.0.0rc1 -- September, 2021
7979
--------------------
80+
8081
- ORTE, the underlying OMPI launcher has been removed, and replaced
8182
with PRTE.
8283
- Reworked how Open MPI integrates with 3rd party packages.
@@ -94,6 +95,8 @@ v5.0.0rc1 -- September, 2021
9495
- Various ROMIO v3.4.1 updates.
9596
- Use Pandoc to generate manpages
9697
- 32 bit atomics are now only supported via C11 compliant compilers.
98+
- Explicitly disable support for GNU gcc < v4.8.1 (note: the default
99+
gcc compiler that is included in RHEL 7 is v4.8.5).
97100
- Do not build Open SHMEM layer when there are no SPMLs available.
98101
Currently, this means the Open SHMEM layer will only build if
99102
the UCX library is found.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ base as of this writing (April 2020):
201201

202202
* On platforms other than x86-64, AArch64 (64-bit ARM), and PPC64,
203203
Open MPI requires a compiler that either supports C11 atomics or
204-
the GCC `__atomic` atomics (e.g., GCC >= v4.7.2).
204+
the GCC `__atomic` atomics (e.g., GCC >= v4.8.1).
205205

206206
* 32-bit platforms are only supported with a recent compiler that
207207
supports C11 atomics. This includes gcc 4.9.x+ (gcc 6.x or newer

config/opal_check_compiler_version.m4

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ dnl -*- shell-script -*-
22
dnl
33
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
44
dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
5+
dnl Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
6+
dnl reserved.
57
dnl
68
dnl $COPYRIGHT$
79
dnl
@@ -27,86 +29,92 @@ AC_DEFUN([OPAL_CHECK_COMPILER_VERSION_ID],
2729

2830

2931
AC_DEFUN([OPAL_CHECK_COMPILER], [
30-
lower=m4_tolower($1)
31-
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
32+
AS_LITERAL_IF([$1], [],
33+
[m4_fatal([OPAL_CHECK_COMPILER argument must be a literal])])
34+
lower=m4_tolower([$1])
35+
AC_CACHE_CHECK([for compiler $lower], [opal_cv_compiler_$1],
3236
[
3337
CPPFLAGS_orig=$CPPFLAGS
34-
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS"
38+
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include $CPPFLAGS"
3539
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
3640
#include <stdio.h>
3741
#include <stdlib.h>
38-
#include "opal_portable_platform.h"
42+
#include "opal/opal_portable_platform.h"
3943
]],[[
4044
FILE * f;
4145
f=fopen("conftestval", "w");
4246
if (!f) exit(1);
4347
fprintf (f, "%d", PLATFORM_COMPILER_$1);
4448
]])], [
45-
eval opal_cv_compiler_$1=`cat conftestval`;
49+
opal_cv_compiler_$1=`cat conftestval`
4650
], [
47-
eval opal_cv_compiler_$1=0
51+
opal_cv_compiler_$1=0
4852
], [
49-
eval opal_cv_compiler_$1=0
53+
opal_cv_compiler_$1=0
5054
])
5155
CPPFLAGS=$CPPFLAGS_orig
5256
])
53-
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
57+
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], [$opal_cv_compiler_$1],
5458
[The compiler $lower which OMPI was built with])
5559
])dnl
5660

5761
AC_DEFUN([OPAL_CHECK_COMPILER_STRING], [
58-
lower=m4_tolower($1)
59-
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
62+
AS_LITERAL_IF([$1], [],
63+
[m4_fatal([OPAL_CHECK_COMPILER_STRING argument must be a literal])])
64+
lower=m4_tolower([$1])
65+
AC_CACHE_CHECK([for compiler $lower], [opal_cv_compiler_$1],
6066
[
6167
CPPFLAGS_orig=$CPPFLAGS
62-
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS"
68+
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include $CPPFLAGS"
6369
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
6470
#include <stdio.h>
6571
#include <stdlib.h>
66-
#include "opal_portable_platform.h"
72+
#include "opal/opal_portable_platform.h"
6773
]],[[
6874
FILE * f;
6975
f=fopen("conftestval", "w");
7076
if (!f) exit(1);
7177
fprintf (f, "%s", PLATFORM_COMPILER_$1);
7278
]])], [
73-
eval opal_cv_compiler_$1=`cat conftestval`;
79+
opal_cv_compiler_$1=`cat conftestval`
7480
], [
75-
eval opal_cv_compiler_$1=UNKNOWN
81+
opal_cv_compiler_$1=UNKNOWN
7682
], [
77-
eval opal_cv_compiler_$1=UNKNOWN
83+
opal_cv_compiler_$1=UNKNOWN
7884
])
7985
CPPFLAGS=$CPPFLAGS_orig
8086
])
81-
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
87+
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], [$opal_cv_compiler_$1],
8288
[The compiler $lower which OMPI was built with])
8389
])dnl
8490

8591

8692
AC_DEFUN([OPAL_CHECK_COMPILER_STRINGIFY], [
87-
lower=m4_tolower($1)
88-
AC_CACHE_CHECK([for compiler $lower], opal_cv_compiler_[$1],
93+
AS_LITERAL_IF([$1], [],
94+
[m4_fatal([OPAL_CHECK_COMPILER_STRINGIFY argument must be a literal])])
95+
lower=m4_tolower([$1])
96+
AC_CACHE_CHECK([for compiler $lower], [opal_cv_compiler_$1],
8997
[
9098
CPPFLAGS_orig=$CPPFLAGS
91-
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include/opal $CPPFLAGS"
99+
CPPFLAGS="-I${OPAL_TOP_SRCDIR}/opal/include $CPPFLAGS"
92100
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
93101
#include <stdio.h>
94102
#include <stdlib.h>
95-
#include "opal_portable_platform.h"
103+
#include "opal/opal_portable_platform.h"
96104
]],[[
97105
FILE * f;
98106
f=fopen("conftestval", "w");
99107
if (!f) exit(1);
100-
fprintf (f, "%s", _STRINGIFY(PLATFORM_COMPILER_$1));
108+
fprintf (f, "%s", PLATFORM_STRINGIFY(PLATFORM_COMPILER_$1));
101109
]])], [
102-
eval opal_cv_compiler_$1=`cat conftestval`;
110+
opal_cv_compiler_$1=`cat conftestval`
103111
], [
104-
eval opal_cv_compiler_$1=UNKNOWN
112+
opal_cv_compiler_$1=UNKNOWN
105113
], [
106-
eval opal_cv_compiler_$1=UNKNOWN
114+
opal_cv_compiler_$1=UNKNOWN
107115
])
108116
CPPFLAGS=$CPPFLAGS_orig
109117
])
110-
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], $opal_cv_compiler_[$1],
118+
AC_DEFINE_UNQUOTED([OPAL_BUILD_PLATFORM_COMPILER_$1], [$opal_cv_compiler_$1],
111119
[The compiler $lower which OMPI was built with])
112120
])dnl

config/opal_setup_cc.m4

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,6 @@ AC_DEFUN([OPAL_SETUP_CC],[
416416

417417
AC_DEFUN([_OPAL_START_SETUP_CC],[
418418
opal_show_subtitle "C compiler and preprocessor"
419-
420-
# $%@#!@#% AIX!! This has to be called before anything invokes the C
421-
# compiler.
422-
dnl AC_AIX
423419
])
424420

425421

configure.ac

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,22 @@ opal_show_subtitle "Compiler characteristics"
600600
OPAL_CHECK_ATTRIBUTES
601601
OPAL_CHECK_COMPILER_VERSION_ID
602602

603+
# Open MPI only supports GCC >=v4.8.1. Notes:
604+
#
605+
# 1. The default compiler that comes with RHEL 7 is v4.8.5 (version ID
606+
# 264197).
607+
# 2. We regularly test with GCC v4.8.1 (version ID 264193).
608+
# 3. GCC 4.8.0 probably also works; we just haven't tested it.
609+
#
610+
# Since we regularly test with 4.8.1, that's what we check for.
611+
AS_IF([test "$opal_cv_compiler_FAMILYNAME" = "GNU" && \
612+
test "$opal_cv_compiler_VERSION" -lt 264193],
613+
[AC_MSG_WARN([Open MPI no longer supports versions of the GNU compiler suite])
614+
AC_MSG_WARN([less than v4.8.1.])
615+
AC_MSG_WARN([Please upgrade your GNU compiler suite, or use])
616+
AC_MSG_WARN([a different compiler to build Open MPI.])
617+
AC_MSG_ERROR([Cannot continue])
618+
])
603619

604620
##################################
605621
# Java MPI Binding request

ompi/include/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ distclean-local:
127127
mpif-sizeof.h \
128128
mpif-c-constants-decl.h mpif-c-constants.h mpif-f08-types.h
129129

130-
mpi_portable_platform.h: $(top_srcdir)/opal/include/opal/opal_portable_platform.h
130+
mpi_portable_platform.h: $(top_srcdir)/opal/include/opal/opal_portable_platform_real.h
131131
-@rm -f mpi_portable_platform.h
132-
$(OMPI_V_LN_S) $(LN_S) $(top_srcdir)/opal/include/opal/opal_portable_platform.h mpi_portable_platform.h
132+
$(OMPI_V_LN_S) $(LN_S) $(top_srcdir)/opal/include/opal/opal_portable_platform_real.h mpi_portable_platform.h

ompi/include/mpi.h.in

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
2323
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2424
* Copyright (c) 2021 Google, LLC. All rights reserved.
25+
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
26+
* reserved.
2527
* $COPYRIGHT$
2628
*
2729
* Additional copyrights may follow
@@ -78,6 +80,9 @@
7880
/* The size of a `int', as computed by sizeof. */
7981
#undef OPAL_SIZEOF_INT
8082

83+
/* The size of a `void*', as computed by sizeof. */
84+
#undef OPAL_SIZEOF_VOID_P
85+
8186
/* Maximum length of datarep string (default is 128) */
8287
#undef OPAL_MAX_DATAREP_STRING
8388

@@ -249,10 +254,29 @@
249254
#if !OMPI_BUILDING
250255
/*
251256
* Figure out which compiler is being invoked (in order to compare if
252-
* it was different than what OMPI was built with).
257+
* it was different than what OMPI was built with). Do some preprocessor
258+
* hacks to eliminate warnings in the portable_platform.h file.
253259
*/
260+
# ifndef SIZEOF_VOID_P
261+
# define CLEANUP_SIZEOF_VOID_P 1
262+
# define SIZEOF_VOID_P OPAL_SIZEOF_VOID_P
263+
# else
264+
# define CLEANUP_SIZEOF_VOID_P 0
265+
# endif
266+
267+
# ifndef _PORTABLE_PLATFORM_H
268+
# define _PORTABLE_PLATFORM_H 0
269+
# endif
270+
# ifndef PLATFORM_HEADER_VERSION
271+
# define PLATFORM_HEADER_VERSION 0
272+
# endif
273+
254274
# include "mpi_portable_platform.h"
255275

276+
#if CLEANUP_SIZEOF_VOID_P
277+
#undef SIZEOF_VOID_P
278+
#endif
279+
256280
/*
257281
* If we're currently using the same compiler that was used to
258282
* build Open MPI, enable compile-time warning of user-level code

ompi/tools/ompi_info/param.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2014-2019 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved.
17-
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
17+
* Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates. All Rights reserved.
1818
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
1919
* $COPYRIGHT$
2020
*
@@ -287,7 +287,7 @@ void ompi_info_do_config(bool want_all)
287287

288288
if (OMPI_FORTRAN_HAVE_IGNORE_TKR) {
289289
/* OMPI_FORTRAN_IGNORE_TKR_PREDECL is already in quotes; it
290-
didn't work consistently to put it in _STRINGIFY because
290+
didn't work consistently to put it in PLATFORM_STRINGIFY because
291291
sometimes the compiler would actually interpret the pragma
292292
in there before stringify-ing it. */
293293
(void)opal_asprintf(&fortran_have_ignore_tkr, "yes (%s)",
@@ -336,9 +336,9 @@ void ompi_info_do_config(bool want_all)
336336
opal_info_out("C compiler absolute", "compiler:c:absolute",
337337
OPAL_CC_ABSOLUTE);
338338
opal_info_out("C compiler family name", "compiler:c:familyname",
339-
_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME));
339+
PLATFORM_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_FAMILYNAME));
340340
opal_info_out("C compiler version", "compiler:c:version",
341-
_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR));
341+
PLATFORM_STRINGIFY(OPAL_BUILD_PLATFORM_COMPILER_VERSION_STR));
342342

343343
if (want_all) {
344344
opal_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char));

opal/include/opal/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
1212
# Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2021 Nanook Consulting. All rights reserved.
1314
# $COPYRIGHT$
1415
#
1516
# Additional copyrights may follow
@@ -27,7 +28,8 @@ headers += \
2728
opal/prefetch.h \
2829
opal/hash_string.h \
2930
opal/frameworks.h \
30-
opal/opal_portable_platform.h
31+
opal/opal_portable_platform.h \
32+
opal/opal_portable_platform_real.h
3133

3234
nodist_headers += \
3335
opal/version.h

0 commit comments

Comments
 (0)