home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gumby!wupost!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu
- From: mjl@ccwf.cc.utexas.edu (Maurice J. LeBrun)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: C Libraries (PLPlot) and Fortran code
- Message-ID: <77796@ut-emx.uucp>
- Date: 16 Aug 92 08:19:59 GMT
- References: <1992Aug14.032053.1639@newshost.anu.edu.au>
- Sender: news@ut-emx.uucp
- Organization: The University of Texas at Austin, Austin TX
- Lines: 38
-
- In article <1992Aug14.032053.1639@newshost.anu.edu.au> markus@msokcf.anu.edu.au (Markus Buchhorn) writes:
- >
- >[Posting for a friend sans net.access]
- >
- >Question: How does one use C Libraries (compiled C code) from within
- >a Fortran program ?
-
- You can't at present, at least not without considerable difficulty. Both
- Fortran compilers that I know of for the Amiga (Absoft and BCF) have their
- own object formats, incompatible with the standard linker format.
-
- >According to the Fortran manual, there are
- >a variety of ways to go: use the amiga(OpenLibrary) call, which yields
- >a pointer to the jump table,
-
- I'm not sure, but wouldn't this require making the C object code (Plplot in
- this case) into a shared library?
-
- > use the F77L linker to link it in,
-
- Won't work, as stated above. Nor can you link fortran objects with BLink.
-
- >or
- >(briefly discussed in the manual) generate assembly code, and use
- >some other linker to combine this with the C library.
-
- I've looked at this briefly, as it seems the only remaining good
- alternative. Unfortunately the Absoft compiler generates assembly output
- with illegal instructions in it (!?). Or at least the assemblers I've
- tried on it (Lattice's asm, A68k) fail. It is possible to change these
- iffy instructions (can't remember offhand) into ones that work, so you
- could possibly automate the process using sed or some such. Even if you
- succeed you have given up the ability to use a source level debugger. I
- was sufficiently disgusted by the situation that I gave up, and never did
- get a fortran code linked to plplot on the Amiga (sigh).
-
- Maurice LeBrun mjl@fusion.ph.utexas.edu
- Institute for Fusion Studies, University of Texas at Austin
-