简体   繁体   English

我在OS X Sierra上拥有哪个GCC版本

[英]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

Reload and verify 重新加载并验证

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 ,查看该版本是否为最新版本。

Other related tools 其他相关工具

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++-6g++ -> g++-6cpp -> cpp-6 ,只需依次重复上述步骤,请始终备份,以防万一错误,因此您可以在必要时撤消所有操作。

NOTE: 注意:

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.

相关问题 我怀疑我在Mac OS X 10.6.3上安装了多个版本的Python 2.6; 如何设置应该启动哪个终端? - I suspect I have multiple version of Python 2.6 installed on Mac OS X 10.6.3; how do I set which one Terminal should launch? Pyraf在OS X上构建错误版本的GCC - Pyraf building wrong version of gcc on os x 您是否在Mac OS X Sierra(10.12)上安装了pyodbc? - Have you installed pyodbc on Mac OS X Sierra (10.12)? 我安装了哪个版本的 Python? - Which version of Python do I have installed? 如果GCC不再工作,我有哪些python部署选项 - Which options for python deployment do I have if GCC not working anymore 在OS X上使用错误版本的GCC构建Python - Python build using wrong version of GCC on OS X 哪个版本的 python 目前最适合 os x? - Which version of python is currently best for os x? 如何确定哪个 MS Edge 驱动程序与我的操作系统版本兼容,以启用 web 自动化和 Python 的 Selenium? - How do I determine which MS Edge Driver is compatible with my OS Version to enable web automation with Selenium for Python? 须藤酿造医生 Mac OS X Sierra - sudo brew doctor Mac OS X Sierra 在OS x Sierra上使用python 2.7运行的awscli - awscli running with python 2.7 on OS x Sierra
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM