I’m on OS X 10.7.2 “Lion”, and I’m developing a C program that has to use some OpenMP 3.0 specific functionalities. Therefore, gcc 4.2.1 is not enough for me, I need gcc 4.4 or better.
I downloaded MacPorts and easily installed gcc 4.4. Running it from the command line just works fine, and compiles my OpenMP 3.0 C program with no hassle.
But it’s quite annoying for me to edit the source in Xcode or TextWrangler and compile it from the command line. So I tried Code::Blocks, which took me 1 hour trying to make it work under OS X, but it crashes anytime for no reason. Then I tried Eclipse, but it sticks on using gcc 4.2.1 even if gcc 4.4 is installed and can be run from the command line. Finally, I tried MonoDevelop, which uses gcc 4.2.1 as well and I just can’t see how can I force it to use my favourite gcc version.
What I’m kindly asking you is: is there any decent C/C++ IDE for OS X that I can use which will let me to specifiy what gcc version to use (just like Code::Blocks under Windows) without horrible workarounds and/or breaking gcc 4.2.1 (I need it up and working for Xcode)?
Thanks in advance.
Eclipse is OK, it can be configured to use any compiler (or several at once or whatever).
If you want a global setting, then go to
C/C++ / Build / Environmentin your preferences and set its PATH to wherever your favourite GCC is.If you want to be more specific, you can edit a specific project’s preferences, for instance:
C/C++ Build / Environment->Environment variables to set(there you can find and customize the final PATH that your compilation will use, per build configuration)C/C++ Build / Settings->GCC C++ Compiler(and others) – there you can customise the exact binary file of the compiler to execute (defaults to justg++), again per build configuration.This even lets you have a project with 2 build configs, one for GCC 4.2 and one for GCC 4.4 for instance.