fortran-lang / setup-fortran

GitHub action to setup Fortran compiler and toolchain
https://github.com/marketplace/actions/setup-fortran
Apache License 2.0
75 stars 25 forks source link

fix(gcc/macos): don't meddle with lib locations #62

Closed wpbonelli closed 9 months ago

wpbonelli commented 9 months ago

Bad idea carried in from modflowpy/install-gfortran-action, likely behind #32, blame is mine

@gha3mi @jalvesz it would be good to confirm if pointing workflows at fortran-lang/setup-fortran@main solves the problem. Or provided a repo link happy to fork and test

gha3mi commented 9 months ago
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        toolchain:
          - {compiler: gcc}
          - {compiler: intel}
          - {compiler: intel-classic}
          - {compiler: nvidia-hpc}
        exclude:
          - os: windows-latest
            toolchain: {compiler: nvidia-hpc}
          - os: macos-latest
            toolchain: {compiler: nvidia-hpc}

This is the output of my test on macOS using fpm. It seems the problem is still there:

Run fpm test --profile debug --compiler gfortran
  fpm test --profile debug --compiler gfortran
  shell: /bin/bash -e {0}
  env:
    FC: gfortran
    CC: gcc
    CXX: g++
dyld[2541]: Library not loaded: '/usr/local/opt/gcc@10/lib/gcc/10/libgfortran.5.dylib'
  Referenced from: '/Users/runner/work/_temp/fpm'
  Reason: tried: '/usr/local/opt/gcc@10/lib/gcc/10/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file)
/Users/runner/work/_temp/e291837c-5003-424d-8092-a092b268976e.sh: line 1:  2541 Abort trap: 6           fpm test --profile debug --compiler gfortran
Error: Process completed with exit code 134.
wpbonelli commented 9 months ago

@gha3mi any chance you could put together a minimal reproduction and test? #31

gha3mi commented 9 months ago

@wpbonelli I have created a test repository. Feel free to push directly to the main branch. If you think it should be private, let me know. https://github.com/gha3mi/test-setup-fortran

gha3mi commented 8 months ago

@wpbonelli The test has been extended to include fpm, cmake, cmake+ninja, and meson. Please check out: https://github.com/gha3mi/test-setup-fortran.

wpbonelli commented 8 months ago

Thanks @gha3mi that is great, if you make progress towards a solution feel free to add a PR here. I probably won't be able to take a close look for the next week or so