comp.lang.ada
 help / color / mirror / Atom feed
* Fortran calling Ada
@ 2003-04-09  8:12 Gerd Reger
  2003-04-09  9:45 ` Samuel Tardieu
  2003-04-10 13:34 ` Dr. Michael Paus
  0 siblings, 2 replies; 4+ messages in thread
From: Gerd Reger @ 2003-04-09  8:12 UTC (permalink / raw)


I try to compile a Fortran main program which is calling an Ada procedure
with the follwing commands:

g77 -c *.for
gnatmake -c *.adb
gnatbind -C -n *.ali
gnatlink -C -lm -lg2c -o test *.ali *.o

I'm not able to link. 
I use Suse 8.1 with g77 3.2 and gnat 3.15.


Additional I can't debug an Ada program with this version
of gnat. There is no more gnatgdb.

Any advice is welcome 

Many thanks
Gerd



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran calling Ada
  2003-04-09  8:12 Fortran calling Ada Gerd Reger
@ 2003-04-09  9:45 ` Samuel Tardieu
  2003-04-10 14:22   ` Christopher Dahnken
  2003-04-10 13:34 ` Dr. Michael Paus
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Tardieu @ 2003-04-09  9:45 UTC (permalink / raw)
  To: Gerd Reger

>>>>> "Gerd" == Gerd Reger <Gerd.Reger@astrium-space.com> writes:

Gerd> I try to compile a Fortran main program which is calling an Ada
Gerd> procedure with the follwing commands:

Gerd> [...]
Gerd> gnatlink -C lm -lg2c -o test *.ali *.o

Gerd> I'm not able to link.

You need to press the return key at the end of the gnatlink
line. Seriously, if you don't give the error ("not able to link" can
be anything), your chances of getting a meaningful answer are small.

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran calling Ada
  2003-04-09  8:12 Fortran calling Ada Gerd Reger
  2003-04-09  9:45 ` Samuel Tardieu
@ 2003-04-10 13:34 ` Dr. Michael Paus
  1 sibling, 0 replies; 4+ messages in thread
From: Dr. Michael Paus @ 2003-04-10 13:34 UTC (permalink / raw)


Hi

Gerd Reger wrote:
> I try to compile a Fortran main program which is calling an Ada procedure
> with the follwing commands:

I always found it easier not use a Fortran main program when I was mixing
Ada and Fortran. It is a lot easier if you write a litte Ada main program
which does nothing else but to call a Fortran procedure which is equivalent
to your current Fortran main program. In this Ada main program you should
"with" all Ada packages that you are going to use. In this way you give
Ada a chance to get the elaboration of all your Ada packages right as well.
You can also compile and link then with just one gnatmake call where you
only have to provide the *.o files of your Fortran code in addition to
the normal Ada flags.

Hope that helps

Michael



> 
> g77 -c *.for
> gnatmake -c *.adb
> gnatbind -C -n *.ali
> gnatlink -C -lm -lg2c -o test *.ali *.o
> 
> I'm not able to link. 
> I use Suse 8.1 with g77 3.2 and gnat 3.15.
> 
> 
> Additional I can't debug an Ada program with this version
> of gnat. There is no more gnatgdb.
> 
> Any advice is welcome 
> 
> Many thanks
> Gerd




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran calling Ada
  2003-04-09  9:45 ` Samuel Tardieu
@ 2003-04-10 14:22   ` Christopher Dahnken
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Dahnken @ 2003-04-10 14:22 UTC (permalink / raw)
  To: sam

<posted & mailed>

Samuel Tardieu wrote:

>>>>>> "Gerd" == Gerd Reger <Gerd.Reger@astrium-space.com> writes:
> 
> Gerd> I try to compile a Fortran main program which is calling an Ada
> Gerd> procedure with the follwing commands:
> 
> Gerd> [...]
> Gerd> gnatlink -C lm -lg2c -o test *.ali *.o
> 
> Gerd> I'm not able to link.
> 
> You need to press the return key at the end of the gnatlink
> line. Seriously, if you don't give the error ("not able to link" can
> be anything), your chances of getting a meaningful answer are small.
> 
>   Sam

Right. Fortran also likes to be called with an underscore in front or behind 
the function name (depends) in an other language, e.g. C. The error message
would help ...

        Chris



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-10 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-09  8:12 Fortran calling Ada Gerd Reger
2003-04-09  9:45 ` Samuel Tardieu
2003-04-10 14:22   ` Christopher Dahnken
2003-04-10 13:34 ` Dr. Michael Paus

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