passing an idl function to a c-code ? [message #70778] |
Thu, 06 May 2010 10:24  |
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  |
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  |
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
|
|
|