comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Interfaces.Ada
Date: 1 Nov 1994 13:06:23 -0500
Date: 1994-11-01T13:06:23-05:00	[thread overview]
Message-ID: <39602v$3rl@felix.seas.gwu.edu> (raw)
In-Reply-To: 9409317836.AA783621232@smtpgw.fnoc.navy.mil

In article <9409317836.AA783621232@smtpgw.fnoc.navy.mil>,
Kyongsuk Pace  <pacek@FNOC.NAVY.MIL> wrote:
>Let me try the same question again.  The organization I work has tons of
>Fortran programs and we really need to have the interface capability
>between Fortran and Ada.
>
>I tried to use pragma import in GNAT to use some Fortran programs.
>However, pragma for Fortran is not implemented yet according to Robert
>Dewar.  I got this response from Robert Dewar after I sent the question to
>gnat-report!  I read about interfaces.Fortran in one of Mike Feldman's
>postings in info-Ada.  Can you (Mike Feldman) tell me where I can get it
>and how to use it with GNAT (i.e., does it require any changes before it
>will work)?  I am using Sun Sparc.  Thank you.

I think Robert Dewar has commented on the best way (currently) to
interface Fortran programs to GNAT. Interfaces.Fortran, and especially
the data structures interface - which will provide column-mapped
multi-dimensional arrays, etc. simply has not been implemented yet.

I suggested to CLA readers that they look in RM9X 5.0 to see what
these language interfaces will look like in an implementation that
supports them fully. I did not (mean to) imply that GNAT was currently
supporting anything but C.

I am not at all familiar with GCC F77, so I'm not a good one to ask for 
details on how to do the interfacing to GNAT (especially while we wait
for the full Interfaces.Fortran to be done). Robert Dewar has suggested
that the scalar data types are the same in all the GNU languages;
Fortran generally requires parameters to be passed by reference; typically 
this has been done in Ada 83 by using the 'Address attribute to pass an
address from Ada to Fortran. (NOTE: an Ada access type is not
necessaily the same thing, as has been discussed at length here recently).

Handling arrays is something you'll have to look at closely, until there's
a full Interfaces.Fortran to make it easier.

If you are really hurting to get started, maybe the NYU folks can help, but
I'm hesitant to suggest this because they are up to their ears
finishing the compiler. Maybe Robert will comment again on CLA.

BTW - I've always advocated that each organization set up a small group
or even a single individual who becomes the local expert on language
interfacing, and that this group or person be tasked with writing
whatever interfacing "glue" is necessary to make the Ada side of the
interface as clean and clear as possible to the rest of the project.
Try to avoid distributing 'Address calls and suchlike throughout a
big program, for example - go through a project-specific interface 
layer if need be. Do not assume that the performance hit will be
unacceptable.

Is there a CLA reader out there who has experience in interfacing
to Fortran?

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet)
------------------------------------------------------------------------
         Ada on the World-Wide Web: http://lglwww.epfl.ch/Ada/
------------------------------------------------------------------------
"Non illegitimi carborundum." (Don't let the bastards grind you down.)
------------------------------------------------------------------------



  reply	other threads:[~1994-11-01 18:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-31 15:33 Interfaces.Ada Kyongsuk Pace
1994-11-01 18:06 ` Michael Feldman [this message]
1994-11-01 21:04   ` Interfaces.Ada Matt Kennel
1994-11-02  6:24     ` Interfaces.Ada Tucker Taft
1994-11-02 13:55     ` Interfaces.Ada Mats Weber
1994-11-02 16:14     ` Interfaces.Ada Stephen J Bevan
1994-11-03 11:18     ` Interfaces.Ada Robert Dewar
1994-11-05  3:14       ` Interfaces.Ada Michael Feldman
1994-11-03 11:15   ` Interfaces.Ada Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox