Skip to content

Commit a591644

Browse files
committed
260128.164142.CST [skip ci] drop support for Classic Flang
1 parent bd63e20 commit a591644

File tree

6 files changed

+23
-18
lines changed

6 files changed

+23
-18
lines changed

.github/workflows/cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- os: ubuntu-latest
6868
toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'}
6969

70-
# What follows contains the toolchains for Windows, including gcc, intel classic, and intel.
70+
# What follows contains the toolchains for Windows, including gcc, intel-classic, and intel.
7171
- os: windows-latest
7272
toolchain: {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'}
7373
- os: windows-latest
@@ -184,7 +184,7 @@ jobs:
184184
fail-fast: false
185185
matrix:
186186
toolchain:
187-
# Classic Flang family with -Mchkptr would fail. See https://forums.developer.nvidia.com/t/bug-in-nvfortran-with-mchkptr-for-unallocated-optional-arguments/223220
187+
# Flang family with -Mchkptr may fail. See https://forums.developer.nvidia.com/t/bug-in-nvfortran-with-mchkptr-for-unallocated-optional-arguments/223220
188188
# As of 20240220, aflang with -Mbounds would fail due to the bug at https://github.com/flang-compiler/flang/issues/1238
189189
- {compiler: nvfortran, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mbounds -Mchkstk'}
190190
- {compiler: flang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-std=f2018 -pedantic -fimplicit-none -Werror'}

.github/workflows/cmake_pi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ jobs:
8282
cmake --build . --target install
8383
cmake --build . --target tests
8484
85-
# As of 20240316, CMake test fails on cobyla with the Classic flang, AOCC flang, and
86-
# nvfortran. See https://github.com/libprima/prima/issues/165
85+
# As of 20240316, CMake test fails on cobyla with the AOCC flang and nvfortran.
86+
# See https://github.com/libprima/prima/issues/165
8787
if [[ $FC == 'gfortran' ]] ; then
8888
ctest --output-on-failure -V -E "stress"
8989
else

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (PRIMA_HEAP_ARRAYS)
3232
endif ()
3333
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") # nagfor
3434
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive") # What about stack/heap?
35-
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang") # flang-new
35+
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang") # LLVM Flang
3636
# See https://github.com/llvm/llvm-project/issues/88344
3737
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -mmlir -fdynamic-heap-array")
3838
elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Flang") # Classic Flang and AOCC Flang

fortran/common/linalg.f90

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module linalg_mod
3939
!
4040
! Started: July 2020
4141
!
42-
! Last Modified: Thu 14 Aug 2025 07:36:47 AM CST
42+
! Last Modified: Wed 28 Jan 2026 04:15:53 PM CST
4343
!--------------------------------------------------------------------------------------------------!
4444

4545
implicit none
@@ -654,10 +654,9 @@ function solve(A, b) result(x)
654654
return
655655
end if
656656

657-
! Zaikun 20220527: With the following code, the classic flang 17.0, Huawei Bisheng flang 1.3.3,
658-
! NVIDIA nvfortran 24.1, and AOCC 4.2 flang, and Arm Fortran Compiler version 23.1 raise a false
659-
! positive error of out-bound subscripts when invoked with the -Mbounds flag.
660-
! See https://github.com/flang-compiler/flang/issues/1238
657+
! Zaikun 20220527: With the following code, Huawei Bisheng flang 2.1.0, Arm Fortran Compiler 23.1,
658+
! and AOCC 5.1 flang, which raise a false positive error about out-bound subscripts when invoked
659+
! with the -Mbounds flag. See https://github.com/flang-compiler/flang/issues/1238
661660
if (istril(A)) then
662661
do i = 1, n
663662
x(i) = (b(i) - inprod(A(i, 1:i - 1), x(1:i - 1))) / A(i, i) ! INPROD = 0 if I == 1.
@@ -2223,6 +2222,7 @@ function trueloc(x) result(loc)
22232222

22242223
! Postconditions
22252224
if (DEBUGGING) then
2225+
write(*, *) 'DEBUG: In TRUELOC, LOC = ', loc, ', X = ', x, ', N = ', size(x), linspace(1_IK, n, n)
22262226
call assert(all(loc >= 1 .and. loc <= n), '1 <= LOC <= N', srname)
22272227
call assert(size(loc) == count(x), 'SIZE(LOC) == COUNT(X)', srname)
22282228
call assert(all(x(loc)), 'X(LOC) is all TRUE', srname)
@@ -2491,6 +2491,8 @@ function linspace_r(xstart, xstop, n) result(x)
24912491
x(n) = xstop
24922492
end if
24932493

2494+
write(*, *) 'DEBUG: In LINSPACE_R, XSTART = ', xstart, ', XSTOP = ', xstop, ', N = ', n, ', X = ', x
2495+
24942496
!====================!
24952497
! Calculation ends !
24962498
!====================!
@@ -2524,6 +2526,10 @@ function linspace_i(xstart, xstop, n) result(x)
25242526

25252527
x = nint(linspace_r(real(xstart, RP), real(xstop, RP), n), IK) ! Rounded to the closest integer.
25262528

2529+
write(*,*) 'DEBUG: In LINSPACE_I - - - ', nint(1.0_RP, IK), nint(2.0_RP, IK), nint([1.0_RP, 2.0_RP], IK)
2530+
2531+
write(*, *) 'DEBUG: In LINSPACE_I, XSTART = ', xstart, ', XSTOP = ', xstop, ', N = ', n, ', X = ', x
2532+
25272533
!====================!
25282534
! Calculation ends !
25292535
!====================!

fortran/tests/makefiles/Makefile.common

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ endif
9292

9393
# Define the compiler-dependent "fast flags", which will be used when FFLAGS is -fast.
9494
AFF := -O4
95-
DFF := -O4 -Ofast -ffast-math # As of AOCC 4.2, -Ofast implies -O3, but it is not clear whether it implies -ffast-math
95+
DFF := -O3 -Ofast -ffast-math # As of AOCC 4.2, -Ofast implies -O3, but it is not clear whether it implies -ffast-math; -O4 and -O3 are equivalent for AOCC 5.1
9696
FFF := -O3 -ffast-math # Suggested by flang 20.1.7
9797
GFF := -Ofast # -Ofast implies -O3 and -ffast-math
9898
MFF := -O3 -ffast-math # Suggested by AOMP 22.0-2 when running `amdflang --help | grep fast`
@@ -170,7 +170,7 @@ CHCKTST := $(TOOLS_DIR)/checktest
170170
# Define the tests.
171171
######################################################################################
172172
# Decide whether to test QP, i.e., REAL128.
173-
# Classic Flang 17.0 and nvfortran 24.1 do not support REAL128;
173+
# nvfortran 26.1 do not support REAL128;
174174
# AOCC 4.2 Flang complains about a symbol lookup error: undefined symbol: "fort_rnumq_i8";
175175
# AOCC 5.0 Flang is buggy concerning `nint` with REAL128.
176176
TESTS_QP = atest gtest mtest ntest itest stest 9test xtest
@@ -1083,9 +1083,9 @@ source_%: $(SRC_DIRS)
10831083
-o -name "flint" \
10841084
-o -name "mlint" \
10851085
\) -exec rm {} \; # Cleaning up; important!!!
1086-
# Classic Flang 17.0, Huawei Bisheng Flang 2.1.0, Arm Fortran Compiler version 23.10, and AOCC
1087-
# 4.2 are buggy concerning 0-dimensional arrays, and they report false positive out-bound
1088-
# indices. Thus preprocessing by rdsrc is needed. See
1086+
# Huawei Bisheng Flang 2.1.0, Arm Fortran Compiler version 23.10, and AOCC 5.1 Flang are buggy
1087+
# concerning 0-dimensional arrays, and they report false positive out-bound indices. Thus
1088+
# preprocessing by rdsrc is needed. See
10891089
# https://github.com/flang-compiler/flang/issues/1238
10901090
# Check it again when new versions are available. Make a test using
10911091
# https://github.com/zequipe/test_compiler/blob/master/test_solve.f90

fortran/tests/tools/rdsrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/usr/bin/env bash
2-
# This script pre-processes the Fortran source code for Classic Flang 17.0, Huawei Bisheng flang
3-
# 2.1.0, Arm Fortran Compiler 23.1, and AOCC 4.2 flang, which raise a false positive error about
2+
# This script pre-processes the Fortran source code for Huawei Bisheng flang 2.1.0,
3+
# Arm Fortran Compiler 23.1, and AOCC 5.1 flang, which raise a false positive error about
44
# out-bound subscripts when invoked with the -Mbounds flag.
55
# See https://github.com/flang-compiler/flang/issues/1238 and
6-
# https://forums.developer.nvidia.com/t/bug-in-nvfortran-22-3-false-positive-of-out-bound-subscripts
76

87
DIR="$(realpath "$1")"
98
LINALG="$DIR/common/linalg.f90"

0 commit comments

Comments
 (0)