You are not logged in.

#1 2010-06-09 20:55:59

dabd
Member
Registered: 2008-11-17
Posts: 109

Multiple versions of gcc

I need to compile some MEX stuff with Matlab but it requires gcc 4.1 or 4.2 but arch is running 4.5.
Is it possible to have two versions of gcc installed?  If so, is there a guide for doing it without breaking my system...

Offline

#2 2010-06-09 20:59:47

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Multiple versions of gcc

Go to aur.archlinux.org, search for "gcc4", pick whichever you want, follow the instructions on how to install from aur, set CC/CXX as needed, done.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Online

#3 2010-06-09 21:08:07

dabd
Member
Registered: 2008-11-17
Posts: 109

Re: Multiple versions of gcc

Mr.Elendig wrote:

set CC/CXX as needed, done.

Can you elaborate on this part?

Thanks.

Offline

#4 2010-06-09 21:55:04

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Multiple versions of gcc

in the PKGBUILD  export CC / CXX to whatever version of gcc that you want to use. Eg:

.
.

export CC=/usr/bin/x86_64-unknown-linux-gnu-gcc-4.2.4
./configure prefix=/usr
make
.
.
.

Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Online

#5 2010-06-09 22:04:40

dabd
Member
Registered: 2008-11-17
Posts: 109

Re: Multiple versions of gcc

While compiling gcc 4.1 I get this error:

configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1

contents of src/gcc-4.1.2/build/x86_64-unknown-linux-gnu/libstdc++-v3/config.log (last lines)

#ifdef __cplusplus
extern "C" void exit (int) throw ();

configure: exit 1

Last edited by dabd (2010-06-09 22:05:47)

Offline

#6 2010-06-09 23:23:03

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,472
Website

Re: Multiple versions of gcc

I assume you are using gcc41 from the AUR.   You probably only need "CC=gcc-4.1 CXX=g++-4.1 ./configure..."

Offline

#7 2010-06-10 00:48:46

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: Multiple versions of gcc

Search the forums, in an old thread I indicate how to replace Matlab's built-in GCC with the system one. The only utility affected is mex, Matlab itself is not tied to your gcc, so I recommend you do that instead of installing old gcc.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2010-06-10 01:04:17

dabd
Member
Registered: 2008-11-17
Posts: 109

Re: Multiple versions of gcc

I managed to install gcc41 from AUR and change MATLAB's mexopts.sh to point to it and now everything works fine.
Hopefully gcc41 and the gcc-4.5 can coexist without problems.   Should I watch out for any conflicts?

Offline

Board footer

Powered by FluxBB