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

Home » Public Forums » archive » Building sharable object libraries for CALL_EXTERNAL
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: Building sharable object libraries for CALL_EXTERNAL [message #14635 is a reply to message #14591] Wed, 17 March 1999 00:00 Go to previous messageGo to previous message
rmlongfield is currently offline  rmlongfield
Messages: 68
Registered: August 1998
Member
In article <36E9649A.7F5C8B65@fajnm1.am.ub.es>,
Octavi Fors <octavi@fajnm1.am.ub.es> wrote:
> Hello,
>
> This is my first trial calling a C-routine from IDL with CALL_EXTERNAL,
> and I have some problems with building routine.so file. It's just a
> test, so the routine it's very simple:

Hello Octavi, I am a few days late, but do not know if you have solved your
problem. I work on an SGI and have the following Makefile,where grouptest is
your example program. I recall that it took a lot of testing and searching in
the SGI man pages to find the right flags. It was a lot simpler than the
sample programs provided by IDL. --------------------------------- LDFLAGS=
-lm

OBJS = grouptest.o

grouptest : $(OBJS)
ld -shared -o grouptest.so $(OBJS) $(LDFLAGS)

grouptest.o : grouptest.c
cc -c -KPIC grouptest.c -o grouptest.o


This compiles ok on my SGI. When run from IDL, the only problem is with the
returned value of output.

--IDL sample file ---->
pro grouptest
a = FLOAT(1.4)
b= LONG(2)
c = LONG(7)
d = LONG(9)
output = CALL_EXTERNAL('grouptest.so','grouptest',a,b,c,d)
print,'Returned value from group test: ',output
end
-------------------------

If you can search back in this newsgroup a couple of months (Dejanews, for
example, can be used to search archives) you will find a lot of discussion
about CALL_EXTERNAL and pointers. Maybe it is different for a SUN, but I am
pretty sure that you cannot pass a pointer with the C return statement. Note
also that all memory for variables sent through CALL_EXTERNAL must first be
specified in IDL. This may also be a source of error. Another note is that,
if you change your C code, you must exit IDL before running again from within
IDL.

I use CALL_EXTERNAL with C and Fortran programs in a simple way which works.
Please feel free to ask further questions and I will try to help.

Good Luck!
Rose

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing on X without X device (!)
Next Topic: Re: Colour maps ... (BYTE_SCALE)

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

Current Time: Sat Oct 11 14:29:05 PDT 2025

Total time taken to generate the page: 0.40089 seconds