From 6f8010c685d6fb0554c80cde9f131996081f7105 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 24 Aug 2017 17:31:10 +0900 Subject: [PATCH] configury: add support for flang. flang is currently not supported by libtool, so once configure has been invoked, it is necessary to manually hack the generated libtool as described at https://developer.arm.com/products/software-development-tools/hpc/resources/porting-and-tuning/building-openmpi-with-arm-compiler This commit hacks the generated configure automatically in autogen.pl The libtool patch has been submitted upstream and is available at https://savannah.gnu.org/patch/index.php?9442 Signed-off-by: Gilles Gouaillardet --- autogen.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/autogen.pl b/autogen.pl index eec456c853..f64b59328e 100755 --- a/autogen.pl +++ b/autogen.pl @@ -975,6 +975,28 @@ sub patch_autotools_output { # Below is essentially an upstream patch for Libtool which we want # made available to Open MPI users running older versions of Libtool + foreach my $tag (("", "_FC")) { + + # We have to change the search pattern and substitution on each + # iteration to take into account the tag changing + my $search_string = '# icc used to be incompatible with GCC.\n\s+' . + '# ICC 10 doesn\047t accept -KPIC any more.\n.*\n\s+' . + "lt_prog_compiler_wl${tag}="; + my $replace_string = "# Flang compiler + *flang) + lt_prog_compiler_wl${tag}='-Wl,' + lt_prog_compiler_pic${tag}='-fPIC -DPIC' + lt_prog_compiler_static${tag}='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl${tag}="; + + push(@verbose_out, $indent_str . "Patching configure for flang Fortran ($tag)\n"); + $c =~ s/$search_string/$replace_string/; + } + foreach my $tag (("", "_FC")) { # We have to change the search pattern and substitution on each