From 7bed501a6859c3c16ede71888d47508528c50f1e Mon Sep 17 00:00:00 2001 From: Nickolai Belakovski Date: Wed, 31 Jan 2024 14:26:09 -0800 Subject: [PATCH] Fix issue with installation of gfortran 11 In my repo I had issues running a program compiled with gfortran 11 in CI. The problem turned out to be that it was successfully compiled with gfortran 11, but it was linking against the wrong libgfortran-5.dll at runtime. It was linking to the one in /c/mingw64/bin, which is from gfortran 12 which is installed by default in the Windows 2022 image. The simple solution is to move the entire mingw64 folder instead of just a few files. --- setup-fortran.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup-fortran.sh b/setup-fortran.sh index ab899a9..6a6a5ff 100755 --- a/setup-fortran.sh +++ b/setup-fortran.sh @@ -98,10 +98,7 @@ install_gcc_choco() echo "GCC $version already installed" else # otherwise hide preinstalled mingw compilers - mkdir "$RUNNER_TEMP/mingw64" - mv /c/mingw64/bin/gfortran "$RUNNER_TEMP/mingw64/gfortran" - mv /c/mingw64/bin/gcc "$RUNNER_TEMP/mingw64/gcc" - mv /c/mingw64/bin/g++ "$RUNNER_TEMP/mingw64/g++" + mv /c/mingw64 "$RUNNER_TEMP/" # ...and install selected version case $version in 13)