bugGNU Octave - Bugs: bug #55911, building with sundials 3.x does...

 
 

bug #55911: building with sundials 3.x does not warn in configure that support is disabled

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Wed 13 Mar 2019 05:45:40 PM UTC  
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Thu 14 Mar 2019 05:52:55 PM UTC, comment #19: 

It's fine with me it we close it.  As far as I can tell, it works.  If there are other problems, let's address them separately.

John W. Eaton <jwe>
Project Administrator
Thu 14 Mar 2019 05:20:08 PM UTC, comment #18: 

Can we closed this as fixed now? Is configure doing everything everyone expects with the given versions and options of sundials? It works for me.

Mike Miller <mtmiller>
Project Administrator
Thu 14 Mar 2019 02:55:56 PM UTC, comment #17: 

Carlo: Yes, I couldn't find SUNLinSol_KLU anywhere in the libraries or headers on my system with 3.1.2.  So it's good for my installation that we are still checking for SUNKLU instead of SUNLinSol_KLU, but if SUNKLU is removed, then there will be another problem.

John W. Eaton <jwe>
Project Administrator
Thu 14 Mar 2019 10:12:14 AM UTC, comment #16: 

ooops sorry, actually the build only worked with
sundials versions 4.0.1 through 4.1.0 so indeed
you do need the deprecated symbols to build with
3.1.2

Carlo de Falco <cdf>
Project Member
Thu 14 Mar 2019 09:37:37 AM UTC, comment #15: 

Re: comment #12

jwe : I have removed use of

SUNKLU

with changeset d94876e7a0aa so I don't understand where your
warnings came from if you tried before applying 5042a568771a

Carlo de Falco <cdf>
Project Member
Thu 14 Mar 2019 09:33:15 AM UTC, comment #14: 

Re: comment #12

jwe, if you don't want to support versions <= 3.1
I don't think you need to support the deprecated APIs

I can build with versions 3.1.0 through 4.1.0 using changeset
d94876e7a0aa without problems.

All my versions of sundials have 64bit integers and KLU.

As the situation is already very complicated I would avoid
this extra complication if possible.

Carlo de Falco <cdf>
Project Member
Thu 14 Mar 2019 07:47:43 AM UTC, comment #13: 

This latest change also works for me. Now I can build with sundials 3.1.2 and without CPPFLAGS set, I get the warning about lack of sparse Jacobian, everything builds and the functions are usable. All tests pass, with 2 tests skipped in ode15i and 5 tests skipped in ode15s.

If I build with CPPFLAGS=-I/usr/include/suitesparse, then everything is detected, I get no warning, builds fine and all tests pass.

Mike Miller <mtmiller>
Project Administrator
Thu 14 Mar 2019 07:13:04 AM UTC, comment #12: 

No, I'm not trying to support 2.7, just 3.1.2.

There are so many possibilities here that it is really complicated.

On my system with Sundials 3.1.2, if I configure without -I/usr/include/suitesparse in CPPFLAGS (so including <klu.h> will fail), then I see the following errors unless I disable HAVE_SUNDIALS:

  CXX      libinterp/dldfcn/__ode15___la-__ode15__.lo
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc: In function '_generic_SUNLinearSolver* SUNLinSol_KLU(N_Vector, SUNMatrix)':
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:107:10: error: 'SUNKLU' was not declared in this scope
   return SUNKLU (y, A);
          ^~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:107:10: note: suggested alternative: 'SUNTRUE'
   return SUNKLU (y, A);
          ^~~~~~
          SUNTRUE
/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:395:60: error: 'CSC_MAT' was not declared in this scope
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                                                            ^~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:395: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:395:24: note: suggested alternative: 'SparseMatrix'
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                        ^~~~~~~~~~~~~~~
                        SparseMatrix
