You are not logged in.

#1 2009-08-05 14:32:42

Jessehk
Member
From: Toronto, Ontario, Canada
Registered: 2007-01-16
Posts: 152

MATLAB Mex Files Require GCC between 4.1 and 4.2

Hello Everyone.

I need to use MATLAB and I would very much like to use the mex compiler to produce shared libraries of C/C++/Fortran code (written with the aid of something like the GSL, for example). Unfortunately, the MATLAB version I have (R2009a) complains that it requires a version of GCC between 4.1 and 4.2 and refuses to compile my files.

My first thought was to use the ABS to compile a custom version of GCC but the PKGBUILD looks fairly complicated and perhaps specific to the latest version -- I don't want to tackle that by myself.

I've searched the forums and it seems this has been brought up before, but as far as I can tell, there was never a conclusive agreement on the best way to have multiple versions of GCC installed. Ideally, I'd like the default version of GCC to stay updated as usual, and also an old version installed alongside it (named something like gcc-4.2).

I noticed that Ubuntu has several old versions of GCC packaged but I'd much rather use Arch rather than install something new.

Any help would be greatly appreciated. Thanks.

EDIT: Sorry about the thread location. I couldn't decide where to put this.

Last edited by Jessehk (2009-08-05 14:33:45)

Offline

#2 2009-08-05 14:46:24

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

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

The gcc-snapshot package in the AUR shows the best way to package another gcc alongside the current one (if I do say so myself...).  I'd base a PKGBUILD on that.  In fact, I believe some of the AUR ones are (e.g. gcc43).  I would not use the gcc-legacy package from the AUR...

Offline

#3 2009-08-05 23:11:18

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

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

I've been compiling Mex files with GCC4.3 without problems. I set up Eclipse to do so for me, as I detest the matlab editor for complicated C++ files, its basically about as good as gedit, just some syntax highlighting and a minimal search capability (linking is hit and miss). I'm also using R2009a, newest version available.

I believe your issue is trying to mex from WITHIN matlab? I'll take a look at the m-files they use to see if we can just override their error mechanism, I already have to do that with dual-screens and the new XOrg anyway. In the meantime, could you let us know how you're trying to compile when you're faced with the error?


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

#4 2010-06-09 18:55:22

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

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

I am experiencing the same problem.
Is it possible and safe to have several versions of gcc installed on Arch?

Thanks.

Offline

#5 2010-06-12 08:33:17

plutus
Member
Registered: 2010-03-20
Posts: 44

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

I use the last version of gcc+mex files+matlab without any problem...you have to delete the local matlab libraries using the wrong gcc

Offline

#6 2010-06-12 09:15:12

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

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

plutus wrote:

I use the last version of gcc+mex files+matlab without any problem...you have to delete the local matlab libraries using the wrong gcc

How do you find those libraries?

Thanks.

Offline

#7 2010-06-12 16:18:27

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

Re: MATLAB Mex Files Require GCC between 4.1 and 4.2

Search for them in the Matlab install directory... or just search the forums, I gave instructions previously on this very topic.


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

Board footer

Powered by FluxBB