Setting GCC version to 3.3

Michael Williams williams at thphys.ox.ac.uk
Mon Mar 13 00:17:15 UTC 2006


On 12 Mar 2006, at 21:06, Reinhard Tartler wrote:
>> I note /usr/bin/gcc and /usr/bin/g++ are currently symlinks to
>> gcc-4.0 and g++-4.0 respectively. This website <http://
>> viral.media.mit.edu/wiki/tiki-index.php?page=UbuntuPeersInstall>
>> seems to suggest that changing these symlinks (and those to gcov and
>> gccbug) is all there is to changing my default gcc version.

[snip]

> I find this a very bad idea. It seems to me quite clumsy and very
> errorprone. Most sensible Makefiles respect the Variables CC for the
> C-compiler and CXX for the c++ compiler. So setting them on the shell
> like that should work for most Makefiles:
>
> export CC=gcc-3.3
> export CXX=g++-3.3

Unfortunately the arcane, baroque build scripts I'm dealing with are  
not sensible makefiles :-[

>> Also, based on my experience of Mac OS X, which also ships with
>> gcc-4.0 as the default, I'm not convinced shifting these symlinks
>> around is all I have to do. Mac OS X a useful script called
>> gcc_select is provided:
>>
>> mike at sannr023:~$ sudo gcc_select 3.3
>> Default compiler has been set to:
>> gcc version 3.3 20030304 (Apple Computer, Inc. build 1809)
>> mike at sannr023:~$ sudo gcc_select 4.0
>> Default compiler has been set to:
>> gcc version 4.0.0 (Apple Computer, Inc. build 5026)
>
> I assume this affects all users on that machine. Ugly :/

Well, it's ugly if that's not what you want to do. If you want to  
make a global platform change to a machine, which is what I want to  
do, it's perfect ;-]

-- Mike




More information about the ubuntu-users mailing list