On Fri, Jun 5, 2009 at 12:20 PM, Alexander
Barth<barth.alexan...@gmail.com> wrote:
> Hi all,
>
> I have compiled octave with the option enable-64 (and compiled LAPACK,
> BLAS and SuiteSparse to use 64-bit indexes). I would like to make the
> octave-forge package arpack to work with this option. As BLAS, I have
> compiled the Fortran ARPACK library with the option
> -fdefault-integer-8 (and -fPIC).
> I have no error during the compilation, but a simple test:
> eigs(eye(5,5),2) craches octaves (see backtrace below).
>
> I'm using octave 3.0.5, gcc 4.2.4 on Ubuntu 8.04 (64-bit), arpack-1.0.7.
>
> Any help or insight how to debug this problem would be greatly appreciated.
>
> Thanks
> Alex
I think I found the error. If one uses the -fdefault-integer-8 option,
also LOGICALs are 8-bytes long
(http://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html).
In eigs-base.cc, the logical parameters that are passed to ARPACK are
only int's. I declared a macro octave_f77_bool_type which is simply
octave_idx_type (which becomes 64 bit with --enable-64). If other
fortran compiler work differently, it would be easier to modify the
code.
If people are fine with the attached patch, I can apply it to octave-forge.
Cheers,
Alex
--- eigs-base.cc.orig 2009-06-05 17:22:21.000000000 +0200
+++ eigs-base.cc 2009-06-05 17:21:30.000000000 +0200
@@ -47,6 +47,8 @@ typedef ColumnVector (*EigsFunc) (const
typedef ComplexColumnVector (*EigsComplexFunc)
(const ComplexColumnVector &x, int &eigs_error);
+#define octave_f77_bool_type octave_idx_type
+
// Arpack and blas fortran functions we call.
extern "C"
{
@@ -62,7 +64,7 @@ extern "C"
F77_RET_T
F77_FUNC (dseupd, DSEUPD) (const int&, F77_CONST_CHAR_ARG_DECL,
- int*, double*, double*,
+ octave_f77_bool_type*, double*, double*,
const octave_idx_type&, const double&,
F77_CONST_CHAR_ARG_DECL, const octave_idx_type&,
F77_CONST_CHAR_ARG_DECL, const octave_idx_type&,
@@ -85,7 +87,7 @@ extern "C"
F77_RET_T
F77_FUNC (dneupd, DNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL,
- int*, double*, double*,
+ octave_f77_bool_type*, double*, double*,
double*, const octave_idx_type&, const double&,
const double&, double*, F77_CONST_CHAR_ARG_DECL,
const octave_idx_type&, F77_CONST_CHAR_ARG_DECL,
@@ -109,7 +111,7 @@ extern "C"
F77_RET_T
F77_FUNC (zneupd, ZNEUPD) (const int&, F77_CONST_CHAR_ARG_DECL,
- int*, Complex*, Complex*,
+ octave_f77_bool_type*, Complex*, Complex*,
const octave_idx_type&, const Complex&,
Complex*, F77_CONST_CHAR_ARG_DECL,
const octave_idx_type&, F77_CONST_CHAR_ARG_DECL,
@@ -979,9 +981,9 @@ EigsRealSymmetricMatrix (const M& m, con
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
-
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
+
eig_vec.resize (n, k);
double *z = eig_vec.fortran_vec ();
@@ -1308,8 +1310,8 @@ EigsRealSymmetricMatrixShift (const M& m
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
eig_vec.resize (n, k);
double *z = eig_vec.fortran_vec ();
@@ -1558,8 +1560,8 @@ EigsRealSymmetricFunc (EigsFunc fun, oct
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
eig_vec.resize (n, k);
double *z = eig_vec.fortran_vec ();
@@ -1869,8 +1871,8 @@ EigsRealNonSymmetricMatrix (const M& m,
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
Matrix eig_vec2 (n, k + 1);
double *z = eig_vec2.fortran_vec ();
@@ -2238,8 +2240,8 @@ EigsRealNonSymmetricMatrixShift (const M
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
Matrix eig_vec2 (n, k + 1);
double *z = eig_vec2.fortran_vec ();
@@ -2533,8 +2535,8 @@ EigsRealNonSymmetricFunc (EigsFunc fun,
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
Matrix eig_vec2 (n, k + 1);
double *z = eig_vec2.fortran_vec ();
@@ -2886,8 +2888,8 @@ EigsComplexNonSymmetricMatrix (const M&
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
eig_vec.resize (n, k);
Complex *z = eig_vec.fortran_vec ();
@@ -3218,8 +3220,8 @@ EigsComplexNonSymmetricMatrixShift (cons
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
eig_vec.resize (n, k);
Complex *z = eig_vec.fortran_vec ();
@@ -3474,8 +3476,8 @@ EigsComplexNonSymmetricFunc (EigsComplex
// long as the HOWMNY arg is not "S", the logical array
// is just workspace for ARPACK, so use int type to
// avoid problems.
- Array<int> s (p);
- int *sel = s.fortran_vec ();
+ Array<octave_f77_bool_type> s (p);
+ octave_f77_bool_type *sel = s.fortran_vec ();
eig_vec.resize (n, k);
Complex *z = eig_vec.fortran_vec ();
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev