CALL_EXTERNAL ERROR [message #28837] |
Tue, 15 January 2002 08:11  |
guenhwyvar
Messages: 4 Registered: October 2001
|
Junior Member |
|
|
Hello,
I've tried to run some C code under IDL, using CALL_EXTERNAL function.
Following the instuctions of idl manual I've built my shared library:
cc -I my-idl-path/external -c -Kpic mylib.c
cc -G -o mylib.so mylib.c
When I've tried to run my code I get some strange errors:
IDL> temp = call_external('mylib.so', 'myfunc')
% CALL_EXTERNAL: Error loading sharable executable.
Symbol: myfunc, File = mylib.so
ld.so.1:
/opt/rsi/idl_5.4/bin/bin.solaris2.sparc64/idl:
fatal: /export/home/users/belletti/lib/mylib.so:
wrong
ELF class: ELFCLASS32
% Execution halted at: $MAIN$
I've decided to make my library with gcc:
gcc -Imy-idl-path/external -c -f PIC mylib.c
gcc -shared -o mylib.so mylib.c
with the same bad results.
I run idl 5.4 on a Sun Ultra450 machine with Solaris 2.7.
The same procedure on a Pentium III machine with Mandrake Linux 8.1
and idl 5.5 works perfectly.
There's a problem in the library-making process o this is an idl
limit?
I wasn't able to find any information on idl documentation and over
the Net.
Maybe I should try to force the construction of a "simple" ELF binary?
Thanks,
Francesco Belletti
|
|
|
Re: CALL_EXTERNAL error [message #60352 is a reply to message #28837] |
Sun, 18 May 2008 19:48  |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
On May 18, 6:35 pm, Sid <siddharth.iu...@gmail.com> wrote:
> Hi,
>
> I am trying to call a fortran 90 routine from an IDL program by first
> creating a .so file and then using CALL_EXTERNAL. The command I use is
> as follows:
>
> CALL_EXTERNAL('try02.f90','t',a,b,c)
>
> and I get the error:
>
> % CALL_EXTERNAL: Error loading sharable executable.
> Symbol: t, File = try02.so
> ./try02.so: undefined symbol: t
>
> Any idea what I might have done wrong?
Hi,
From the Help on Call_External :-
sum = 0.0
S = CALL_EXTERNAL('example1.so','sum_array_', X, N_ELEMENTS(X), sum)
Perhaps you should specify 'try02.so' rather than 'try02.f90' ?
And is 't' really the entry point/routine name within try02.so that
you're trying to call??
Cheers,
Andrew
|
|
|