Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.1.x: configury: patch configure to support nvfortran #12878

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions autogen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# All rights reserved.
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2020 Research Organization for Information Science
# Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
# Copyright (c) 2015-2024 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2015 IBM Corporation. All rights reserved.
#
Expand Down Expand Up @@ -951,9 +953,9 @@ sub patch_autotools_output {
# source tree); we can't fix it. So all we can do is patch the
# resulting configure script. :-(
push(@verbose_out, $indent_str . "Patching configure for Libtool PGI 10 fortran compiler name\n");
$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;
$c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)/g;
$c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran*)/g;
$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;
$c =~ s/pgcc\* \| pgf77\* \| pgf90\* \| pgf95\*\)/pgcc* | pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g;
$c =~ s/pgf77\* \| pgf90\* \| pgf95\*\)/pgf77* | pgf90* | pgf95* | pgfortran* | nvfortran*)/g;

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

$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;
foreach my $tag (("", "_FC")) {
$search_string = 'tcc\*\)
# Fabrice Bellard et al\'s Tiny C Compiler
lt_prog_compiler_wl'."${tag}".'=\'-Wl,\'
lt_prog_compiler_pic'."${tag}".'=\'-fPIC\'
lt_prog_compiler_static'."${tag}".'=\'-static\'
;;';
$replace_string = "tcc*)
# Fabrice Bellard et al's Tiny C Compiler
lt_prog_compiler_wl${tag}='-Wl,'
lt_prog_compiler_pic${tag}='-fPIC'
lt_prog_compiler_static${tag}='-static'
;;
nvc* | nvcc* | nvfortran*)
# NVIDIA Fortran compiler
lt_prog_compiler_wl${tag}='-Wl,'
lt_prog_compiler_pic${tag}='-fPIC'
lt_prog_compiler_static${tag}='-Bstatic'
;;";
push(@verbose_out, $indent_str . "Patching configure for NVIDIA Fortran compiler (${tag})\n");
$c =~ s/$search_string/$replace_string/g;
}

# Only write out verbose statements and a new configure if the
# configure content actually changed
return
Expand Down
2 changes: 1 addition & 1 deletion config/ompi_setup_fc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ AC_DEFUN_ONCE([_OMPI_SETUP_FC_COMPILER],[
# Fortran compilers (excluding the f77 compiler names) from AC's
# default list of compilers and use it here. This is the main
# reason we have an OMPI-ized version of the PROG_FC macro.
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor])
AC_PROG_FC([gfortran f95 fort xlf95 ifort ifc efc pgfortran pgf95 lf95 f90 xlf90 pgf90 epcf90 nagfor nvfortran])
FCFLAGS="$ompi_fcflags_save"
OPAL_VAR_SCOPE_POP
])
Expand Down
Loading