[英]Which GCC version do I have on my OS X Sierra
When I type gcc -v
, I get : 当我输入
gcc -v
,我得到:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.9.2 20141029 (prerelease) (GCC)
So my gcc version is 4.9.2 However, when I try to install gcc again by typing : brew tap homebrew/versions; brew install gcc --without-multilib
所以我的gcc版本是4.9.2但是,当我尝试通过键入以下命令再次安装gcc时:
brew tap homebrew/versions; brew install gcc --without-multilib
brew tap homebrew/versions; brew install gcc --without-multilib
I get : brew tap homebrew/versions; brew install gcc --without-multilib
我得到:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/science, homebrew/versions).
==> New Formulae
git-quick-stats homebrew/science/med-file ktmpl
==> Updated Formulae
aha homebrew/science/bowtie mpd
akka homebrew/science/cdo mysql-cluster
arangodb homebrew/science/matplotlib no-more-secrets
buku homebrew/science/packmol nvm
bullet homebrew/science/paraview protobuf-swift
casperjs homebrew/science/pymol qca
certigo imagemagick ✔ ringojs
chicken imagemagick@6 rust
cjdns jenkins skinny
coffeescript jigdo sqldiff
compcert jump sqlite-analyzer
crystal-lang kobalt svtplay-dl
dbhash libhdhomerun swiftgen
digdag libphonenumber vim
direnv libsigsegv wakatime-cli
elixirscript mapserver wolfssl
embulk mecab-jumandic yank
geoserver mkvtoolnix yaz
gitlab-ci-multi-runner mosquitto
==> Deleted Formulae
bip homebrew/versions/openssl101 probatron4j
edelta lcab rtpbreak
esound malaga
Updating Homebrew...
Warning: gcc-6.3.0_1 already installed
This output says at the end that I have gcc 6.3 . 此输出最后显示我有gcc 6.3。 Am I working with gcc 4.9.2 or gcc 6.3 ?
我正在使用gcc 4.9.2或gcc 6.3吗?
PS : If you are interested in why I executed the brew tap & brew install commands, it is because I am trying to install xgboost in python. PS:如果您对我为什么执行brew tap&brew install命令感兴趣,那是因为我正在尝试在python中安装xgboost。 In the github repo of xgboost , they're advising to run the above commands before installation to get the latest g++ compiler.
在xgboost的github存储库中 ,他们建议在安装之前运行上述命令,以获取最新的g ++编译器。
To address your question "Am I working with gcc 4.9.2 or gcc 6.3" 要解决您的问题“我正在使用gcc 4.9.2还是gcc 6.3”
You are still working with gcc 4.9.2. 您仍在使用gcc 4.9.2。
How can you make gcc-6 your default compiler? 如何使gcc-6成为默认编译器? See below:
见下文:
sudo ln -s <path-to>/gcc-6 <path-to>/gcc
Now exit the terminal session and open a new terminal (so the links update) and type gcc -v
and see if the version is now the latest. 现在退出终端会话,并打开一个新终端(链接会更新),然后键入
gcc -v
,查看该版本是否为最新版本。
NOTICE: You may also wish to update c++ -> c++-6
, g++ -> g++-6
, and cpp -> cpp-6
in a similar fashion, just repeat the above step for each in turn, ALWAYS BACKUP in case something goes wrong so you can undo everything if necessary. 注意:您可能还希望以类似的方式更新
c++ -> c++-6
, g++ -> g++-6
和cpp -> cpp-6
,只需依次重复上述步骤,请始终备份,以防万一错误,因此您可以在必要时撤消所有操作。
If you get a "Operation not permitted" warning and you are using El Capitan or newer version of Mac OS X please see this question/answer on how to disable the security feature that is preventing you from making changes to /usr/bin directory: 如果收到“不允许操作”警告,并且您正在使用El Capitan或更高版本的Mac OS X,请参阅此问题/解答,以了解如何禁用阻止您对/ usr / bin目录进行更改的安全功能:
https://superuser.com/questions/933019/sudo-cant-create-file-in-usr-bin-in-el-capitan https://superuser.com/questions/933019/sudo-cant-create-file-in-usr-bin-in-el-capitan
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.