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

Home » Public Forums » archive » Call_External and the C Math Library
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Call_External and the C Math Library [message #6313] Thu, 06 June 1996 00:00 Go to next message
cavanaug is currently offline  cavanaug
Messages: 18
Registered: December 1994
Junior Member
Hey all,


Has anyone experienced problems getting IDL's call_external to behave
when called on C code that uses the standard C math library? I have
some C routines that use pow and sqrt, and when call_external was
dumping core, I tracked the problem down to the lines that contained C
math library calls. Math.h is included in the C code, and -lm is on
the link line. I tried using an explicit interface in the C code
(ie. double sqrt (double);), but that didn't help. Has anyone seen
this before and found a fix?

Thanks in advance,

Charles Cavanaugh

--
Charles Cavanaugh New Disclaimer : Since I was implicitly forced to sign an agreement
cavanaug@ncar.ucar.edu that my employer now owns my ideas, I am now required
NCAR Boulder, CO, USA to tell you that this idea was brought to you by the
My^h^hTheir opinions University Corporation for Atmospheric Research
Re: Call_External and the C Math Library [message #6444 is a reply to message #6313] Mon, 10 June 1996 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
cavanaug@uars1.acd.ucar.edu (Charles Cavanaugh) wrote:

> Has anyone experienced problems getting IDL's call_external to behave
> when called on C code that uses the standard C math library? I have
> some C routines that use pow and sqrt, and when call_external was
> dumping core, I tracked the problem down to the lines that contained C
> math library calls. Math.h is included in the C code, and -lm is on
> the link line. I tried using an explicit interface in the C code
> (ie. double sqrt (double);), but that didn't help. Has anyone seen
> this before and found a fix?

I have used CALL_EXTERNAL() to call C routines using functions from
the standard C math library without any problems. We are using
Sun SPARCstations (2,10,20) under Solaris 2.3 and 2.5, and I have
used both Sun's SparcCompiler 3.0 and gcc 2.7.1 . I know that the
C routines have used SQRT(), MODFF(), FABS() to name a few.

Hope this helps to track it down.

Dave Foster
UCSD Brain Image Analyis Lab
foster@bial1.ucsd.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3D rotations in IDL
Next Topic: Problem with IDL handle create function

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

Current Time: Wed Oct 08 15:11:43 PDT 2025

Total time taken to generate the page: 0.00569 seconds