Skip to content

test(macos-13): use/suggest linker option for gcc7-9 #40

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 1 commit into from
Oct 13, 2023
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
15 changes: 13 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
- {compiler: gcc, version: 8}
- {compiler: gcc, version: 7}
- {compiler: gcc, version: 6}
# {compiler: gcc, version: 5}
include:
- {os: ubuntu-20.04, toolchain: {compiler: intel, version: '2023.2'}}
- {os: ubuntu-20.04, toolchain: {compiler: intel, version: '2022.2.1'}}
Expand Down Expand Up @@ -146,7 +145,19 @@ jobs:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
run: |
${{ env.FC }} -o hw hw.f90
# macos-13 / gcc 7-9 compatibility workaround
args=""
if [ "$RUNNER_OS" == "macOS" ]; then
if [[ $(sw_vers -productVersion) == 13* ]] && \
[[ ${{ matrix.toolchain.compiler }} == "gcc" ]] && \
[[ ${{ matrix.toolchain.version }} =~ ^(7|8|9)$ ]]
then
args="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
fi
fi
args="$args -o hw hw.f90"

${{ env.FC }} $args
output=$(./hw '2>&1')
[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected output: $output"; exit 1)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Support for the GCC toolchain varies across GitHub-hosted runner images.

**Note:** version 13 of the GNU toolchain is not yet available on Windows.

**Note:** on `macos-13`, gcc 7-9 require flag `-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib`.

Supported Intel toolchains:

| runner | compiler | version |
Expand All @@ -108,7 +110,7 @@ Supported Intel toolchains:
| windows-\* | intel | 2023.2, 2023.1, 2023.0, 2022.2.0, 2022.1.0 |
| windows-\* | intel-classic | 2021.10.0, 2021.9.0, 2021.8.0, 2021.7.0, 2021.6.0 |

**Note:** on macOS the `intel`/`ifx` compiler option is not supported, only `intel-classic` with the `ifort` compiler.
**Note:** on macOS `ifx` is not supported, so the `intel` option redirects to `intel-classic` (`ifort`).

## License

Expand Down