Mac os x /usr/bin/gcc file

烂漫一生 提交于 2019-12-22 06:38:04

问题


I'm using Mac OS X 10.9 (Mavericks). I recently had to compile code using CMake and OpenMP library. So at first I downloaded XCode Command line tools with xcode-select --install. Here's the problem : XCode uses clang compiler which doesn't bring OpenMP. So I got gcc-4.9 with brew package manager (GCC has the OpenMP library).

It works fine, but the command to use it is gcc-4.9 and CMake calls the cc command. So I searched, and found out that /usr/bin/cc was a symbolic link to /usr/bin/clang. I decided to change it to /usr/bin/gcc, but here's the problem : I don't know what this file is...

It looks like the clang command file : if I run it without any argument, I get the clang error instead of a gcc error :

$ gcc
clang: error: no input files
$ gcc-4.9
gcc-4.9: fatal error: no input files
compilation terminated.

But it isn't a symbolic link... Here's the result of a ls -l command :

-rwxr-xr-x   1 root   wheel     14224 23 oct 07:40 gcc

(seems like it was created when I did the Mavericks upgrade) And it's exactly the same thing for g++. Is it a sort of copy of clang, with a different name ? Why isn't Apple using a symbolic link ?

So if anyone here knows if I can delete these files to put a symbolic link instead without any problem (or a better solution), let me know !

Thanks :)

来源:https://stackoverflow.com/questions/20663695/mac-os-x-usr-bin-gcc-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!