Henning Glawe
2014-09-24 06:59:31 UTC
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
to fortran77 code:
- 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?
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
to fortran77 code:
- 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
c u
henning