bugGNU Octave - Bugs: bug #63633, SUNDIALS 6.5.0 requires C++14

 
 

bug #63633: SUNDIALS 6.5.0 requires C++14

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Mon 09 Jan 2023 09:49:24 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 8.0.90 Operating System:  * Any
Fixed Release:  8.1.0 Planned Release:  8.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 16 Jan 2023 03:20:32 PM UTC, comment #9: 

Passed CI.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 16 Jan 2023 01:09:15 PM UTC, comment #8: 

That seems to have enabled building on macOS with Apple Clang again: In the CI tests on macOS, it is (correctly) detected that the SUNDIALS headers don't compile with the flags determined by the configure script. And Octave is successfully built without the SUNDIALS libraries.

I pushed this additional change for the CI that set the C++ compiler to enable C++14 with GNU extensions on macOS:
https://hg.savannah.gnu.org/hgweb/octave/rev/bbc44e60120b

I hope that'll allow building with SUNDIALS 6.5.0 on that platform again.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sun 15 Jan 2023 03:15:44 PM UTC, comment #7: 

Turn out we already have a check if those headers can be used. We just need to make sure they are also working with the C++ compiler.

Pushed a change to the stable branch here:
https://hg.savannah.gnu.org/hgweb/octave/rev/3dcdb05a2e68

If that allows to build again with Apple Clang without setting `CXX`, I'll try to set `CXX="clang++ -std=gnu++14"` manually for the CI on macos.

Markus Mützel <mmuetzel>
Group administrator
Tue 10 Jan 2023 05:04:48 PM UTC, comment #6: 

Or better: It won't work. We need GNU extensions. That means, a user would need to set `CXX="clang++ -std=gnu++14"`.

Markus Mützel <mmuetzel>
Group administrator
Tue 10 Jan 2023 05:01:50 PM UTC, comment #5: 

That will likely work. I was just wondering if we should add a configure check for that. I.e., test early if SUNDIALS can be used with the provided flags. And disable SUNDIALS if we can't.
A user could still add the necessary flags if their compiler supports it.

Markus Mützel <mmuetzel>
Group administrator
Tue 10 Jan 2023 04:12:52 PM UTC, comment #4: 

You may try to set CXX="clang++ -std=c++14"

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 10 Jan 2023 03:49:46 PM UTC, comment #3: 

See also the configure results on the runners:
https://github.com/gnu-octave/octave/actions/runs/3863542612/jobs/6585794690#step:8:1061

  C++ compiler:                  clang++ -std=gnu++11  -pthread  -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -O2 -g


Markus Mützel <mmuetzel>
Group administrator
Tue 10 Jan 2023 03:46:05 PM UTC, comment #2: 

We are using `AX_CXX_COMPILE_STDCXX(11, [], mandatory)` in our configure script. IIUC, that checks for some C++11 features first without any `-std=c++**` or `-std=gnu++**` flag. If that fails, it tries to add `-std=gnu++11` to the flags and tries again.

Presumably, the version of Apple clang on the CI runners needs a flag for C++11 features.

Markus Mützel <mmuetzel>
Group administrator
Tue 10 Jan 2023 03:38:08 PM UTC, comment #1: 

Does Octave explicitly require C++11 or just a minimum of C++11?  Are the build rules for macOS set -std=c++11?

John W. Eaton <jwe>
Group administrator
Mon 09 Jan 2023 09:49:24 AM UTC, original submission:  

Building Octave on macOS with Homebrew is currently failing.
E.g.:
https://github.com/gnu-octave/octave/actions/runs/3863542612/jobs/6585794728#step:9:4224

In file included from ../libinterp/dldfcn/__ode15__.cc:49:
In file included from /usr/local/include/nvector/nvector_serial.h:42:
In file included from /usr/local/include/sundials/sundials_nvector.h:50:
In file included from /usr/local/include/sundials/sundials_context.h:44:
/usr/local/include/sundials/sundials_context.hpp:31:32: error: unexpected type name 'SUNContext': expected expression
    sunctx_ = std::make_unique<SUNContext>();
                               ^
/usr/local/include/sundials/sundials_context.hpp:31:20: error: no member named 'make_unique' in namespace 'std'
    sunctx_ = std::make_unique<SUNContext>();
              ~~~~~^
/usr/local/include/sundials/sundials_context.hpp:31:44: error: expected expression
    sunctx_ = std::make_unique<SUNContext>();
                                           ^


That is because SUNDIALS 6.5.0 requires `std::make_unique` which was added with C++14:
https://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique

Octave currently requires a C++11 compatible compiler.

We should probably add a configure check to make sure the detected version of SUNDIALS is working with the used compiler (and compiler flags).

Markus Mützel <mmuetzel>
Group 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 dasergatskov (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-16 mmuetzel Open/ClosedOpen Closed
    2023-01-16 mmuetzel StatusReady For Test Fixed
        Fixed ReleaseNone 8.1.0
    2023-01-16 mmuetzel StatusIn Progress Ready For Test
    2023-01-15 mmuetzel StatusNone In Progress
        Planned ReleaseNone 8.1.0

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code