diff --git a/config/opal_check_alt_short_float.m4 b/config/opal_check_alt_short_float.m4 index e7ff008ba6b..7f9b2fd9346 100644 --- a/config/opal_check_alt_short_float.m4 +++ b/config/opal_check_alt_short_float.m4 @@ -1,7 +1,9 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2018-2021 FUJITSU LIMITED. All rights reserved. -dnl Copyright (c) 2020 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2020 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2025 Research Organization for Information Science +dnl and Technology (RIST). All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -50,8 +52,12 @@ AC_DEFUN([OPAL_CHECK_ALT_SHORT_FLOAT], [ AS_IF([test $opal_alt_short_float_exists -eq 1], [AC_MSG_CHECKING([if compiler supports arithmetic operations on $opal_short_float_type]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ -static $opal_short_float_type a = 2.5, b = 3.8; -a += b;]])], + static $opal_short_float_type a = 2.5, b = 3.8; + a += b; +} + +float extend ($opal_short_float_type v) { + return (float)v;]])], [AC_MSG_RESULT([yes]) opal_enable_short_float=1], [AC_MSG_RESULT([no]) diff --git a/ompi/mpiext/shortfloat/README.md b/ompi/mpiext/shortfloat/README.md index c41ac5941b9..d666734a021 100644 --- a/ompi/mpiext/shortfloat/README.md +++ b/ompi/mpiext/shortfloat/README.md @@ -25,11 +25,13 @@ to the Open MPI `configure` script. NOTE: The Clang 6.0.x and 7.0.x compilers support the `_Float16` type (via software emulation), but require an additional linker flag to function properly. If you wish to enable Clang 6.0.x or 7.0.x's -software emulation of `_Float16`, use the following CLI options to Open -MPI configure script: +software emulation of `_Float16`, or recent Clang, use the +following CLI options to Open MPI configure script: ``` ./configure \ LDFLAGS=--rtlib=compiler-rt \ --with-wrapper-ldflags=--rtlib=compiler-rt ... ``` +Depending on your `clang++` version/configuration, you might also have to add +`--stdlib=libc++` and/or `-lunwind`.