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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e7e165c08aae2d89 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-22 04:04:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Antony Bartolini Newsgroups: comp.lang.ada Subject: Re: Interfacing GNAT Ada and GNU FORTRAN - Problems Date: Thu, 22 Feb 2001 06:56:04 -0500 Organization: PrimalTek Message-ID: <3A94FE54.A7BBC8C2@primaltek.com> References: Reply-To: tony@primaltek.com NNTP-Posting-Host: 3f.31.7e.43 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" Content-Transfer-Encoding: 7bit X-Server-Date: 22 Feb 2001 12:00:27 GMT X-Mailer: Mozilla 4.75 (Macintosh; U; PPC) X-Accept-Language: en,pdf Xref: supernews.google.com comp.lang.ada:5428 Date: 2001-02-22T12:00:27+00:00 List-Id: I ran into the same problem while trying to incorporate legacy F77 code into a new Ada95 project on a windows platform. In the end, by using f2c and then compiling the resultant C code with the GNAT's gcc compiler (2.8.1 in my case) I had no problem whatsoever mixing the two languages. Also, the Ada Reference Manual section B.5 "Interfacing with Fortran" provided all the guidance I needed to both call F77 routines from Ada and Ada routines from F77. 'Hope this helps. Tony Bartolini thara nair wrote: > Sir, > I wish to draw your kind attention to three problems > I faced while using the GNAT Ada and GNU Fortran > compiler. > > 1) I have been trying to interface FORTRAN and Ada.My > first attempt was to call a FORTRAN subroutine from an > Ada main program.I had used GNAT AdaGide 95(version > 6.21p) downloaded from internet.the FORTRAN compiler > was GNU FORTRAN compiler for windows98/2000 > doownloaded from the website > www.geocities/athens/olympus/5564/g77.htm . I had > downloaded 4 zip files viz. g77exe.zip,g77lib.zip, and > g77doc.zip and unzip.zip. > They were properly unzipped and could execute FORTRAN > programs using the g77 compiler. > > the ada program was > > with text_io, ada.integer_text_io; > use text_io, ada.integer_text_io; > procedure afmain is > i : integer; > procedure test(i : in out integer); > pragma interface (FORTRAN,test); > begin > i:=234; > put(i); > test(i); > put(i); > end afmain; > > the fortran program was > > subroutine test(i) > write(*,*)'hai' > i=i+1 > return > end > > I compiled the Ada main pgm. from the command line > using GNAT Ada compiler. > > The compilation was done as follows : > > g77 -c test.for > gcc -c afmain.adb > gnatbind afmain.ali > gnatlink afmain.ali test.o > > upto the bind command , there is no error. when the > link command is executed , > > the error message is as follows; > ./afmain.o(text+0x54):afmain.adb : undefined reference > to 'test' > > 2)Also your kind attention is drawn towards the > problem of calling an Ada subroutine from a FORTRAN > main program. > Whether this is feasible ? > if possible what are the specific features to be > considered while developing this interface. > > 3) In the above case, is there any limitation in using > i/o interfaces and is there any limitation on nested > programs ? > > I request your help in solving these problems. > Expecting a speedy solution, > > With regards > Thara Nair > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail - only $35 > a year! http://personal.mail.yahoo.com/