Skip to content

Commit

Permalink
Update cmake.yml due to fortran-lang/setup-fortran#58
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang authored Feb 2, 2024
1 parent be34d28 commit ccf6a65
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,12 @@ jobs:
if: ${{ matrix.toolchain.cc }}
run: echo "CC=${{ matrix.toolchain.cc }}" >> $env:GITHUB_ENV

# gcc 12 is installed on windows runners by default. setup-fortran moves gfortran, gcc, and g++ to a temp directory
# so that they do not get picked up by CMake, but it doesn't move libgfortran-5.dll, and because /c/mingw64/bin is
# on the path ahead of /c/ProgramData/chocolatey/bin (setup-fortran uses chocolatey to install gcc11), the programs
# that are compiled with gcc11 try to use libgfortran-5.dll from gcc12 and crash. For now we rename the gcc12 version
# of libgfortran-5.dll so that the programs pick up the correct version in chocolatey/bin
- name: Move libgfortran-5.dll for gcc11 windows
if: ${{ matrix.os == 'windows-latest' && matrix.toolchain.compiler == 'gcc' && matrix.toolchain.version == '11' }}
run: mv /c/mingw64/bin/libgfortran-5.dll /c/mingw64/bin/libgfortran-5.dll.old
shell: bash

- name: Build
run: |
cmake --version
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" .
cmake --build . --target install
cmake --build . --target tests
cmake --build . --target test】s
ctest --output-on-failure -V -E stress
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
Expand Down

0 comments on commit ccf6a65

Please sign in to comment.