Call_External and the C Math Library [message #6313] |
Thu, 06 June 1996 00:00  |
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  |
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
|
|
|