octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52475] ode15 is not compatible with SUNDIALS


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #52475] ode15 is not compatible with SUNDIALS >= 3.0.0
Date: Wed, 13 Mar 2019 02:03:07 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #77, bug #52475 (project octave):

Thanks for checking it in.

Now on my Debian system, using the default library that is installed, I see
the following in configure:


checking suitesparse/klu.h usability... yes
checking suitesparse/klu.h presence... yes
checking for suitesparse/klu.h... yes
checking for klu_solve in -lklu... yes
checking for UMFPACK separate complex matrix and rhs split... yes
checking nvector/nvector_serial.h usability... yes
checking nvector/nvector_serial.h presence... yes
checking for nvector/nvector_serial.h... yes
checking for N_VNew_Serial in -lsundials_nvecserial... yes
checking ida/ida.h usability... yes
checking ida/ida.h presence... yes
checking for ida/ida.h... yes
checking for IDAInit in -lsundials_ida... yes
checking whether SUNDIALS IDA is configured with double precision realtype...
yes
checking sunlinsol/sunlinsol_dense.h usability... yes
checking sunlinsol/sunlinsol_dense.h presence... yes
checking for sunlinsol/sunlinsol_dense.h... yes
checking sundials/sundials_matrix.h usability... yes
checking sundials/sundials_matrix.h presence... yes
checking for sundials/sundials_matrix.h... yes
checking sundials/sundials_linearsolver.h usability... yes
checking sundials/sundials_linearsolver.h presence... yes
checking for sundials/sundials_linearsolver.h... yes
checking ida/ida_direct.h usability... yes
checking ida/ida_direct.h presence... yes
checking for ida/ida_direct.h... yes
checking whether SUNDIALS IDA includes the SUNLINSOL_DENSE linear solver...
yes
checking sundials/sundials_sparse.h usability... yes
checking sundials/sundials_sparse.h presence... yes
checking for sundials/sundials_sparse.h... yes
checking sunlinsol/sunlinsol_klu.h usability... no
checking sunlinsol/sunlinsol_klu.h presence... no
checking for sunlinsol/sunlinsol_klu.h... no
checking whether SUNDIALS IDA is configured with SUNLINSOL_KLU enabled... yes


and then when I run make, I hit the following errors:


/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc: In member function 'void
octave::IDA::set_up(const ColumnVector&)':
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:373:24: error:
'SUNSparseMatrix' was not declared in this scope
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                        ^~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:373:24: note: suggested
alternative: 'SparseMatrix'
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                        ^~~~~~~~~~~~~~~
                        SparseMatrix
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:377:27: error: 'SUNKLU' was
not declared in this scope
         sunLinearSolver = SUNKLU (yy, sunJacMatrix);
                           ^~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:377:27: note: suggested
alternative: 'SUNTRUE'
         sunLinearSolver = SUNKLU (yy, sunJacMatrix);
                           ^~~~~~
                           SUNTRUE
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc: In member function 'void
octave::IDA::jacsparse_impl(realtype, realtype, _generic_N_Vector*&,
_generic_N_Vector*&, _generic_SUNMatrix*&)':
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:457:5: error:
'SUNMatZero_Sparse' was not declared in this scope
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:457:5: note: suggested
alternative: 'SUNMatZero_Dense'
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
     SUNMatZero_Dense
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:458:32: error:
'SUNSparseMatrix_IndexPointers' was not declared in this scope
     octave_idx_type *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:458:32: note: suggested
alternative: 'SUNDenseMatrix_Print'
     octave_idx_type *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                SUNDenseMatrix_Print
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:459:32: error:
'SUNSparseMatrix_IndexValues' was not declared in this scope
     octave_idx_type *rowvals = SUNSparseMatrix_IndexValues (Jac);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:459:32: note: suggested
alternative: 'SUNDenseMatrix_Column'
     octave_idx_type *rowvals = SUNSparseMatrix_IndexValues (Jac);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                SUNDenseMatrix_Column
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:464:17: error:
'SUNSparseMatrix_Data' was not declared in this scope
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:464:17: note: suggested
alternative: 'SUNDenseMatrix_Data'
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
                 SUNDenseMatrix_Data
make[2]: *** [Makefile:19238: libinterp/dldfcn/__ode15___la-__ode15__.lo]
Error 1


If I add


CPPFLAGS="-I/usr/include/suitesparse"


to my configure options so that "#include <klu.h>" will work, then I hit this
error:


/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc: In member function 'void
octave::IDA::jacsparse_impl(realtype, realtype, _generic_N_Vector*&,
_generic_N_Vector*&, _generic_SUNMatrix*&)':
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:458:66: error: cannot
convert 'sunindextype*' {aka 'int*'} to 'octave_idx_type*' {aka 'long int*'}
in initialization
     octave_idx_type *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                                                                  ^
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:459:64: error: cannot
convert 'sunindextype*' {aka 'int*'} to 'octave_idx_type*' {aka 'long int*'}
in initialization
     octave_idx_type *rowvals = SUNSparseMatrix_IndexValues (Jac);
                                                                ^
make[2]: *** [Makefile:19238: libinterp/dldfcn/__ode15___la-__ode15__.lo]
Error 1


which is the problem I mentioned in comment #72.  I pushed the following
changeset to allow the build to succeed:

http://hg.savannah.gnu.org/hgweb/octave/rev/ba0c9e84f6a8

However, I suspect some issues with integer types remain.  We should be
careful to not use "int" or "long int" (I believe long int is just 32-bits
wide on Windows systems) if we can avoid it.  If there are cases where we need
to deal with 32-bit ints, we should check that we don't have any issues with
overflow.  For example, using something similar to the checks that are done in
the Matrix classes with "octave::to_f77_int".

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?52475>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]