gcc version how I choose

Need help with C, C++, perl, python, etc?

gcc version how I choose

Postby siegfriedq » 2006-12-12 19:56


I working on etch debian and I have install gcc 4.0 and today gcc3.4 because for my specific program (BLAS) it is better to use gcc 3.4 instead of gcc4.1.
I would like that the commande gcc launches gcc 3.4 instead of gcc 4.1.

I tried to chose with update-alternatives --config gcc but I obtained No alternative to gcc.
I do not undestand why because these two gcc are already installed and I do not want to uninstall gcc4.1.

How I can fixe this problem.
Thanks in advance for your help,
Posts: 5
Joined: 2006-12-12 14:23

Postby siegfriedq » 2006-12-12 21:24

artemis:/usr/bin# ls -l /usr/bin/gcc*
lrwxrwxrwx 1 root root 7 2006-11-28 15:02 /usr/bin/gcc -> gcc-4.1
-rwxr-xr-x 1 root root 0 2006-12-12 15:05 /usr/bin/gcc-3.4
-rwxr-xr-x 1 root root 183444 2006-10-28 07:28 /usr/bin/gcc-4.1
lrwxrwxrwx 1 root root 10 2006-11-28 15:02 /usr/bin/gccbug -> gccbug-4.1
-rwxr-xr-x 1 root root 16079 2006-07-15 12:14 /usr/bin/gccbug-3.4
-rwxr-xr-x 1 root root 16283 2006-10-28 07:27 /usr/bin/gccbug-4.1
-rwxr-xr-x 1 root root 2018 2006-10-14 12:31 /usr/bin/gccmakedep

how i make gcc -> gcc-3.4??
Posts: 5
Joined: 2006-12-12 14:23

Postby Guest » 2006-12-12 21:28


Postby jjmac » 2006-12-16 07:44

You just need to switch the symlinks. You could have both gcc packages handy from their respective 'gcc-defaults' directory and just force the uninstall of one and then install the other ...

messey, leads to errors.

You could use the 'script' suggestion from the link, to alter your environment ...

Better ...

Or you could just switch it in the Makefile or the debian/rules file. As the tendancy for package builds is to have a lot of the functionality outside of the 'rules' file, that can get to be a pain trapsing around.

A script to remove the symlinks then to replace them with what you want ... or to adjust the environment would be my toss up choice.

But if the Make is easy to access, or the debian/rules is straight forward enough, i'd do it there.

Posts: 387
Joined: 2005-12-28 23:34
Location: Australia

Return to Programming

Who is online

Users browsing this forum: No registered users and 7 guests