[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fortran call_external under linux
- Subject: Re: Fortran call_external under linux
- From: James Tappin <sjt(at)star.sr.bham.ac.uk>
- Date: Thu, 8 Mar 2001 15:35:45 +0000
- Newsgroups: comp.lang.idl-pvwave
- Organization: The University of Birmingham news server
- References: <l.983873208.1465667724@dmi1fw.dmi.dk>
- User-Agent: KNode/0.4
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23889
u600067138@spawnkill.ip-mobilphone.net wrote:
> We are currently migrating from SGI IRIX to Red Hat 6.2 Linux. We rely on
> some fortran code, and would prefer to be able to use call_external
> instead of spawn with all its overhead etc.
>
> Apparently IDL does not have any example fortran code to work with the g77
> compiler, and the IRIX code does not compile. It seems that the
> "structure" and "record" constructs which is used to pass
> strings between IDL and fortran is not recognized by g77.
>
> Does anybody have experience with compiling fortran under Linux and
> linking it to IDL (5.4) ?
>
Records/structures are indeed an extension that g77 doesn't support.
I haven't actually tried it, but I believe that passing the string by
value, which passes a normal C-type string pointer and passing the length
explicitly should do the job.
g77, like most modern fortrans, adds one extra argument for each string at
the end of the argument list.
You'll need a C-stub to convert the argc, argv arguments.
James
--
+------------------------+-------------------------------+---------+
| James Tappin | School of Physics & Astronomy | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+--------------------------------------------------------+---------+