@@ -417,12 +417,19 @@ jobs:
417417 submodules : true
418418
419419 - name : Set up Fortran compiler
420- if : ${{ runner.os != 'Windows ' || matrix.toolchain.fcompiler != 'gcc' }}
420+ if : ${{ runner.os == 'Linux ' || (runner.os == 'Windows' && matrix.toolchain.fcompiler != 'gcc') }}
421421 uses : fortran-lang/setup-fortran@v1
422422 with :
423423 compiler : ${{ matrix.toolchain.fcompiler }}
424424 version : ${{ matrix.toolchain.fversion }}
425425
426+ - name : Set up Fortran compiler (macOS, gfortran)
427+ if : ${{ runner.os == 'macOS' && matrix.toolchain.fcompiler == 'gcc' }}
428+ run : |
429+ brew update
430+ brew install gcc@14
431+ echo "FC=gfortran-14" >> "$GITHUB_ENV"
432+
426433 - name : Set up Fortran compiler (Windows, gfortran)
427434 if : ${{ runner.os == 'Windows' && matrix.toolchain.fcompiler == 'gcc' }}
428435 run : |
@@ -444,10 +451,18 @@ jobs:
444451 }
445452 shell : pwsh
446453
447- - name : Set up C Compiler
448- if : ${{matrix.toolchain.ccompiler == 'msvc'}}
454+ - name : Set up MSVC toolchain (Windows MSVC/Intel)
455+ if : ${{ runner.os == 'Windows' && ( matrix.toolchain.ccompiler == 'msvc' || matrix.toolchain.fcompiler == 'intel') }}
449456 uses : ilammy/msvc-dev-cmd@v1
450457
458+ - name : Remove MinGW/MSYS paths for Windows Intel builds
459+ if : ${{ runner.os == 'Windows' && matrix.toolchain.fcompiler == 'intel' }}
460+ shell : pwsh
461+ run : |
462+ $parts = $env:PATH -split ';'
463+ $clean = $parts | Where-Object { $_ -and ($_ -notmatch 'mingw') -and ($_ -notmatch 'msys') -and ($_ -notmatch 'strawberry') }
464+ "PATH=$($clean -join ';')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
465+
451466 - name : Install build tools
452467 run : |
453468 python -m pip install --upgrade pip
@@ -474,9 +489,15 @@ jobs:
474489 -DSKIP_ROBUST=YES
475490 cmake --build build/extern/gfe --target install
476491
477- - name : Configure (linux )
492+ - name : Configure (Ninja )
478493 if : ${{runner.os != 'Windows' || matrix.toolchain.ccompiler != 'msvc'}}
479494 run : |
495+ cmake_fortran_flags=()
496+ if [ "${{ matrix.toolchain.fcompiler }}" = "gcc" ]; then
497+ # This is a gfortran-only flag; Windows ifx fails compiler detection with it.
498+ cmake_fortran_flags+=(-DCMAKE_Fortran_FLAGS="-ffree-line-length-none")
499+ fi
500+
480501 cmake -S . -B build -G Ninja \
481502 -DCMAKE_PREFIX_PATH=build/install \
482503 -DCMAKE_BUILD_TYPE=Debug \
@@ -486,7 +507,7 @@ jobs:
486507 -DCEA_ENABLE_BIND_PYTHON=OFF \
487508 -DCEA_ENABLE_BIND_MATLAB=OFF \
488509 -DCEA_ENABLE_BIND_EXCEL=OFF \
489- -DCMAKE_Fortran_FLAGS="-ffree-line-length-none "
510+ "${cmake_fortran_flags[@]} "
490511
491512 - name : Configure (msvc)
492513 if : ${{runner.os == 'Windows' && matrix.toolchain.ccompiler == 'msvc'}}
0 commit comments