From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,327e54c1c9b9f9d3 X-Google-Attributes: gid103376,public From: Laurent Guerby Subject: Re: Linking Ada applications with the HLA RTI 1.3 Date: 1999/04/26 Message-ID: <86pv4rcdfz.fsf@ppp-160-186.villette.club-internet.fr>#1/1 X-Deja-AN: 471187729 References: <7g2c6r$sqj$1@nnrp1.dejanews.com> X-Trace: front7.grolier.fr 925159828 12325 195.36.160.186 (26 Apr 1999 20:50:28 GMT) Organization: Club-Internet (France) Reply-To: guerby@acm.org NNTP-Posting-Date: 26 Apr 1999 20:50:28 GMT Newsgroups: comp.lang.ada Date: 1999-04-26T20:50:28+00:00 List-Id: 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