/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:479:5: error: 'SUNMatZero_Sparse' was not declared in this scope
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:479:5: note: suggested alternative: 'SUNMatZero_Dense'
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
     SUNMatZero_Dense
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:480:29: error: 'SUNSparseMatrix_IndexPointers' was not declared in this scope
     sunindextype *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:480:29: note: suggested alternative: 'SUNDenseMatrix_Print'
     sunindextype *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             SUNDenseMatrix_Print
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:481:29: error: 'SUNSparseMatrix_IndexValues' was not declared in this scope
     sunindextype *rowvals = SUNSparseMatrix_IndexValues (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:481:29: note: suggested alternative: 'SUNDenseMatrix_Column'
     sunindextype *rowvals = SUNSparseMatrix_IndexValues (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                             SUNDenseMatrix_Column
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:486:17: error: 'SUNSparseMatrix_Data' was not declared in this scope
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
/home/jwe/src/octave/libinterp/dldfcn/__ode15__.cc:486:17: note: suggested alternative: 'SUNDenseMatrix_Data'
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
                 SUNDenseMatrix_Data
make: *** [Makefile:19238: libinterp/dldfcn/__ode15___la-__ode15__.lo] Error 1

which is why I added the extra condition:

    && test "x$ac_cv_header_sunlinsol_sunlinsol_klu_h" = xyes \

in configure.ac.  Maybe a better thing to do would be this patch:

http://hg.savannah.gnu.org/hgweb/octave/rev/5042a568771a

The vague error message that I added about disabling SUNDIALS because "something is missing" was an expression of frustration because there are too may possibilities here and it is really complicated!

John W. Eaton <jwe>
Project Administrator
Thu 14 Mar 2019 06:20:26 AM UTC, comment #11: 

So it sounds like the configure logic still isn't quite right? Reopening.

I only have one version of sundials, 3.1.2, and it's built with KLU. I'm not sure what the difference is when sundials isn't built with KLU. Is it the presence or absence of the sunlinsol_klu.h header file that tells you that?

We also need to differentiate the case of sundials was built with support for KLU, but it's sundials 3.x and klu.h isn't found because the include path is not set, which is where I started with this bug report, and what jwe fixed for me.

Mike Miller <mtmiller>
Project Administrator
Thu 14 Mar 2019 06:00:41 AM UTC, comment #10: 

it seems in _ode15_.cc the macro used to decide whether the sunlinsol_klu.h header is available is HAVE_SUNLINSOL_SUNLINSOL_KLU_H while that use for disabling the sparse solver is HAVE_SUNDIALS_SUNLINSOL_KLU.

Are they both set correctly set by configure in the case when SUNDIALS is compiled without KLU?

Carlo de Falco <cdf>
Project Member
Thu 14 Mar 2019 05:36:47 AM UTC, comment #9: 

jwe, thanks for looking into this.

regarding your changes in configure : are you trying to support backward compatibilty with SUNDIALS >= 2.7 ?

As for _ode15_.cc it is supposed to work without KLU
the solver should fall back to dense in that case.

the code in _ode15_.cc for that purpose seem to be correct
but the detection at configure time is not.

with your changes it seems SUNDIALS is disabled altogether
if it does not work with KLU.

Carlo de Falco <cdf>
Project Member
Thu 14 Mar 2019 05:21:55 AM UTC, comment #8: 

BIST test are failing due to a change in str2func which
I brought up on the mailing list here :

  http://octave.1599824.n4.nabble.com/str2func-tp4692001.html

as the change is intended for Matlab compatibility the
input validation in ode15x and the corresponding tests
will need to be fixed

Carlo de Falco <cdf>
Project Member
Wed 13 Mar 2019 11:55:21 PM UTC, comment #7: 

Yeah, BIST tests are failing, but that's a separate issue.

Mike Miller <mtmiller>
Project Administrator
Wed 13 Mar 2019 11:46:53 PM UTC, comment #6: 

All buildbots seems to be failing at odeXX tests.
Fedora's buildbots have sundials 3.1.1

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 13 Mar 2019 11:43:33 PM UTC, comment #5: 

Thank you, yeah this all looks good to me now.

Building without CPPFLAGS I get

configure: WARNING: disabling SUNDIALS because something is missing, solvers odee15i and ode15s will be disabled

and building with CPPFLAGS=-I/usr/include/suitesparse I get no warning and build succeeds with functions enabled. Only testing with sundials 3.1.2 installed for now.

Mike Miller <mtmiller>
Project Administrator
Wed 13 Mar 2019 10:40:24 PM UTC, comment #4: 

Does the following additional change help?  I tested with sundials 3.1.2 installed with -I/usr/include/suitesparse in CPPFLAGS (works) without that (disables sundials) and without sundials installed (disables sundials).  If this doesn't work for you, can you show again the current messages from configure about sundials libraries, headers, and functions?

http://hg.savannah.gnu.org/hgweb/octave/rev/73b141d5a888

I do see warnings in the configure summary now when sundials is disabled by configure.

John W. Eaton <jwe>
Project Administrator
Wed 13 Mar 2019 09:28:13 PM UTC, comment #3: 

So just to make it clear, when I reported this HAVE_SUNDIALS was correctly set to false, but configure didn't warn me about it. Now, with revision ebe7e12765ba, HAVE_SUNDIALS is wrongly set to true.

But it's possible I had a leftover config.cache the first time I tested this, and the ebe7e12765ba didn't actually change that logic. The first time I probably built in an unclean build tree. This latest build I know I started from completely empty. And now configure is wrongly setting HAVE_SUNDIALS to true.

Mike Miller <mtmiller>
Project Administrator
Wed 13 Mar 2019 08:23:35 PM UTC, comment #2: 

Even worse now. Now there are no warning messages at all, configure looks like it succeeded and I would be building with sundials. But when it gets to compilation,

  CXX      libinterp/dldfcn/__ode15___la-__ode15__.lo
../libinterp/dldfcn/__ode15__.cc: In member function ‘void octave::IDA::set_up(const ColumnVector&)’:
../libinterp/dldfcn/__ode15__.cc:356:60: error: ‘CSC_MAT’ was not declared in this scope
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                                                            ^~~~~~~
../libinterp/dldfcn/__ode15__.cc:356:24: error: ‘SUNSparseMatrix’ was not declared in this scope
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                        ^~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:356:24: note: suggested alternative: ‘SparseMatrix’
         sunJacMatrix = SUNSparseMatrix (num, num, num*num, CSC_MAT);
                        ^~~~~~~~~~~~~~~
                        SparseMatrix
../libinterp/dldfcn/__ode15__.cc:360:27: error: ‘SUNLinSol_KLU’ was not declared in this scope
         sunLinearSolver = SUNLinSol_KLU (yy, sunJacMatrix);
                           ^~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:360:27: note: suggested alternative: ‘SUNLinSolFree’
         sunLinearSolver = SUNLinSol_KLU (yy, sunJacMatrix);
                           ^~~~~~~~~~~~~
                           SUNLinSolFree
../libinterp/dldfcn/__ode15__.cc:364:13: error: ‘IDASetLinearSolver’ was not declared in this scope
         if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix))
             ^~~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:364:13: note: suggested alternative: ‘SUNLinearSolver’
         if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix))
             ^~~~~~~~~~~~~~~~~~
             SUNLinearSolver
