Skip to content

Commit 9e2d9bd

Browse files
hppritchajsquyres
authored andcommitted
configury: do not use _Float16 if noisy build
Turns out that with more recent gcc compilers at least (9.1.0? and newer) _Float16 is detected on aarch64, but by default we are compiling OMPI with -pendantic. This results in thousands and thousands of warnings of this type to be emitted while building: ./../../opal/include/opal_config.h:2311:28: warning: ISO C does not support the ‘_Float16’ type [-Wpedantic] 2311 | #define opal_short_float_t _Float16 | ^~~~~~~~ ../../../opal/include/opal_config_bottom.h:541:5: note: in expansion of macro ‘opal_short_float_t’ 541 | opal_short_float_t real; | ^~~~~~~~~~~~~~~~~~ ../../../opal/include/opal_config.h:2311:28: warning: ISO C does not support the ‘_Float16’ type [-Wpedantic] 2311 | #define opal_short_float_t _Float16 | ^~~~~~~~ ../../../opal/include/opal_config_bottom.h:542:5: note: in expansion of macro ‘opal_short_float_t’ 542 | opal_short_float_t imag; this patch adds a -Werror to CFLAGS before checking for _Float16 to fail the check if warnings are emitted by the compiler. Related to issue #8840 Signed-off-by: Howard Pritchard <[email protected]>
1 parent eba1796 commit 9e2d9bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

config/opal_check_alt_short_float.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ dnl -*- shell-script -*-
22
dnl
33
dnl Copyright (c) 2018-2020 FUJITSU LIMITED. All rights reserved.
44
dnl Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
5+
dnl Copyright (c) 2021 Triad National Security, LLC. All rights
6+
dnl reserved.
57
dnl $COPYRIGHT$
68
dnl
79
dnl Additional copyrights may follow
@@ -14,7 +16,16 @@ dnl Check whether the user wants to use an alternate type of C 'short float'.
1416
dnl OPAL_CHECK_ALT_SHORT_FLOAT
1517
dnl ------------------------------------------------------------
1618
AC_DEFUN([OPAL_CHECK_ALT_SHORT_FLOAT], [
19+
dnl
20+
dnl Testing for this without checking if compiler generates warnings makes for a messy build.
21+
dnl Hence the twiddling of the CFLAGS
22+
dnl
23+
OPAL_VAR_SCOPE_PUSH([CFLAGS_save])
24+
CFLAGS_save=$CFLAGS
25+
CFLAGS="-Werror $CFLAGS"
1726
AC_CHECK_TYPES(_Float16)
27+
CFLAGS=$CFLAGS_save
28+
OPAL_VAR_SCOPE_POP
1829
AC_MSG_CHECKING([if want alternate C type of short float])
1930
AC_ARG_ENABLE([alt-short-float],
2031
[AS_HELP_STRING([--enable-alt-short-float=TYPE],

0 commit comments

Comments
 (0)