3

我在使用自制软件尝试 gfortran 时遇到的这个问题的任何帮助。非常感谢您提前。

    bash-3.2$ brew install gfortran
    Warning: gfortran-4.8.0 already installed, it's just not linked
    bash-3.2$ brew link gfortran
    Linking /usr/local/Cellar/gfortran/4.8.0... Warning: Could not link gfortran. Unlinking...

    Error: Could not symlink file: /usr/local/Cellar/gfortran/4.8.0/share/gcc-4.8.0/python
    /libstdcxx/v6/printers.py
    Target /usr/local/share/gcc-4.8.0/python/libstdcxx/v6/printers.py already exists. 
    You may need to  delete it.
    To force the link and delete this file, do:
    brew link --overwrite formula_name

    To list all files that would be deleted:
    brew link --overwrite --dry-run formula_name
    bash-3.2$ 
4

1 回答 1

4

This looks like another GCC 4.8 installation, either from Homebrew or elsewhere, is conflicting with the gfortran install. GFortran is based on GCC so they can collide.

The gcc48 Homebrew formula looks like it has an undocumented conflict with gfortran. Both want to symlink /usr/local/share/gcc-4.8.0. I was able to reproduce your error with brew tap homebrew/versions; brew install gcc48; brew install gfortran

Head on over to the Homebrew issue tracker on GitHub and report this conflict as a bug.

As a workaround, if you don't need that GCC 4.8.0, either brew unlink gcc48 (if it's from homebrew) or uninstall it, and then try the gfortran install again.

UPDATE: Looks like the Homebrew folks are already aware of this issue. There is a fix for it included in this pull request (#19382).

于 2013-04-25T05:25:19.693 回答