../libinterp/dldfcn/__ode15__.cc:367:9: error: ‘IDASetJacFn’ was not declared in this scope
         IDASetJacFn (mem, IDA::jacsparse);
         ^~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:367:9: note: suggested alternative: ‘IDASetId’
         IDASetJacFn (mem, IDA::jacsparse);
         ^~~~~~~~~~~
         IDASetId
../libinterp/dldfcn/__ode15__.cc:381:27: error: ‘SUNLinSol_Dense’ was not declared in this scope
         sunLinearSolver = SUNLinSol_Dense (yy, sunJacMatrix);
                           ^~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:381:27: note: suggested alternative: ‘SUNLinSolFree_Dense’
         sunLinearSolver = SUNLinSol_Dense (yy, sunJacMatrix);
                           ^~~~~~~~~~~~~~~
                           SUNLinSolFree_Dense
../libinterp/dldfcn/__ode15__.cc:385:13: error: ‘IDASetLinearSolver’ was not declared in this scope
         if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix))
             ^~~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:385:13: note: suggested alternative: ‘SUNLinearSolver’
         if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix))
             ^~~~~~~~~~~~~~~~~~
             SUNLinearSolver
../libinterp/dldfcn/__ode15__.cc:388:24: error: ‘IDASetJacFn’ was not declared in this scope
         if (havejac && IDASetJacFn (mem, IDA::jacdense) != 0)
                        ^~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:388:24: note: suggested alternative: ‘IDASetId’
         if (havejac && IDASetJacFn (mem, IDA::jacdense) != 0)
                        ^~~~~~~~~~~
                        IDASetId
