summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-10-15 03:39:43 (GMT)
committerGitHub <noreply@github.com>2023-10-15 03:39:43 (GMT)
commitd5267f096e6575eb3f08dfb8638346eb87087797 (patch)
treecda0465056704d0afe85e3e51dde25d4a5fb06f7 /configure.ac
parentef1edba2cea21dce47235664395701bccd41530d (diff)
downloadhdf5-d5267f096e6575eb3f08dfb8638346eb87087797.zip
hdf5-d5267f096e6575eb3f08dfb8638346eb87087797.tar.gz
hdf5-d5267f096e6575eb3f08dfb8638346eb87087797.tar.bz2
Add support for AOCC & Flang w/ the Autotools (#3674)
* Adds a config/clang-fflags options file to support Flang * Corrects missing "-Wl," from linker options in the libtool wrappers when using Flang, the MPI Fortran compiler wrappers, and building the shared library. This would often result in unrecognized options like -soname. * Enable -nomp w/ Flang to avoid linking to the OpenMPI library. CMake can build the parallel, shared library w/ Fortran using AOCC and Flang, so no changes were needed for that build system. Fixes GitHub issues #3439, #1588, #366, #280
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 9e823ce..02c47d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4244,15 +4244,18 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
;;
esac
- ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler
+ ### libtool does not pass the correct linker options for some Fortran compilers
### on Linux (other OSs have not been tested).
- ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to
- ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037)
case "`uname`" in
Linux*)
+ ### NAG Fortran needs to replace "-Wl," with "-Wl,-Wl,," (HDFFV-10037)
if test "X$FC_BASENAME" = "Xnagfor"; then
cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool
fi
+ ### Flang needs to replace "", with "-Wl," (avoids unknown option: -soname issues)
+ if test "X$FC_BASENAME" = "Xflang"; then
+ cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool
+ fi
;;
esac
fi