문제

When trying to install scikit on my Mac (OS X Lion) I stumbled upon this error:

gcc-4.2 not found, using clang instead.

I searched how to fix this and it seems that the environment variable CC is not correctly set. My question now is, how can I change this and to what do I have to change this? In my /usr/lib/ I do see the g++, gcc, llvm-g++-4.2 and llvm-gcc-4.2 executables. Also when I check env I don't see the CC variable. Even when I try to export CC=gcc I don't see it with the env command.

도움이 되었습니까?

해결책 2

If scikits is explicitly looking for gcc-4.2, it sounds like it's hardcoded in the setup procedure (bad idea i.m.o.).

I would then just go for the symlink solution; a bit different than my comment or Ramneek's answer, but pretty much the same:

sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

다른 팁

There are multiple ways of doing this:

  1. If you are using make to compile the sources, use the following command:

    make CC=/path/to/gcc CXX=path/to/g++ 
    make CC=/path/to/gcc CXX=path/to/g++ install 
    etc.
    
  2. You could permanently change your default compilers by:

    cd /usr/bin
    rm cc c++ gcc g++
    ln -s gcc-4.2 cc
    ln -s gcc-4.2 gcc
    ln -s c++-4.2 c++
    ln -s g++-4.2 g++
    

You should also give clang a try, though - it's not bad at all, and in many cases is known to produce equivalent or better-optimized programs than gcc.

gcc and such shouldn't be in /usr/lib/, but (also) in /usr/bin/. The ones in /usr/lib/ are subdirectories, the ones in /usr/bin/ are the executables.

It may very well be that you have the libraries in those subdirectories, but not the actual executables and header files.

Have you installed the command-line tools during your XCode installation?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top