../libinterp/dldfcn/__ode15__.cc: In member function ‘void octave::IDA::jacsparse_impl(realtype, realtype, _generic_N_Vector*&, _generic_N_Vector*&, _generic_SUNMatrix*&)’:
../libinterp/dldfcn/__ode15__.cc:440:5: error: ‘SUNMatZero_Sparse’ was not declared in this scope
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:440:5: note: suggested alternative: ‘SUNMatZero_Dense’
     SUNMatZero_Sparse (Jac);
     ^~~~~~~~~~~~~~~~~
     SUNMatZero_Dense
../libinterp/dldfcn/__ode15__.cc:441:29: error: ‘SUNSparseMatrix_IndexPointers’ was not declared in this scope
     sunindextype *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:441:29: note: suggested alternative: ‘SUNDenseMatrix_Print’
     sunindextype *colptrs = SUNSparseMatrix_IndexPointers (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             SUNDenseMatrix_Print
../libinterp/dldfcn/__ode15__.cc:442:29: error: ‘SUNSparseMatrix_IndexValues’ was not declared in this scope
     sunindextype *rowvals = SUNSparseMatrix_IndexValues (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:442:29: note: suggested alternative: ‘SUNDenseMatrix_Column’
     sunindextype *rowvals = SUNSparseMatrix_IndexValues (Jac);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                             SUNDenseMatrix_Column
../libinterp/dldfcn/__ode15__.cc:447:17: error: ‘SUNSparseMatrix_Data’ was not declared in this scope
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
../libinterp/dldfcn/__ode15__.cc:447:17: note: suggested alternative: ‘SUNDenseMatrix_Data’
     double *d = SUNSparseMatrix_Data (Jac);
                 ^~~~~~~~~~~~~~~~~~~~
                 SUNDenseMatrix_Data

Mike Miller <mtmiller>
Project Administrator
Wed 13 Mar 2019 07:24:12 PM UTC, comment #1: 

I pushed the following changeset:

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

Does that fix the problem for you?

John W. Eaton <jwe>
Project Administrator
Wed 13 Mar 2019 05:45:40 PM UTC, original submission:  

In Octave 5.1, configure prints a warning when the version of sundials isn't compatible:

configure: WARNING: SUNDIALS NVECTOR serial library not found.  Solvers ode15i and ode15s will be disabled.
configure: WARNING: SUNDIALS IDA library not found.  Solvers ode15i and ode15s will be disabled.

On the default branch now, I get the following from configure

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 whether SUNDIALS IDA includes the SUNLINSOL_DENSE linear solver... no
configure: WARNING:
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

Notice the empty "WARNING:" message. No warning is printed in the configure summary block.

The build finishes succesfully and I have no idea that anything was skipped, but when I run ode15{i,s}, they are disabled.

__ode15__: support for sundials_ida, sundials_nvecserial was unavailable or disabled when Octave was built

I haven't looked at the changes to configure yet, but probably some case missing in deciding to fill in a warning message variable.

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-14 jwe StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2019-03-14 jwe StatusReady For Test => In Progress
    2019-03-14 mtmiller StatusIn Progress => Ready For Test
    2019-03-14 mtmiller StatusFixed => In Progress
        Open/ClosedClosed => Open
    2019-03-13 mtmiller StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-03-13 jwe StatusNone => Ready For Test
    2019-03-13 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top


    Powered by Savane 3.5