1

I have the newest XCode (4D199) installed and in terminal when I type

new-host-2: me$ gcc -version
i686-apple-darwin11-llvm-gcc-4.2: no input files

Is that the default xcode/mac gcc compiler version? Because when I try to do a

sudo easy_install cython 

I get:

Running Cython-0.15.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qS3Kqb/Cython-0.15.1/egg-dist-tmp-Zh0Vnv
cc1: error: unrecognized command line option "-arch"
cc1: error: unrecognized command line option "-arch"

I've read that -arch is a Apple GCC compiler only function. I think when I installed a port from macports I remember it installing something called "llvm" and now I suspect that that is being used instead of the one that comes with XCODE.

Any way to switch it back?

Oh, and when I type "sudo port select gcc" I get (this might be relevent to knowing which gcc version I have):

Available versions for gcc:
    apple-gcc42
    gcc42
    llvm-gcc42
    mp-gcc44
    mp-llvm-gcc42
    none
NoviceCoding
  • 6,145
  • 2
  • 27
  • 33

2 Answers2

0

This is not extremely related to your problem but you will find a solution here: Can't install Ruby under Lion with RVM – GCC issues

This answer was edited multiple times and now contains three alternative solutions. Skip to the end and try the simple “edit 3” solution first, it seems to work for most people. You need a non-LLVM version of GCC, which is no longer included with XCode 4.2. Install it yourself (or downgrade to XCode 4.1 temporarily), then do CC=/usr/local/bin/gcc-4.2 rvm install 1.9.3 (substituting the path to your non-LLVM gcc).

Edit: https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.

Edit 2 (apparently the easiest solution): Alternatively you can try to add --with-gcc=clang to the arguments to configure for Ruby to use clang.

Edit 3: rvm install 1.9.3 --with-gcc=clang does that for you.

Community
  • 1
  • 1
Carto_
  • 577
  • 8
  • 28
0

Does sound like you're getting a non-apple version. If you don't need any non-standard compilers, I'd remove any that macports has installed. The apple infrastructure is different enough that using compilers from macports causes grief fairly easily.

smparkes
  • 13,807
  • 4
  • 36
  • 61