Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Linux: using multiple compilers (Read 2860 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Linux: using multiple compilers

Ok, i'm going to see if i can get some kind of responce here, i failed with google ...

anyway, let's say i have GCC 2.95.3 installed and want to install 3.1.1 as well, i when by doing this by ./configure --prefix=/usr/local/gcc311;make install

nice, took a while to compile, but now what ?
how do i tell the ./configure script to actually use THAT gcc instead of the normal 2.95.3 one ???

i hope someone here knows

EDIT: I'm not sure it's ok to post it under general so here it is ... any moderator is free to move it if they feel like it

Linux: using multiple compilers

Reply #1
Usually it goes something like:

export CC=/path/to/compiler
./configure

Hope this helps,

Carsten Haese.

Linux: using multiple compilers

Reply #2
so i should do:

export CC=/usr/local/gcc311/gcc
./configure


?

or is it
export CC=/usr/local/gcc311/
./configure

???
and what's the difference between set and export ?

Linux: using multiple compilers

Reply #3
You should do the first, pointing the CC environment variable to the executable you wish to use.

Note that the instructions are for the bash shell. If you use a different shell, do whatever is necessary to set an environment variable in that shell. (E.g. something like 'setenv CC /usr/local/gcc311/gcc' for csh-like shells.)

The difference between set and export (in bash) is that 'export' sets environment variables, 'set' does not. I've never used set, but from what I gather from the info page, it seems to sets various options that control general shell behavior.

Maybe this helps now

Carsten Haese.