Fortran call_external under linux [message #24039] |
Tue, 06 March 2001 02:06  |
u600067138
Messages: 3 Registered: March 2001
|
Junior Member |
|
|
Dear all,
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) ?
Greetings, Ole BC, Danish Met. Institute
--
Sent by obc from dmi subpart from dk
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new
|
|
|
Re: Fortran call_external under linux [message #24112 is a reply to message #24039] |
Thu, 08 March 2001 07:35  |
James Tappin
Messages: 54 Registered: December 1995
|
Member |
|
|
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 | |
+--------------------------------------------------------+-- -------+
|
|
|