Problems compiling shared libraries [message #47750] |
Thu, 02 March 2006 07:55  |
johnpeterkelly@gmail.
Messages: 6 Registered: March 2006
|
Junior Member |
|
|
I'm having a consistent problem compiling shared libraries for use with
the call_external() command. I've tried using the make_dll function as
well as compiling the code manually with cc or gcc. Here's what I do:
in idl:
make_dll, 'tester', 'simple_return'
Where tester.c is the name of my file, and simple_return is the name of
a function that just returns a number.
or at the command prompt:
cc -c -fPIC tester.c
cc -shared tester.o -o tester.so
When I try in IDL:
x = call_external('tester.so', 'simple_return')
I get:
% CALL_EXTERNAL: Error loading sharable executable.
Symbol: simple_return, File = tester.so
tester.so: cannot open shared object file: No such
file or directory
It would seem IDL can't find the .so file. What really confuses me is
that I have another library file that I downloaded to run some LAPACK
routines on older version of IDL (note: not compiled on my computer)
which is sitting the same directory as tester.so. When I run:
x = call_external('liblidl.so', 'c_eigen_all', matrix, 3l, e_vec,e_val)
It works fine. This leads me to the conclusion that it's not that it
can't find the file, but rather it doesn't recognize it as a library.
If it helps, I'm running IDL 6.2 and my machine has a 64 bit processor
(this has led to some completely different problems, but it might be
relevant).
Thanks in advance for your help.
--John
|
|
|