Skip to content

fix(mac/gcc): brew doesn't create unversioned gcc symlink #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ jobs:
fi

- name: Update README
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }}
if: ${{ steps.diff.outputs.diff == 'true' }}
run: python .github/compat/update_compat_table.py ".github/compat/compat.md" "README.md"

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

- name: Create pull request
if: ${{ steps.diff.outputs.diff == 'true' && github.event_name == 'push' }}
if: ${{ steps.diff.outputs.diff == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
21 changes: 9 additions & 12 deletions setup-fortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,15 @@ install_gcc_brew()
brew link gcc@${version}

os_ver=$(sw_vers -productVersion | cut -d'.' -f1)
# brew link doesn't create aliases without version numbers before gcc 13
if (( "$version" < 13 )); then
# default homebrew bin dir changed with macos 14
if (( "$os_ver" > 13 )); then
ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++
else
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
fi
# default homebrew bin dir changed with macos 14
if (( "$os_ver" > 13 )); then
ln -fs /opt/homebrew/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /opt/homebrew/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /opt/homebrew/bin/g++-${version} /usr/local/bin/g++
else
ln -fs /usr/local/bin/gfortran-${version} /usr/local/bin/gfortran
ln -fs /usr/local/bin/gcc-${version} /usr/local/bin/gcc
ln -fs /usr/local/bin/g++-${version} /usr/local/bin/g++
fi
}

Expand Down