call_external with Fortran [message #2772] |
Mon, 19 September 1994 13:16 |
mckie
Messages: 3 Registered: September 1994
|
Junior Member |
|
|
Having trouble with first attempts to use IDL's call_external
with a Fortran routine on a Sun.
SunOS 4.1.1
SunFORTRAN 1.4
IDL 3.0.0
Using the info given in IDL's on-line .../notes/call_external.doc
file.
A simple Fortran routine in sub.f to be called by IDL's
call_external, intended to print the number of arguments
passed:
subroutine sub(argc,argv)
integer*4 argc
integer*4 argv(*)
n = %loc(argc)
write(*,*) 'In sub: n=',n
return
end
Compiled and linked into a shared object library sub.so using:
f77 -c -pic sub.f
ld -o sub.so sub.o /usr/lang/SC1.0/lib{F77,m}.a
IDL started in the directory containing sub.so, and the following
commands issued:
IDL> a = 2.5
IDL> dummy = call_external('sub.so','_sub_',a)
The result is that IDL immediately dies with the message:
ld.so: map heap error (9) for /dev/zero
Thanks,
Bill McKie
mckie@sky.arc.nasa.gov
|
|
|