Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
Perl uses a special typedef IV which is a simple signed integer type
that is guaranteed to be large enough to hold a pointer (as well as an
integer). Additionally, there is the UV, which is simply an unsigned
IV.

This seemed to be the ideal way to portably determine the platform
capabilities regarding 64bit index support. It sounds like some fixes
are still needed in the PDL slatec bindings (and presumably for other
fortran-based interfaces).

Please open bug reports for problems you discover as I would like to
get 64bit index support finalized for the PDL-2.008 release. I still
haven't had time to debug the final 64bit index handling for the
base PDL distribution (sans external libraries) but once that is
working, fixes for PDL slatec and all the other external dependencies
will need to be done.

Cheers,
Chris
Moin,
while debugging slatec failures on the debian powerpc port, I discovered
that 64bit indexing support is enabled on that architecture, although it
is a 32bit arch (ppc64 is handled separately).
The reason is that perl is configured explicitely with 64bit (long long int)
ivtype on all of debian's architectures.
While the latter is not bad per se, as ivtype is, as far as I understand it,
responsible for perl scalars, it leads to some problems with the interface
- slatec declares matrix size arguments to be 'integer'
- gfortran uses, at least on ppc, 32bit as default 'integer' size
- the PDL slatec interface hands pointers to 64bit ints (PDL_Indx) to the
f77
on big-endian architectures, the fortran code will see 0, when a (small)
64bit number is read as a 32bit int.
given that the matrix size arguments are used as loop boundaries in slatec,
and fortran uses 1-based array indices by default, this results in
out-of-bounds memory access.
Somehow I think, as PDL_Indx is used for addressing memory, it should _not_
be derived from ivtype/ivsize, but from the architectures native pointer
size.
Any opinions?
--
c u
henning
_______________________________________________
PDL-porters mailing list
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters
Loading...