Thanks for the further investigation and report. As you can
tell, it is a little hard to follow the typemap stuff. :-)
Post by Edward BaudrezBack with more details. I've attached a program which builds and tests fine
on my setup (64-bit Linux machine with PDL 2.006_91). Notice in particular
the two variables of type PDL_Indx in the function body of myhistogram(). I
assume this confirms the typedef in pdl.h works fine.
However, when I change the two 'long's (one in the OtherPars section of
myhistogram() and the other one as the argument of myfunction()) to
PDL_Indx, the program fails to build.
First, the 'long' argument to myfunction(). When I change it to 'PDL_Indx',
the build fails with
--------------
Could not find a typemap for C type 'PDL_Indx'.
'AV *', 'Boolean', ...
--------------
I found the typemap file 'typemap.pdl' in the PDL/Core directory doesn't
contain the PDL_Indx type. The typemap called 'typemap' in the PDL source
directory, however, does. I assume it's internal to the build, though.
Manually adding PDL_Indx to typemap.pdl in PDL/Core resolves the problem of
PDL_Indx in the argument list of myfunction(). But I think the user
shouldn't be required to do this.
Second, the 'long' argument (in OtherPars) to myhistogram(). When I change
it to 'PDL_Indx', the build fails with
--------------
/home/ebaudrez/opt/perl/5.16.3/bin/perl
-I/home/ebaudrez/opt/perl/5.16.3/lib/site_perl/5.16.3/x86_64-linux
"-MPDL::PP qw/MyHistogram MyHistogram MyHistogram/" histogram.pd
The type =PDL_Indx= does not have a typemap entry!
make: *** [MyHistogram.pm] Error 2
--------------
This error is issued by PDL::PP. So apparently, even after adding PDL_Indx
to typemap.pdl in PDL/Core, PDL::PP is unable to find it. However, adding a
typemap file to the current working directory containing "PDL_Indx T_IV",
the build works and tests fine. So it appears to be a matter of path lookups
... I think the user shouldn't be required to do this.
Hope this helps
Best regards
Edward
Post by Chris MarshallDo you have another PDL install on your system? Maybe an
older PDL typemap is being used instead of the one in the
CPAN developers release you were working with?
--Chris
Post by Chris MarshallCould you provide a short example of the problem for
debugging? If this feature is not working, it definitely
should be fixed before the official release. Thanks.
--Chris
On Fri, Sep 27, 2013 at 6:36 AM, Edward Baudrez
Post by Edward BaudrezDear porters
I'm reading primitive.pd line 1627 and below (the definition of histogram()
and related functions). These functions should be updated for 64-bit. The
register PDL_Indx j;
register PDL_Indx maxj = $SIZE(m)-1;
j = (PDL_Indx) (($in()-min)/step);
Logically, 'm' should have type PDL_Indx. However, when I want to specify
OtherPars as follows
OtherPars => 'double step; double min; PDL_Indx msize => m'
The type =PDL_Indx= does not have a typemap entry!
There *is* a typemap entry for PDL_Indx, so I don't understand the error
message. The XS code doesn't even get generated for this function, so I
can't look at that to see what's going wrong. Anybody any idea?
Best regards
Edward
_______________________________________________
PDL-porters mailing list
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters