Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
(LC) Supported and Compatible Compilers on Linux

Subject: (LC) Supported and Compatible Compilers on Linux

From: James_F Falco

Date: 22 Feb, 2009 22:00:21

Message: 1 of 2

Why is g95 the only Matlab R2008b supported Fortran compiler on Linux? I would like to request that Matlab supports gfortran, which is a far superior Fortran compiler for various reasons.

- gfortran is better integrated with the GNU compiler collection (e.g., it supports all the options supported by gcc).
- gfortran is more easily available through various distros' package management (e.g., the standard repos of both Fedora and openSUSE include a gfortran but no g95 package).
- gfortran is far superior feature-wise (e.g., it is able to tune code for a huge variety or processors, it supports OpenMP as of gcc 4.2, etc.)
- performance of gfortran code is WAAAAY better than performance of code generated with g95 (see http://www.polyhedron.com/pb05-linux-f90bench_p40html)

And lastly, on http://www.mathworks.com/support/compilers/current_release/linux.html, Mathworks lists "GNU g95" as a supported compiler on Linux. I find that a bit of a misnomer, g95 hasn't been part of the GNU Compiler collection for years. gfortran, on the other hand, is part of the GNU project.

Subject: (LC) Supported and Compatible Compilers on Linux

From: Thomas Clark

Date: 27 Apr, 2009 15:16:01

Message: 2 of 2

James,

I've been using the intel fortran compiler with MATLAB on linux - and haven't had a problem so far. If that works, I don't see why gfortran couldn't be used.

I tend to do it 'by hand'. So, type your mex compilation command using the -v option, say:
mex -v myfile.F90

...and observe the output - it tells you the commands issued to the operating system in order to compile the MEX executable. Take these commands (first to compile, second to link) and adapt them for the compiler you want to use.

You could probably do this by editing the mex setup file (thereby changing the compiler used by the mex command itself), but since I haven't done that yet, I don't want to guarantee it!

FWIW, I agree that better compiler support from the Mathworks is necessary for Linux users - particularly if TMW is aiming Matlab at serious scientific computing, such as HPC and extremely large datasets etc.

Hope this helps

Tom Clark



"James_F Falco" <a@b.com> wrote in message <gnshtl$8b0$1@fred.mathworks.com>...
> Why is g95 the only Matlab R2008b supported Fortran compiler on Linux? I would like to request that Matlab supports gfortran, which is a far superior Fortran compiler for various reasons.
>
> - gfortran is better integrated with the GNU compiler collection (e.g., it supports all the options supported by gcc).
> - gfortran is more easily available through various distros' package management (e.g., the standard repos of both Fedora and openSUSE include a gfortran but no g95 package).
> - gfortran is far superior feature-wise (e.g., it is able to tune code for a huge variety or processors, it supports OpenMP as of gcc 4.2, etc.)
> - performance of gfortran code is WAAAAY better than performance of code generated with g95 (see http://www.polyhedron.com/pb05-linux-f90bench_p40html)
>
> And lastly, on http://www.mathworks.com/support/compilers/current_release/linux.html, Mathworks lists "GNU g95" as a supported compiler on Linux. I find that a bit of a misnomer, g95 hasn't been part of the GNU Compiler collection for years. gfortran, on the other hand, is part of the GNU project.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us