Skip to content

Commit 60e745e

Browse files
committed
configury: patch configure to support nvfortran
nvfortran needs to be passed -fPIC when building shared libraries, so patch the generated configure script in order to properly handle nvfortran: - add nvfortran to the list of known fortran compilers - pass -fPIC to the compiler Refs. #8919 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent b4390af commit 60e745e

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

autogen.pl

Lines changed: 25 additions & 1 deletion
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.
@@ -1085,6 +1085,30 @@ sub patch_autotools_output {
10851085
;;";
10861086
$c =~ s/$search_string/$replace_string/g;
10871087

1088+
push(@verbose_out, $indent_str . "Patching configure for Libtool NVIDIA Fortran compiler name\n");
1089+
$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;
1090+
foreach my $tag (("", "_FC")) {
1091+
$search_string = 'tcc\*\)
1092+
# Fabrice Bellard et al\'s Tiny C Compiler
1093+
lt_prog_compiler_wl'."${tag}".'=\'-Wl,\'
1094+
lt_prog_compiler_pic'."${tag}".'=\'-fPIC\'
1095+
lt_prog_compiler_static'."${tag}".'=\'-static\'
1096+
;;';
1097+
$replace_string = "nvfortran*)
1098+
# NVIDIA Fortran compiler
1099+
lt_prog_compiler_wl${tag}='-Wl,'
1100+
lt_prog_compiler_pic${tag}='-fPIC'
1101+
lt_prog_compiler_static${tag}='-Bstatic'
1102+
;;
1103+
tcc*)
1104+
# Fabrice Bellard et al's Tiny C Compiler
1105+
lt_prog_compiler_wl='-Wl,'
1106+
lt_prog_compiler_pic='-fPIC'
1107+
lt_prog_compiler_static='-static'
1108+
;;";
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

0 commit comments

Comments
 (0)