Skip to content

Commit 009c94a

Browse files
authored
Merge pull request #9470 from bwbarrett/feature/update-portable-platform
Update portable platform file
2 parents 8462e7c + d6bfdf2 commit 009c94a

File tree

8 files changed

+1245
-420
lines changed

8 files changed

+1245
-420
lines changed

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

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)