comp.lang.ada
 help / color / mirror / Atom feed
* Linking Ada applications with the HLA RTI 1.3
@ 1999-04-26  0:00 choboy
  1999-04-26  0:00 ` Laurent Guerby
  0 siblings, 1 reply; 2+ messages in thread
From: choboy @ 1999-04-26  0:00 UTC (permalink / raw)


Has anyone ever linked a Sun Ada83 application with the RTI 1.3 C++ version?

I have a legacy system developed in Ada which uses a C++ middleware package
to invoke the RTI services. When the C++ package invokes Create or Join
services the RTI generates a segmentation error. I replaced the Ada portion
with a test driver written in C++ and the Create and Join work fine.

I looked at the Ada95 version of HelloWorld supplied with the RTI but that
uses a C++ main program to call the Ada code, i.e. a C++ program which uses
Ada code rather than an all Ada program interfacing to the RTI. Using a C++
main program is not feasible for my application.

I suspect the Ada environment has not set up everything the C++ programs
need to operate correctly. I verified that the Ada compiler is generating a
threaded executable and is linked with the RTI threaded libraries.

At this time, it isn't practical for us to migrate the legacy code to Ada95
or C++. If anyone has experience with the Ada to RTI interface and/or
suggestions, I would greatly appreciate your input.

Thanks

Bob Choboy
Veridian Engineering
e-mail: rchoboy@buffalo.veridian.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: Linking Ada applications with the HLA RTI 1.3
  1999-04-26  0:00 Linking Ada applications with the HLA RTI 1.3 choboy
@ 1999-04-26  0:00 ` Laurent Guerby
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Guerby @ 1999-04-26  0:00 UTC (permalink / raw)


choboy@calspan.com writes:
> Has anyone ever linked a Sun Ada83 application with the RTI 1.3 C++
> version?
> 
> I have a legacy system developed in Ada which uses a C++ middleware
> package to invoke the RTI services. When the C++ package invokes
> Create or Join services the RTI generates a segmentation error. I
> replaced the Ada portion with a test driver written in C++ and the
> Create and Join work fine.
> 
> I looked at the Ada95 version of HelloWorld supplied with the RTI
> but that uses a C++ main program to call the Ada code, i.e. a C++
> program which uses Ada code rather than an all Ada program
> interfacing to the RTI. Using a C++ main program is not feasible for
> my application.

Then you're in trouble. Only the C++ linker can link together the C++
RTI and any other stuff.  Ada 95 gives you hooks so that you can link
your Ada code with a foreign language (via adainit and adafinal), but
that's not true of C++ (at the standard level at least).  That's why
the HelloWorld example uses a main program written in C++ that calls
adainit, the main Ada subprogram and then adafinal.

I know this pretty well since I worked on the project leading to the
Ada 95 binding to the RTI interface a few years ago ;-). Also note
that most of the C++ middleware is there to get C macro information or
to transform C++ exceptions into C ints so that they can be raised
properly on the Ada side. This is fairly light.

> I suspect the Ada environment has not set up everything the C++ programs
> need to operate correctly. I verified that the Ada compiler is generating a
> threaded executable and is linked with the RTI threaded libraries.

You should call your Ada 83 compiler vendor for help, only there you
can find information on how to link the vendor Ada runtime with a
foreign one.

> At this time, it isn't practical for us to migrate the legacy code
> to Ada95 or C++. If anyone has experience with the Ada to RTI
> interface and/or suggestions, I would greatly appreciate your input.

If the above solution (contacting your vendor) doesn't work, I suggest
you give a shot at trying to compile your Ada 83 stuff with GNAT, the
GNU Ada 95 compiler. Unless your code is crippled with Sun Ada
specific stuff it should not be very difficult, not enough to call it
a "port" or legacy code migration ;-). I have seen huge apps
(>100KSLOC) ported in a few days, the Ada 95 design team did a very
good job on the upward compatibility problem.

If your project is under tight time constraints, and/or is "serious
enough", and/or you don't have enough in house expertise on such
matter, I suggest you get in touch with an Ada 95 vendor for your
platform (http://www.aonix.com/, http://www.gnat.com/, are the ones I
know, there might be others on Solaris/SPARC).

Note that you may want to contact the french MoD guyes that did most
of the Ada 95 RTI interface work (that is now heading towards IEEE
standardization together with HLA BTW), they have done things pretty
close to what you describe. Email me if you can't find their
coordinates.

> Thanks
> 
> Bob Choboy
> Veridian Engineering
> e-mail: rchoboy@buffalo.veridian.com

Sincerely,

--LG




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

end of thread, other threads:[~1999-04-26  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-26  0:00 Linking Ada applications with the HLA RTI 1.3 choboy
1999-04-26  0:00 ` Laurent Guerby

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