Skip to content

Commit 25942c7

Browse files
authored
Merge pull request #12722 from ggouaillardet/topic/nvfortran
configury: patch configure to support nvfortran
2 parents a9a89d3 + ccd6415 commit 25942c7

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

autogen.pl

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (c) 2013 Mellanox Technologies, Inc.
66
# All rights reserved.
77
# Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
8-
# Copyright (c) 2015-2021 Research Organization for Information Science
8+
# Copyright (c) 2015-2024 Research Organization for Information Science
99
# and Technology (RIST). All rights reserved.
1010
# Copyright (c) 2015-2022 IBM Corporation. All rights reserved.
1111
# Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
@@ -891,9 +891,9 @@ sub patch_autotools_output {
891891
# source tree); we can't fix it. So all we can do is patch the
892892
# resulting configure script. :-(
893893
push(@verbose_out, $indent_str . "Patching configure for Libtool PGI 10 fortran compiler name\n");
894-
$c =~ s/gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn/gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn/g;
895-
$c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)/g;
896-
$c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran*)/g;
894+
$c =~ s/gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn/gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran nvfortran pgf95 lf95 ftn/g;
895+
$c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g;
896+
$c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g;
897897

898898
# Similar issue as above -- the PGI 10 version number broke <=LT
899899
# 2.2.6b's version number checking regexps. Again, we can't fix the
@@ -1085,6 +1085,30 @@ sub patch_autotools_output {
10851085
;;";
10861086
$c =~ s/$search_string/$replace_string/g;
10871087

1088+
$c =~ s/for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor/for ac_prog in gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor nvfortran/g;
1089+
foreach my $tag (("", "_FC")) {
1090+
$search_string = 'tcc\*\)
1091+
# Fabrice Bellard et al\'s Tiny C Compiler
1092+
lt_prog_compiler_wl'."${tag}".'=\'-Wl,\'
1093+
lt_prog_compiler_pic'."${tag}".'=\'-fPIC\'
1094+
lt_prog_compiler_static'."${tag}".'=\'-static\'
1095+
;;';
1096+
$replace_string = "tcc*)
1097+
# Fabrice Bellard et al's Tiny C Compiler
1098+
lt_prog_compiler_wl${tag}='-Wl,'
1099+
lt_prog_compiler_pic${tag}='-fPIC'
1100+
lt_prog_compiler_static${tag}='-static'
1101+
;;
1102+
nvc* | nvcc* | nvfortran*)
1103+
# NVIDIA Fortran compiler
1104+
lt_prog_compiler_wl${tag}='-Wl,'
1105+
lt_prog_compiler_pic${tag}='-fPIC'
1106+
lt_prog_compiler_static${tag}='-Bstatic'
1107+
;;";
1108+
push(@verbose_out, $indent_str . "Patching configure for NVIDIA Fortran compiler (${tag})\n");
1109+
$c =~ s/$search_string/$replace_string/g;
1110+
}
1111+
10881112
# Only write out verbose statements and a new configure if the
10891113
# configure content actually changed
10901114
return

config/ompi_setup_fc.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ AC_DEFUN_ONCE([_OMPI_SETUP_FC_COMPILER],[
4343
# Fortran compilers (excluding the f77 compiler names) from AC's
4444
# default list of compilers and use it here. This is the main
4545
# reason we have an OMPI-ized version of the PROG_FC macro.
46-
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor])
46+
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor nvfortran])
4747
FCFLAGS="$ompi_fcflags_save"
4848
OPAL_VAR_SCOPE_POP
4949
])

0 commit comments

Comments
 (0)