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

Home » Public Forums » archive » Re: External c calls broken in IDL 5.5
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: External c calls broken in IDL 5.5 [message #31988 is a reply to message #31984] Wed, 04 September 2002 12:05 Go to previous messageGo to previous message
Stein Vidar Hagfors H[1] is currently offline  Stein Vidar Hagfors H[1]
Messages: 56
Registered: February 2000
Member
Bob <b_o_b_1962@nospam.yahoo.com> writes:

> Nigel Wade wrote:
>
>> The interface you have specified is for a DLM/LINKIMAGE function, but you
>> have tried to call it with call_external (which has a completely different
>> execution method).
>>
>> Try instead:
>>
>> IDL> linkimage,'test','./test.so',0,'test'
>> IDL> test,n,x
>
> OK, thanks. I didn't realize that they were different. But this doesn't
> change the fact that my old DLM's no longer work in IDL 5.5. Am I the only
> one with this problem.

Yo! Someone who's seen the light and is using DLMFORM, cool!

Now, to deal with the DLM/LINKIMAGE versus CALL_EXTERNAL first, Nigel
is quite correct; however, if you make sure to set IDL_DLM_PATH to
include the directory where your test.so file (and the "test.dlm" file
produced by dlmform) is residing (before starting IDL) you should not
have to use the linkimage procedure at all. Simply drop that line, and
say:

IDL> test,n,x

That's it. The information provided in the linkimage statement is
provided in the .dlm file, which IDL scans upon startup (as long as it
has the IDL_DLM_PATH set to find it!), and in the IDL_Load() procedure
in the C file, which is executed on loading the module. Try help,/dlm
for a list of all the DLM's that it has found (a lot of IDL's
packages, like mpeg/hdf/etc, are implemented this way nowadays). Note
that the name of the procedure "advertised" in the .dlm file and
provided in the IDL_Load() registration routine is based on the
fortran function name plus prefix "F77_". If you edit the name of the
function advertised in the C file (e.g. taking away the "F77_"
prefix), you should also do so in the DLM file for the automated
loading to work (i.e. without the linkimage statement).

Now, for the crashing, I bet your fortran routine uses complex
numbers?? (Okay, I don't bet a lot, but this is my only "known"
suspect). Guess what - IDL changed the spec of the IDL_CvtComplex
call in IDL 5.4 and told no-one about it (in the edg.pdf at least, at
the time). So, I suspect this is your problem (I haven't tested
dlmform on 5.5, since I don't run that here.. be my guest).

Now, I did make a workaround involving a C preprocessor #if statement
some time ago, I just hadn't uploaded it to the web page in
Oslo. Beware that I also made some changes between the first
"publication" and the current version to adjust to perl v 5. The
#!/usr/local/bin/perl line at the beginning may have changed from the
version you have also.

Pick up the new version now from
http://www.astro.uio.no/~steinhh/idl/dlmform.html and tell me if it fixes
your problem (no support promised if it doesn't, though!).

> And last, is there a newer version of dlmform. I really like this
> routine but it is using some obsolete functions.

Thanks. They weren't obsolete in 1999 ;-) That's when this project
gave me a "tennis elbow" that hasn't left me since (it should be
called a "perl elbow", from typing all those dollar signs using the
pinkie and the index finger on the same hand!).

I know that there are a few anachronisms that should be updated in the
code for dlmform... Supporting the new types like 64 bit types is one,
but unless I see or hear of a need for it (I'm assuming this is mostly
used for legacy code in fortran, and it wouldn't have those as inputs,
would it?). Here's a deal: If you send me a list of the obsolete
functions that you'd like to see replaced (with the replacements and,
preferably, the IDL version in which the change was made!!), I'll see
what I can do!

--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL Primer
Next Topic: Re: CW_Animate procedure...

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

Current Time: Sun Oct 12 07:30:24 PDT 2025

Total time taken to generate the page: 2.07473 seconds