Re: gfortran iso c bindings - capabilities
- From: Brendan <brendandetracey@xxxxxxxxx>
- Date: Wed, 12 Mar 2008 07:43:48 -0700 (PDT)
On Mar 12, 11:24 am, Arjen Markus <arjen.mar...@xxxxxxxxxx> wrote:
On 12 mrt, 15:10, Brendan <brendandetra...@xxxxxxxxx> wrote:Thanks.
I have a large api written in c which I want call from gfortran(4.3.0)
using the iso c bindings. These bindings are fairly new and there are
not many examples on the internet, though I have heard "fortran
95/2003 explained" has a whole chapter dedicated to this topic.
Is it possible to call any c function from gfortran? The api has many
structure data types.
You may be interested in my C wrapper then - athttp://flibs.sf.net.
It is not finished yet, but it should
get a lot of the tedious stuff out of the way (it may break
on some complicated C preprocessing features though).
To return to your question:
With the ISO_C_BINDING features interfacing to C because
a lot easier (especially much less platform-dependent).
You can transfer data in structures (derived types or C structs),
but there are some intrinsic limitations - C pointers versus
Fortran pointers for instance. Not to mention Fortran
allocatables.
The last couple of weeks there were several threads related
to the subject. They provide interesting reading - especially
the article by John Reid (referenced in one of them).
Regards,
Arjen
Yes, I have the John Reid text. It is the only "published" text with
examples. I need the examples because I am not up to speed on fortran
90/95/2003 and do not know c. Sure I can read the relevant section of
Intel's fortran manual, but there are _no_ examples.
Most people are more interested in calling fortran from c.
.
- Follow-Ups:
- Re: gfortran iso c bindings - capabilities
- From: Arjen Markus
- Re: gfortran iso c bindings - capabilities
- References:
- gfortran iso c bindings - capabilities
- From: Brendan
- Re: gfortran iso c bindings - capabilities
- From: Arjen Markus
- gfortran iso c bindings - capabilities
- Prev by Date: Re: write question
- Next by Date: Re: gfortran iso c bindings - capabilities
- Previous by thread: Re: gfortran iso c bindings - capabilities
- Next by thread: Re: gfortran iso c bindings - capabilities
- Index(es):
Relevant Pages
|
|