Interfacing between Fortran and C - a little utility
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
Interfacing between Fortran and C - a little utility         


Author: Arjen Markus
Date: May 29, 2008 00:04

Hello,

for many years I have been using all manner of methods to interface
between Fortran
and C and I welcome the facilities that Fortran 2003 offers. But until
the time that
Fortran compilers can be counted...
Show full article (6.04Kb)
2 Comments
Re: Interfacing between Fortran and C - a little utility         


Author: rudra
Date: May 30, 2008 02:43

hello AM,
for many reason, i found i can make my program better by using c
subroutines...but my poor knowledge on C prevents me for doing that.
can u give a small example of that using this utility?
no comments
Re: Interfacing between Fortran and C - a little utility         


Author: Arjen Markus
Date: May 30, 2008 03:00

On 30 mei, 11:43, rudra gmail.com> wrote:
> hello  AM,
> for many reason, i found i can make my program better by using c
> subroutines...but my poor knowledge on C prevents me for doing that.
> can u give a small example of that using this utility?

Well, what it does is simply determine the values of
several macros as explained in the comments. You will
have to use these macros for setting up the Fortran-C interface.

First:
Create the program with the Fortran and C compilers you want to use.
Second:
Run it to get the values for these macros in an include file.
Third:
A C function "my_func" like below could then be interfaced to:

#include "ftcl_conventions.h"

#ifdef FOR_UNDERSCORE
#define my_func my_func_
#endif
Show full article (1.53Kb)
no comments