无法使用 Homebrew 在 OS X 10.11 中编译 macvim。 C编译器无法创建可执行文件
Unable to compile macvim in OS X 10.11 with Homebrew. C compiler cannot create executables
这只发生在 macvim 上,其他需要编译器构建的包就可以了。
包含 Homebrew、OSX、编译器版本等的完整日志:http://pastebin.com/raw/05jEGMph
==> Upgrading 3 outdated packages, with result:
macvim 7.4-99, vim 7.4.1655, youtube-dl 2016.03.25
==> Upgrading macvim
==> Downloading https://github.com/macvim-dev/macvim/archive/snapshot-99.tar.gz
Already downloaded: /Library/Caches/Homebrew/macvim-7.4-99.tar.gz
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyint
Last 15 lines from /Users/myuser/Library/Logs/Homebrew/macvim/01.configure:
--with-tlib=ncurses
--with-compiledby=Homebrew
--with-local-dir=/usr/local
--enable-cscope
--enable-pythoninterp
--with-developer-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
--with-macsdk=10.11
configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/macvim20160326-28139-1m2tzhk/macvim-snapshot-99/src':
configure: error: C compiler cannot create executables
See `config.log' for more details
READ THIS: https://git.io/brew-troubleshooting
These open issues may also help:
macvim: stop setting SDK and developer dir https://github.com/Homebrew/homebrew/pull/50191
macvim fails to build on 10.11 with pyenv https://github.com/Homebrew/homebrew/issues/50206
'error: SDK "macosx10.10" cannot be located' trying install macvim https://github.com/Homebrew/homebrew/issues/50180
macvim: disable ruby integration on 10.6 https://github.com/Homebrew/homebrew/pull/40255
macvim fails to build on Yosemite 10.10 with _SC_PHYS_PAGES error https://github.com/Homebrew/homebrew/issues/47026
macvim failed to build on 10.6.8 https://github.com/Homebrew/homebrew/issues/38047
您似乎安装了 Anaconda。如果你 运行 brew doctor
你应该看到这个警告:
Anaconda is known to frequently break Homebrew builds, including Vim and
MacVim, due to bundling many duplicates of system and Homebrew-available
tools.
If you encounter a build failure please temporarily remove Anaconda
from your $PATH
and attempt the build again prior to reporting the
failure to us. Thanks!
因此您应该将其从 PATH
中删除并尝试重新构建;这会解决它。
这只发生在 macvim 上,其他需要编译器构建的包就可以了。
包含 Homebrew、OSX、编译器版本等的完整日志:http://pastebin.com/raw/05jEGMph
==> Upgrading 3 outdated packages, with result:
macvim 7.4-99, vim 7.4.1655, youtube-dl 2016.03.25
==> Upgrading macvim
==> Downloading https://github.com/macvim-dev/macvim/archive/snapshot-99.tar.gz
Already downloaded: /Library/Caches/Homebrew/macvim-7.4-99.tar.gz
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyint
Last 15 lines from /Users/myuser/Library/Logs/Homebrew/macvim/01.configure:
--with-tlib=ncurses
--with-compiledby=Homebrew
--with-local-dir=/usr/local
--enable-cscope
--enable-pythoninterp
--with-developer-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
--with-macsdk=10.11
configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/macvim20160326-28139-1m2tzhk/macvim-snapshot-99/src':
configure: error: C compiler cannot create executables
See `config.log' for more details
READ THIS: https://git.io/brew-troubleshooting
These open issues may also help:
macvim: stop setting SDK and developer dir https://github.com/Homebrew/homebrew/pull/50191
macvim fails to build on 10.11 with pyenv https://github.com/Homebrew/homebrew/issues/50206
'error: SDK "macosx10.10" cannot be located' trying install macvim https://github.com/Homebrew/homebrew/issues/50180
macvim: disable ruby integration on 10.6 https://github.com/Homebrew/homebrew/pull/40255
macvim fails to build on Yosemite 10.10 with _SC_PHYS_PAGES error https://github.com/Homebrew/homebrew/issues/47026
macvim failed to build on 10.6.8 https://github.com/Homebrew/homebrew/issues/38047
您似乎安装了 Anaconda。如果你 运行 brew doctor
你应该看到这个警告:
Anaconda is known to frequently break Homebrew builds, including Vim and MacVim, due to bundling many duplicates of system and Homebrew-available tools.
If you encounter a build failure please temporarily remove Anaconda from your
$PATH
and attempt the build again prior to reporting the failure to us. Thanks!
因此您应该将其从 PATH
中删除并尝试重新构建;这会解决它。