Ask Your Question

Generation of optimized Fortran code?

asked 2011-06-08 03:07:25 -0600

Omri gravatar image

Hey All,

Is it possible to use Sage to generate Fortran code from its expressions which is optimized? I'm looking for an OSS alternative to the CodeGeneration package of Maple.

I came across a discussion about it from 2008 where it was said that it is a planned feature but I didn't manage to find anything newer about that.

Many thanks, Omri

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-06-08 03:58:07 -0600

kcrisman gravatar image

I don't think so.

However, Cython might be just as good for you. It will generate C code based on your Sage code, compile it on the fly, and then you have a C program to use.

Some links:

edit flag offensive delete link more


Thanks for the quick reply! The reason why I need it is to include it into an already bigger program written in Fortran (I wouldn't have chosen it myself) and I need an optimized code (i.e - many declared variables which contain steps of the calculation, exactly like Maple can produce).

Omri gravatar imageOmri ( 2011-06-08 05:23:13 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-06-08 03:07:25 -0600

Seen: 288 times

Last updated: Jun 08 '11