PDA

View Full Version : how to change default compiler?




bamdad
Dec 25, 2011, 10:17 PM
Hi everyone,

I have a question regarding how to change the default compiler in snowleopard. I have performed the steps given in here (http://forums.macrumors.com/showthread.php?t=1045521) to install GCC 4.6 on my laptop to compile fortran codes. Now the compiler works fine when I am using the terminal (I have changed my .profile to include the new path to gcc 4.6) but still the newer version is not set as my default compiler. I am using Eclipse to write my codes since I need an IDE that works with Fortran and C++ but I can't get Eclipse to use the new compiler. It automatically uses apple's gcc 4.2 which doesn't have fortran enabled. can you help me with this problem? thank you.



itsmrjon
Dec 29, 2011, 10:52 AM
Hi everyone,

I have a question regarding how to change the default compiler in snowleopard. I have performed the steps given in here (http://forums.macrumors.com/showthread.php?t=1045521) to install GCC 4.6 on my laptop to compile fortran codes. Now the compiler works fine when I am using the terminal (I have changed my .profile to include the new path to gcc 4.6) but still the newer version is not set as my default compiler. I am using Eclipse to write my codes since I need an IDE that works with Fortran and C++ but I can't get Eclipse to use the new compiler. It automatically uses apple's gcc 4.2 which doesn't have fortran enabled. can you help me with this problem? thank you.

It's been a while since I've used an IDE (honestly I think TextMate is the best thing around for C/Fortran these days), but under the build options menu in Eclipse you can specify the absolute path to the compiler.

Or the other route would be to install the new version of gfortran over the version packaged with xcode.

-------
On a tangent, check out TextMate and grab the Fortran bundle for it. Once you learn how the bundles work you'll be able to save a ton of time writing code by just using hotkeys and tabbed inserts. I also used to use eclipse, and to be honest I'm glad I moved away from it.