Hello Guy,
I have just made a document describing how to compile a C function
into PDL. Tomorrow, hopefully, I will do the same for a FORTRAN
function.
Have a look in
http://wiki.jach.hawaii.edu/pdl_wiki-bin/wiki/PDL_Cookbook
Cheers,
Xavier
On 2/21/07, Vanuxem Grégory <[EMAIL PROTECTED]> wrote:
Le mardi 20 février 2007 à 19:41 -0300, Karl Glazebrook a écrit :
> On CallExt from perl have a look at callext.t in the PDL distribution.
>
>
> It is important to clarify whether you are having problems building a
> routine to use with CallExt or simply running it,
>
> The other way to call C etc is using Inline::PP
Yes and here is a quickly hacked example (I call fortran here):
====================================================================
use PDL;
use Inline Pdlpp => Config =>
INC => "-I$ENV{HOME}/include",
LIBS => "-lm -lblas -lg2c",
#code to be included in the generated XS
AUTO_INCLUDE => <<'EOINC',
extern double dasum_(int *n, double *x, int *incx);
EOINC
;
use Inline Pdlpp;
$a = random(5);
print $a->sumover,"\n";
print $a->mydasum(),"\n";
__DATA__
__Pdlpp__
pp_def('mydasum',
Pars => 'x(n); [o] res()',
GenericTypes => [D],
Code =>
'
int inc = 1;
$res() = dasum_(&($SIZE(n)),$P(x),&inc);
');
===========================================================================
Apparently, on my distro (Debian), the html documentation of this
functionnality was not installed so I had to use 'man' (man
PDL::PP-Inline).
Greg
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.
http://fr.mail.yahoo.com
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl