Skip to content

Commit d810804

Browse files
authored
fix(mac/gcc): always create unversioned gcc/g++/gfortran links (#65)
* brew doesn't link gcc/g++ without version number like it does for gfortran * this was causing default mac gcc/g++ to be discovered on PATH * fix readme auto-update PR conditionals in reporting mode
1 parent 52b206f commit d810804

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ jobs:
186186
fi
187187
188188
- name: Update README
189-
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }}
189+
if: ${{ steps.diff.outputs.diff == 'true' }}
190190
run: python .github/compat/update_compat_table.py ".github/compat/compat.md" "README.md"
191191

192192
- name: Print README diff
193-
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }}
193+
if: ${{ steps.diff.outputs.diff == 'true' }}
194194
run: git diff README.md
195195

196196
- name: Create pull request
197-
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }}
197+
if: ${{ steps.diff.outputs.diff == 'true' }}
198198
env:
199199
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
200200
run: |

setup-fortran.sh

+9-12
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,15 @@ install_gcc_brew()
4646
brew link gcc@${version}
4747

4848
os_ver=$(sw_vers -productVersion | cut -d'.' -f1)
49-
# brew link doesn't create aliases without version numbers before gcc 13
50-
if (( "$version" < 13 )); then
51-
# default homebrew bin dir changed with macos 14
52-
if (( "$os_ver" > 13 )); then
53-
ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran
54-
ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc
55-
ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++
56-
else
57-
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
58-
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
59-
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
60-
fi
49+
# default homebrew bin dir changed with macos 14
50+
if (( "$os_ver" > 13 )); then
51+
ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran
52+
ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc
53+
ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++
54+
else
55+
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
56+
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
57+
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
6158
fi
6259
}
6360

0 commit comments

Comments
 (0)