[OctDev] arpack: eigs crash with octave 3.0.5 compiled with --enable-64
David Bateman
dbateman at dbateman.org
Sun Jun 7 08:12:08 CDT 2009
Alexander Barth wrote:
> On Fri, Jun 5, 2009 at 9:20 PM, David Bateman<dbateman at dbateman.org> wrote:
>
>> Why not just use
>> octave_idx_type if the fortran logical index is 8bit with --enable-64?
>>
>>
>
> This is in the end what I did, but I declared a macro
> octave_f77_bool_type defined as octave_idx_type.
>
> The underlying assumption is that the Fortran compiler uses the same
> amount of bytes for INTEGER and LOGICAL. I would prefer to "hide" this
> assumption behind a macro since there might be some Fortran compilers
> that handle things differently. (After all, it is quite wasteful to
> allocate 8 bytes for a variable with only two states).
>
> I looked a bit around how the different Fortran compilers handle the
> size of LOGICALs. For gfortran (with and without -fdefault-integer-8)
> and ifort (with and without -i8), the size of LOGICALs will always be
> the size of INTEGER. However, with pgf90, the compiler option -i8,
> leaves the size of LOGICALs to 4 bytes. Only the option -i8storage
> allocates 8 bytes for INTEGER and LOGICAL.
>
> This reminds me also a bit of the assumption that size of a pointer
> will always be the same as the size of an int in C. Such assumption is
> the classical problem when porting a program to 64-bit CPU.
>
> Cheers,
> Alex
>
Grrr, then we need an autoconf test that probes the number of bytes in a
fortran logical type and sets your macro appropriately...
D.
--
David Bateman dbateman at dbateman.org
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
More information about the Octave-maintainers
mailing list