Skip to content

Commit b1942b5

Browse files
committed
do not check =native: it is unrolled by gfortran
1 parent acb7f34 commit b1942b5

File tree

1 file changed

+8
-8
lines changed
  • example_packages/features_per_compiler/app

1 file changed

+8
-8
lines changed

example_packages/features_per_compiler/app/main.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ program main
2727

2828
! Check for feature flags
2929
debug_active = index(options_str, '-g') > 0
30-
release_active = index(options_str, '-O') > 0
30+
release_active = index(options_str, '-O3') > 0
3131
verbose_active = index(options_str, ' -v') > 0 .or. index(options_str, ' -v ') > 0
32-
fast_active = index(options_str, '-Ofast') > 0 .or. index(options_str, '-fast') > 0
32+
fast_active = index(options_str, 'fast') > 0
3333
strict_active = index(options_str, '-std=f2018') > 0 .or. index(options_str, '-stand f18') > 0
3434

3535
! Display active features
@@ -127,13 +127,13 @@ function check_gfortran_flags(options, debug_on, release_on, fast_on, strict_on)
127127
end if
128128

129129
if (release_on) then
130-
! Check for either -march=native or -mcpu (Apple Silicon uses -mcpu)
131-
if (.not. (index(options, '-march=native') > 0 .or. index(options, '-mcpu') > 0)) then
130+
! Check for either -march or -mcpu (Apple Silicon uses -mcpu; -match=native may be re-resolved by gcc)
131+
if (.not. (index(options, '-march') > 0 .or. index(options, '-mcpu') > 0)) then
132132
print '(a)', ' ✗ Release: neither -march=native nor -mcpu found'
133133
failed_count = failed_count + 1
134134
else
135135
if (index(options, '-march=native') > 0) then
136-
print '(a)', ' ✓ Release: -march=native found'
136+
print '(a)', ' ✓ Release: -march found'
137137
else
138138
print '(a)', ' ✓ Release: -mcpu found'
139139
end if
@@ -142,7 +142,7 @@ function check_gfortran_flags(options, debug_on, release_on, fast_on, strict_on)
142142
end if
143143

144144
if (fast_on) then
145-
if (.not. check_flag(options, '-Ofast', 'Fast', '-Ofast')) failed_count = failed_count + 1
145+
if (.not. check_flag(options, '-ffast', 'Fast', '-fast')) failed_count = failed_count + 1
146146
if (.not. check_flag(options, '-ffast-math', 'Fast', '-ffast-math')) failed_count = failed_count + 1
147147
end if
148148

@@ -172,7 +172,7 @@ function check_ifort_flags(options, debug_on, release_on, fast_on, strict_on) re
172172
end if
173173

174174
if (fast_on) then
175-
if (.not. check_flag(options, '-fast', 'Fast', '-fast')) failed_count = failed_count + 1
175+
if (.not. check_flag(options, '-fast', 'Fast', '-ffast')) failed_count = failed_count + 1
176176
end if
177177

178178
if (strict_on) then
@@ -201,7 +201,7 @@ function check_ifx_flags(options, debug_on, release_on, fast_on, strict_on) resu
201201
end if
202202

203203
if (fast_on) then
204-
if (.not. check_flag(options, '-fast', 'Fast', '-fast')) failed_count = failed_count + 1
204+
if (.not. check_flag(options, '-fast', 'Fast', '-ffast')) failed_count = failed_count + 1
205205
end if
206206

207207
if (strict_on) then

0 commit comments

Comments
 (0)