bugGNU Octave - Bugs: bug #65696, (sparsersb) does not handle C++17...

 
 

bug #65696: (sparsersb) does not handle C++17 properly

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Mon 06 May 2024 01:35:53 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * stable Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Fri 01 Aug 2025 04:14:57 AM UTC, comment #4: 

I was wrong - NLopt was setting it in cmake:
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

dropping that fixed it.

Orion Poplawski <opoplawski>
Fri 01 Aug 2025 03:58:26 AM UTC, comment #3: 

We seem to be seeing a similar error trying to build NLopt against octave 10.1.0 in Fedora rawhide. It seems like NLopt is picking up the -std=gnu++11 flag from the octave compile flags and getting the same error about `pmr`.

If octave itself needs the flag, it should not necessarily get passed to deps that don't.  Or is there something else going on here?

Orion Poplawski <opoplawski>
Tue 07 May 2024 08:33:03 AM UTC, comment #2: 

Fwiw, we are applying the following patch on the release tarball of sparsersb in MXE Octave:
https://hg.octave ... -2-no-cxx11.patch

# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1643220705 -3600
#      Wed Jan 26 19:11:45 2022 +0100
# Node ID 47e601506819386cc03e9e412c0615cbac02aa8f
# Parent  67a14d968d2db3ffe34474e6be1c7a2d164ad416
Don't force std=gnu++11. We prefer a newer standard now.
Ideally, this would check if some switch is necessary to enable C++11 feature
support in the compiler.

diff -r 67a14d968d2d -r 47e601506819 src/configure.ac
--- a/src/configure.ac        Tue Sep 21 11:09:59 2021 +0200
+++ b/src/configure.ac        Wed Jan 26 19:11:45 2022 +0100
@@ -225,7 +225,7 @@
 AC_SUBST(OCTAVE)
 AC_SUBST(TARGETS)
 AC_SUBST(SPARSERSB_CXXFLAGS)
-AC_SUBST(SPARSERSB_CXX11, ["-std=gnu++11"])
+AC_SUBST(SPARSERSB_CXX11)
 AC_SUBST(SPARSERSB_LDFLAGS)

 AC_CONFIG_FILES([Makeconf])


But we can only do that because we know that the compiler that we are building as part of the MXE Octave build process doesn't need any flags for C++11.

Markus Mützel <mmuetzel>
Group administrator
Tue 07 May 2024 07:14:46 AM UTC, comment #1: 

CC'ing package maintainer.

A possible solution might be to use the autotools macro AX_CXX_COMPILE_STDCXX instead of hardcoding `-std=gnu++11` as one of the compilation flags. (At least that is what core Octave does.)

https://www.gnu.o ... mpile_stdcxx.html

Markus Mützel <mmuetzel>
Group administrator
Mon 06 May 2024 01:35:53 PM UTC, original submission:  

When building sparsersb with C++17 (and pmr) I see:


octave:1> pkg install -forge -verbose sparsersb
downloading tarball(s) from:
- https://packages.octave.org/download/sparsersb-1.0.9.tar.gz
mkdir (/tmp/oct-HU0kRV)
untar (/tmp/sparsersb-1.0.9-mBoo6t.tar.gz, /tmp/oct-HU0kRV)
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether g++ -std=gnu++17 accepts -g... yes
checking for g++ -std=gnu++17 option to enable C++11 features... none needed
checking for octave... /usr/local/bin/octave-9.1.91
checking for mkoctfile... /usr/local/bin/mkoctfile-9.1.91 --verbose
configure: No user-set LIBRSB_TARBALL environment variable detected (set it to build using a custom librsb tarball).
configure: No librsb tarball provided: following the default procedure.
checking for librsb-config... yes
configure: Setting SPARSERSB_CXXFLAGS from librsb-config --I_opts...
configure: Adding -D RSBOI_DETECTED_LONG_IDX to SPARSERSB_CXXFLAGS ...
configure: Setting SPARSERSB_LDFLAGS from --L_opts --libs
configure: SPARSERSB_CXXFLAGS is -I/usr/local/include/ -D RSBOI_DETECTED_LONG_IDX=1
configure: SPARSERSB_LDFLAGS  is -L/usr/local/lib -lrsb
checking for octave_value function iscomplex... yes
configure: creating ./config.status
config.status: creating Makeconf
configure:

octave sparsersb package is configured with:
  SPARSERSB_LDFLAGS:     -L/usr/local/lib -lrsb
  SPARSERSB_CXXFLAGS:    -I/usr/local/include/ -D RSBOI_DETECTED_LONG_IDX=1
  SPARSERSB_CXX11:       -std=gnu++11
  OCTAVE:                /usr/local/bin/octave-9.1.91
  MKOCTFILE:             /usr/local/bin/mkoctfile-9.1.91 --verbose -g


Note "SPARSERSB_CXX11:       -std=gnu++11"

That fails later on:

make: Entering directory '/tmp/oct-HU0kRV/sparsersb-1.0.9/src'
LFLAGS=" -L/usr/local/lib -shared -Wl,-Bsymbolic -L/usr/local/lib -lrsb" LDFLAGS=" -L/usr/local/lib -shared -Wl,-Bsymbolic -L/usr/local/lib -lrsb" CXXFLAGS="-I/usr/local/include/ -D RSBOI_DETECTED_LONG_IDX=1 -DHAVE_OCTAVE_VALUE_ISCOMPLEX -std=gnu++11" /usr/local/bin/mkoctfile-9.1.91 --verbose -g -v -D'RSB_SPARSERSB_LABEL=sparsersb' -o sparsersb.oct sparsersb.cc
g++ -std=gnu++17 -c  -fPIC -I/usr/local/include/octave-9.1.91/octave/.. -I/usr/local/include/octave-9.1.91/octave -I/usr/local/include  -pthread -fopenmp -I/usr/local/include/ -D RSBOI_DETECTED_LONG_IDX=1 -DHAVE_OCTAVE_VALUE_ISCOMPLEX -std=gnu++11 -g    -DRSB_SPARSERSB_LABEL=sparsersb sparsersb.cc -o /tmp/oct-kxDyIR.o
In file included from /usr/local/include/octave-9.1.91/octave/../octave/Array.h:38,
                 from /usr/local/include/octave-9.1.91/octave/../octave/Array-util.h:31,
                 from /usr/local/include/octave-9.1.91/octave/../octave/MSparse.h:31,
                 from /usr/local/include/octave-9.1.91/octave/../octave/MatrixType.h:33,
                 from /usr/local/include/octave-9.1.91/octave/../octave/mx-base.h:33,
                 from /usr/local/include/octave-9.1.91/octave/../octave/Matrix.h:34,
                 from /usr/local/include/octave-9.1.91/octave/../octave/oct.h:33,
                 from sparsersb.cc:71:
/usr/local/include/octave-9.1.91/octave/../octave/Array-fwd.h:34:45: error: ‘pmr’ in namespace ‘std’ does not name a type
   34 | template <typename T, typename Alloc = std::pmr::polymorphic_allocator<T>>
      |                                             ^~~


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by opoplawski (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    Votes

    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.

     

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-07 mmuetzel Item GroupNone Build Failure
        StatusNone Confirmed
        Operating SystemGNU/Linux Any
    2024-05-07 mmuetzel Carbon-Copy- Added dezperado

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code