Skip to content

Commit d056b62

Browse files
committed
arm64 compiler fixes
1 parent 2da1bc8 commit d056b62

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
exclude:
3434
- os: macos-14 # No Intel on MacOS anymore since 2024
3535
toolchain: {compiler: intel, version: '2025.1'}
36+
- os: macos-14 # Intel compiler does not support ARM (macos-14)
37+
toolchain: {compiler: intel, version: '2025.2'}
3638
- os: macos-14 # gcc@10 not available on macos-14 (ARM64)
3739
toolchain: {compiler: gcc, version: 10}
3840
- os: windows-latest # Doesn't pass build and tests yet

ci/test_features.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,8 @@ grep -q "✓ FAST: fast optimization flags found" output.txt || { echo "ERROR: F
207207
grep -q "✓ All compiler flag checks PASSED" output.txt || { echo "ERROR: Expected all checks to pass"; exit 1; }
208208
# Check compiler-specific flags (will depend on detected compiler)
209209
if grep -q "Detected compiler: gfortran" output.txt; then
210-
# Check for either -march=native or -mcpu (Apple Silicon uses -mcpu)
211-
if ! (grep -q "✓ Release: -march=native found" output.txt || grep -q "✓ Release: -mcpu found" output.txt); then
212-
echo "ERROR: gfortran release architecture flag (-march=native or -mcpu) not found"
213-
exit 1
214-
fi
210+
# Check for -mtune flag (portable tuning flag)
211+
grep -q "✓ Release: -mtune found" output.txt || { echo "ERROR: gfortran release flag -mtune not found"; exit 1; }
215212
grep -q "✓ Fast: -ffast-math found" output.txt || { echo "ERROR: gfortran fast flag -ffast-math not found"; exit 1; }
216213
fi
217214
echo "✓ Production profile works"

test/fpm_test/test_features.f90

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ subroutine test_feature_collection_complex(error)
365365
& 'debug.linux.flags = "-DLINUX"', &
366366
& 'debug.windows.ifort.flags = "/DEBUG:FULL"', &
367367
& 'release.flags = "-O3"', &
368-
& 'release.gfortran.flags = "-march=native"'
368+
& 'release.gfortran.flags = "-mtune=generic -funroll-loops"'
369369
close(unit)
370370

371371
call get_package_data(package, temp_file, error)
@@ -1501,7 +1501,7 @@ subroutine test_feature_compiler_flags_integration(error)
15011501
write(unit, '(a)') '[features]'
15021502
write(unit, '(a)') 'debug.gfortran.flags = "-g -Wall -fcheck=bounds"'
15031503
write(unit, '(a)') 'debug.flags = "-g"'
1504-
write(unit, '(a)') 'release.gfortran.flags = "-O3 -march=native"'
1504+
write(unit, '(a)') 'release.gfortran.flags = "-O3 -mtune=generic -funroll-loops"'
15051505
write(unit, '(a)') 'release.flags = "-O2"'
15061506
write(unit, '(a)') ''
15071507
write(unit, '(a)') '[profiles]'
@@ -1575,8 +1575,13 @@ subroutine test_feature_compiler_flags_integration(error)
15751575
return
15761576
end if
15771577

1578-
if (index(model%fortran_compile_flags, "-march=native") == 0) then
1579-
call test_failed(error, "Expected release gfortran flags to contain '-march=native'")
1578+
if (index(model%fortran_compile_flags, "-mtune") == 0) then
1579+
call test_failed(error, "Expected release gfortran flags to contain '-mtune'")
1580+
return
1581+
end if
1582+
1583+
if (index(model%fortran_compile_flags, "-funroll-loops") == 0) then
1584+
call test_failed(error, "Expected release gfortran flags to contain '-funroll-loops'")
15801585
return
15811586
end if
15821587

test/fpm_test/test_manifest.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,7 @@ subroutine test_features_demo_serialization(error)
17621762
& '', &
17631763
& '# Compiler-specific features', &
17641764
& 'debug.gfortran.flags = "-Wall -fcheck=bounds"', &
1765-
& 'release.gfortran.flags = "-march=native"', &
1765+
& 'release.gfortran.flags = "-mtune=generic -funroll-loops"', &
17661766
& '', &
17671767
& '# Platform-specific features', &
17681768
& 'linux.preprocess.cpp.macros = "LINUX_BUILD"', &

0 commit comments

Comments
 (0)