forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling fortran and c

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Laura



Joined: 29 Nov 2006
Posts: 1

PostPosted: Wed Nov 29, 2006 4:21 am    Post subject: Compiling fortran and c Reply with quote

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
View user's profile Send private message
DrTip



Joined: 01 Aug 2006
Posts: 74
Location: Manchester

PostPosted: Wed Nov 29, 2006 2:15 pm    Post subject: Compiling fortran and c Reply with quote

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
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 191
Location: Manchester

PostPosted: Wed Nov 29, 2006 5:29 pm    Post subject: Compiling fortran and c Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group