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

Home » Public Forums » archive » passing an idl function to a c-code ?
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
passing an idl function to a c-code ? [message #70778] Thu, 06 May 2010 10:24 Go to next message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
Hi,

I would like to call a c library (a sharable library .so, I work on
linux) from idl by call_external, this c-library requires a pointer to
an user-defined function.
sadly for other reasons I have already written my user-defined
function in idl. I was wondering if there is a way to pass this
function to the c-code. I guess not.
have anybody had this problem already? is there any option other than
rewriting in c the user-function?

probably it's irrelevant, but I want to make precise this c-library is
just a wrapper to a fortran subroutine.

simona
Re: passing an idl function to a c-code ? [message #70840 is a reply to message #70778] Mon, 10 May 2010 04:46 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
I was trying to use the library multinest, a tool for bayesian
statistics.
It requires a user-function as input.
there are some previous posts on this group discussing this problem,
but they were quite old and unsuccessful.
I was hoping there were news about that.

anyway multinest is mpi-compatible, and into the External Development
Guide they say
you should not call an idl function in a parallel code
(and you should not use callable idl in a code called somehow by idl).
by the way I gave up and wrote a c-code.

> wow - so you want IDL to call a C program, which wraps to Fortran, and
> which re-calls IDL?! are you sure you don't want to throw some python
> in there, just to round things out :)?
>
> chris
Re: passing an idl function to a c-code ? [message #70848 is a reply to message #70778] Fri, 07 May 2010 19:08 Go to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On May 6, 7:24 am, simona bellavista <afy...@gmail.com> wrote:
> Hi,
>
> I would like to call a c library (a sharable library .so, I work on
> linux) from idl by call_external, this c-library requires a pointer to
> an user-defined function.
> sadly for other reasons I have already written my user-defined
> function in idl. I was wondering if there is a  way to pass this
> function to the c-code. I guess not.
> have anybody had this problem already? is there any option other than
> rewriting in c the user-function?
>
> probably it's irrelevant, but I want to make precise this c-library is
> just a wrapper to a fortran subroutine.
>
> simona

wow - so you want IDL to call a C program, which wraps to Fortran, and
which re-calls IDL?! are you sure you don't want to throw some python
in there, just to round things out :)?

chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Why there is no cot function in IDL
Next Topic: Re: Why postscript colors are same as screen?

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

Current Time: Fri Oct 10 02:01:22 PDT 2025

Total time taken to generate the page: 0.56531 seconds