comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL for Windows 3.0: Any more info?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: idl [message #292 is a reply to message #257] Tue, 25 February 1992 09:39 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
In article <1992Feb25.150743.20626@cs.tulane.edu>, terrie@merl.noarl.navy.mil
(Greg Terrie) writes...
>
> I am trying to call a fortran subroutine from IDL using the call_external
> function. I am running on a SUN 4/390 f77 version 1.3.1, SUNOS 4.1.1. I have
> followed the instructions for creating a shareable library as described in the
> IDL manual. However when I issue the command from the IDL prompt:
>
> iret=call_external('fcode.so','_test_')
>
> I get the error message:
>
> ld.so: call to undefined procedure _s_wsle from 0xf????????
>

I think the problem is that you are trying to call the Fortran routine
directly. IDL on the Sun doesn't want to do this (although it can in VMS).
What I do (and I think this came from RSI originally) is to create a C-program
to sit between IDL and the FORTRAN program. For instance,

#include <stdio.h>

void interpol_c(argc, argv)
int argc; /* The number of arguments */
void *argv[]; /* The arguments */
{
float *x_in, *y_in, *x_out, *y_out;
long *n_in, *n_out;

/* Convert the IDL input parameters into FORTRAN parameters. */

x_in = (float *) argv[0];
y_in = (float *) argv[1];
n_in = (long *) argv[2];
x_out = (float *) argv[3];
y_out = (float *) argv[4];
n_out = (long *) argv[5];

/* Call the FORTRAN routine INTERPOL. */

interpol_(x_in,y_in,n_in,x_out,y_out,n_out);
return;
}

The Makefile for this would include the commands

cc -pic -fsingle -c interpol_c.c
f77 -fast -pic -c interpol.f
ld -o external.so -assert pure-text interpol_c.o interpol.o

Then call_external attaches to "_interpol_c" rather than "_interpol_".

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL for Windows 3.0: Any more info?
Next Topic: HELP! IDL plotting

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:12:57 PDT 2025

Total time taken to generate the page: 0.00394 seconds