Serving the Quantitative Finance Community

 
User avatar
stonybrooknick
Topic Author
Posts: 0
Joined: January 24th, 2011, 4:37 pm

calling fortran from c++

March 12th, 2012, 5:44 am

any one have any tips or sound advice calling for calling FORTRAN from C++
 
User avatar
SierpinskyJanitor
Posts: 1
Joined: March 29th, 2005, 12:55 pm

calling fortran from c++

March 12th, 2012, 6:56 am

many possibilities, but why would you do that (this backfiring question will spring to everyone´s mind)?If you compile your Fortran as DLLs/*.libs then you can actually link these into your projects (Windows/Unix).
Last edited by SierpinskyJanitor on March 11th, 2012, 11:00 pm, edited 1 time in total.
 
User avatar
spv205
Posts: 1
Joined: July 14th, 2002, 3:00 am

calling fortran from c++

March 12th, 2012, 10:53 am

NAG has quite a lot of info on the process...http://www.nag.co.uk/numeric/MSC++.asph ... doc.htmleg translations of argument types, STDCALL, rowmajor vs column major..., naming conventions...you might also want to download depends.exe a program that lists functions exported form dll.. (assuming you want to use dll's/windows) - very useful for debugging ( eg identifying missing dependent DLL library, name mangling)
 
User avatar
stonybrooknick
Topic Author
Posts: 0
Joined: January 24th, 2011, 4:37 pm

calling fortran from c++

March 12th, 2012, 7:19 pm

@SierpinskyJanitor I'm in Linux either with PGI/INTEL and GCC at my disposable and i'm trying to call fortran libraries like scalapack from C++@spv205 thank you for the information
 
User avatar
SierpinskyJanitor
Posts: 1
Joined: March 29th, 2005, 12:55 pm

calling fortran from c++

March 12th, 2012, 8:14 pm

Cheers StonyBrookNick, just a question though: why bother scalapacking when you have the same libraries ported to C++? Check out: http://en.wikipedia.org/wiki/List_of_nu ... nd_C.2B.2B
 
User avatar
stonybrooknick
Topic Author
Posts: 0
Joined: January 24th, 2011, 4:37 pm

calling fortran from c++

March 12th, 2012, 10:36 pm

QuoteOriginally posted by: SierpinskyJanitorCheers StonyBrookNick, just a question though: why bother scalapacking when you have the same libraries ported to C++? Check out: http://en.wikipedia.org/wiki/List_of_nu ... _C.2B.2BOf this list i've tried Petsc and I've also tried writing my own routines with MPI for gsl to some success , however the Scalapack has beaten the competition( of what i've tried) in term's of speed and all methods contain a very good deal of accuracy. I just need a few specific linear algebra function's and tested randomly generated matrices. Such as Inversion of symmetric positive definite matrix and a few others tasks , no serious eigen value solvers. My problem size requires me to use parallel computing. The hypre and Trilinos libraries in the list looks very promising , thank you for introducing these to me