Skip to content

Unsuccessful installation on brewed macOS #9

Closed
@beddalumia

Description

@beddalumia

Description

I installed fpm through the documented homebrew method (brew tap fortran-lang/fortran) and it exits without any error message:

% brew install fpm
==> Downloading https://github.com/fortran-lang/homebrew-fortran/releases/download/fpm-0.6.0/f
Already downloaded: /Users/gbellomia/Library/Caches/Homebrew/downloads/160d1a1f3794b2a9d6fc2a12596dc2ea47ff58acb535c38c6cb2dded3d13c7c5--fpm-0.6.0.big_sur.bottle.tar.gz
==> Installing fpm from fortran-lang/fortran
==> Pouring fpm-0.6.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/fpm/0.6.0: 6 files, 1MB
==> Running `brew cleanup fpm`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

But when I invoke the fpm command afterwards I get a error message, for missing gcc dependency:

% fpm
dyld[37716]: Library not loaded: '/usr/local/opt/gcc/lib/gcc/11/libgfortran.5.dylib'
 Referenced from: '/usr/local/Cellar/fpm/0.6.0/bin/fpm'
 Reason: tried: '/usr/local/opt/gcc/lib/gcc/11/libgfortran.5.dylib' (no such file), '/usr/local/lib/libgfortran.5.dylib' (no such file), '/usr/lib/libgfortran.5.dylib' (no such file)
zsh: abort      fpm

Searching for "libgfortran.5.dylib" system-wide with fd:

% pwd
/
% fd libgfortran
Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.2.dylib
Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.3.dylib
Applications/MATLAB_R2021b.app/sys/os/maci64/README.libgfortran
Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.dylib
Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.2.dylib
Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.3.dylib
Applications/MATLAB_R2020b.app/sys/os/maci64/README.libgfortran
Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.dylib
System/Volumes/Data/Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.2.dylib
System/Volumes/Data/Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.3.dylib
System/Volumes/Data/Applications/MATLAB_R2021b.app/sys/os/maci64/README.libgfortran
System/Volumes/Data/Applications/MATLAB_R2021b.app/sys/os/maci64/libgfortran.dylib
System/Volumes/Data/Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.dylib
System/Volumes/Data/Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.3.dylib
System/Volumes/Data/Applications/MATLAB_R2020b.app/sys/os/maci64/libgfortran.2.dylib
System/Volumes/Data/Applications/MATLAB_R2020b.app/sys/os/maci64/README.libgfortran
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.5.dylib
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.spec
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.dylib
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.a
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.spec
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.5.dylib
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.dylib
System/Volumes/Data/usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.a
usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.5.dylib
usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.spec
usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.dylib
usr/local/Cellar/gcc/12.2.0/lib/gcc/current/libgfortran.a
usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.5.dylib  #<--- HERE
usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.spec
usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.dylib
usr/local/Cellar/gcc/12.2.0/lib/gcc/12/libgfortran.a

it appears that fpm is just searching in the wrong directory (and mismatching version?). My gfortran installation is an updated brewed version:

% gfortran --version
GNU Fortran (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So I would expect it to interact well with the brewed fpm.

Expected Behaviour

At least to throw an error message if it cannot find the installed gfortran dynamic libraries, and maybe suggest some action.
Better to resolve the location and version for reasonable cases, such as an updated homebrew install.

Version of fpm

0.6.0 [homebrew]

Platform and Architecture

macOS Monterey, version 12.5 (21G72)

Additional Information

Note that gfortran per sé is functional in the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions