help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave/Matlab gcc front end?


From: Alexey Goldin
Subject: Octave/Matlab gcc front end?
Date: Tue, 12 Sep 1995 10:43:37 -0500

address@hidden writes:
 > 
 > I've seen many engineers spending lots of time converting large
 > Matlab/Octave m-files into C or Ada code to make them run faster.
 > 
 > As just as an idea, would it be possable to make an Octave front end
 > for gcc so you could compile your matlab functions?  Would it
 > improve preformance significantly?  I would think so if there are many
 > for loops.  In a way this is a variation of the MEX-file concept, but
 > in this way your m-file could be independent programs.
 > 
 > What do you think?
 > 
 >      Thanks,
 >      Rick Niles.
 > 

There exist compiler Matlab->C++, called Matcom. Unfortunately
it works on IBM PC with DOS or Windows ( all the same for me --
I am using Linux). May be easier to make Octave->C (C++)
compiler then front end for GCC.

Actually I am not sure it would be ALWAYS faster. I am running
some code where botttleneck is FFT transform. When I converted
it into C, it ran 1.5 times slower!!!! Looks like Octave binary
that I was using had libcruft compiled with Fortran, and C
program was using the same FFTPACK that Octave used but
converted with f2c.  (BTW -- in file PROJECTS in Octave
distribution JWE suggested that it would be a great idea to get
rid from Fortran files and use C instead. NO, no and no. If
someone cares about pure folks who do not have fortran compiler
---  there is f2c and GNU Fortran, beta version, but quite
usable).


But, the C program was using 5 times less memory.


Of course if there are a lot of loops  or calls to functions
like quad, fsolve, etc. C code will win a lot.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]