Skip to content

Commit 12f2efa

Browse files
authored
Add complex return detection for nvfortran (flame#765)
Details: - Search for Intel ifx and NVIDIA/PGI Fortran compilers. - Correctly determine the Fortran compiler vendor for Intel ifx and NVIDIA/PGI compilers. - Determine the compiler version and correct Fortran complex return type for NVIDIA/PGI.
1 parent 50b7117 commit 12f2efa

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

configure

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ get_fc_search_list()
12211221
{
12221222
local list
12231223

1224-
list="gfortran ifort"
1224+
list="gfortran ifort ifx nvfortran"
12251225

12261226
echo "${list}"
12271227
}
@@ -4229,11 +4229,37 @@ blis_main()
42294229
# Query the compiler "vendor" (ie: the compiler's simple name).
42304230
# The last part ({ read first rest ; echo $first ; }) is a workaround
42314231
# to OS X's egrep only returning the first match.
4232-
fc_vendor=$(echo "${vendor_string}" | grep -oE 'IFORT|GNU' |
4232+
fc_vendor=$(echo "${vendor_string}" | grep -oE 'IFORT|IFX|GNU|NVIDIA|PGI' |
42334233
{ read -r first rest ; echo "${first}"; })
42344234

4235-
if [[ ${fc_vendor} = IFORT ]]; then
4235+
if [[ ${fc_vendor} = IFORT || ${fc_vendor} = IFX ]]; then
42364236
complex_return='intel'
4237+
elif [[ ${fc_vendor} = NVIDIA || ${fc_vendor} = PGI ]]; then
4238+
# On x86_64 and aarch64 prior to 23.9, nvfortran
4239+
# uses the 'intel' convention.
4240+
# On and ppc64le and aarch64 starting with 23.9,
4241+
# the convention is 'gnu'.
4242+
if [[ "$(uname -m)" = "aarch64" ]]; then
4243+
fc_version=$(echo "${vendor_string}" \
4244+
| grep -oE '[0-9]+\.[0-9]+\.?[0-9]*' \
4245+
| { read -r first rest ; echo "${first}"; })
4246+
if [[ ${fc_version:0:2} -lt 23 ]]; then
4247+
complex_return='intel'
4248+
elif [[ ${fc_version:0:2} -eq 23 ]]; then
4249+
# Use 3:5 because minor version numbers include 1 and 11.
4250+
if [[ ${fc_version:3:5} -lt 9 ]]; then
4251+
complex_return='intel'
4252+
else
4253+
complex_return='gnu'
4254+
fi
4255+
else
4256+
complex_return='gnu'
4257+
fi
4258+
elif [[ "$(uname -m)" = "ppc64le" ]]; then
4259+
complex_return='gnu'
4260+
else
4261+
complex_return='intel'
4262+
fi
42374263
elif [[ ${fc_vendor} = GNU ]]; then
42384264
complex_return='gnu'
42394265
else

0 commit comments

Comments
 (0)