View previous topic :: View next topic |
Author |
Message |
Laura
Joined: 29 Nov 2006 Posts: 1
|
Posted: Wed Nov 29, 2006 4:21 am Post subject: Compiling fortran and c |
|
|
I am trying to compile code that has sub-models written in fortran and C (the fortran modules have an interface with the c modules, and then call in the C routines). I have little idea as to how I need to go aobut doing this. I would be most grateful for any suggestions.
Laura |
|
Back to top |
|
|
DrTip
Joined: 01 Aug 2006 Posts: 74 Location: Manchester
|
Posted: Wed Nov 29, 2006 2:15 pm Post subject: Compiling fortran and c |
|
|
Laura
one way is to go down the .NET route, compile each model to a .net assembly add some appropriate interfaces on the fortran code and your done, see the FTN95 help files and example code that comes with the personal edition.
help files an example of mixed lanuge programming in .NET Contents->.NET PLatform
the harder way is create normal dlls and generate export libraries again see the ftn95 help files there are visual c interoperability examples that come with the compiler.
help files are good go to Contents->WIN32 Platform->Mixed Languge Programming
using the latest version of Visual C++ 2005 express compiler you can even mix the two if you want (though that is not for the faint hearted!)
Really depends how level your C code is and what it is doing and what sorts of data are being passed between the two. do you have some code examples?
Carl |
|
Back to top |
|
|
silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Wed Nov 29, 2006 5:29 pm Post subject: Compiling fortran and c |
|
|
It is also worth mentioning that FTN95 ships with a C++ compiler - scc. There is some cross language documentation in the FTN95 help under:
Win32 platform-> Mixed language programming->Calling FTN95 from C/C++
There is also a help file in the FTN95 installation directory called 'scc.hlp'
------------
Administrator
Silverfrost Forums |
|
Back to top |
|
|
|