Looks like things need to be updated for octave 3.8.0 support. These are some errors while trying to build plplot 5.9.11 with swig 2.0.11 and octave 3.8.0:
cd /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave && /usr/bin/swig -octave -DSWIG_OCTAVE -outdir /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave -c++ -I/builddir/build/BUILD/plplot-5.9.11/include -I/builddir/build/BUILD/plplot-5.9.11/lib/qsastime -I/builddir/build/BUILD/plplot-5.9.11/fedora -I/builddir/build/BUILD/plplot-5.9.11/fedora/include -I/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave -I/usr/include -I/usr/include/octave-3.8.0 -I/usr/include/octave-3.8.0/octave -I/builddir/build/BUILD/plplot-5.9.11/bindings/swig-support -o /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx /builddir/build/BUILD/plplot-5.9.11/bindings/octave/plplot_octave.i
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/plplot-5.9.11/fedora/CMakeFiles 19
[ 13%] Building CXX object bindings/octave/CMakeFiles/plplot_octave.dir/plplot_octaveOCTAVE_wrap.cxx.o
cd /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave && /usr/bin/c++ -DHAVE_CONFIG_H -Dplplot_octave_EXPORTS -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fPIC -I/builddir/build/BUILD/plplot-5.9.11/include -I/builddir/build/BUILD/plplot-5.9.11/lib/qsastime -I/builddir/build/BUILD/plplot-5.9.11/fedora -I/builddir/build/BUILD/plplot-5.9.11/fedora/include -I/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave -I/usr/include/octave-3.8.0 -I/usr/include/octave-3.8.0/octave -I/builddir/build/BUILD/plplot-5.9.11/bindings/swig-support -o CMakeFiles/plplot_octave.dir/plplot_octaveOCTAVE_wrap.cxx.o -c /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1507:36: warning: 'Octave_map' is deprecated (declared at /usr/include/octave-3.8.0/octave/oct-map.h:484) [-Wdeprecated-declarations]
virtual Octave_map map_value() const {
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1507:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_type::map_value() const'
virtual Octave_map map_value() const {
^
In file included from /usr/include/octave-3.8.0/octave/ov.h:58:0,
from /usr/include/octave-3.8.0/octave/oct-obj.h:34,
from /usr/include/octave-3.8.0/octave/ov-fcn.h:32,
from /usr/include/octave-3.8.0/octave/ov-builtin.h:28,
from /usr/include/octave-3.8.0/octave/defun-int.h:28,
from /usr/include/octave-3.8.0/octave/defun-dld.h:30,
from /usr/include/octave-3.8.0/octave/oct.h:36,
from /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:154:
/usr/include/octave-3.8.0/octave/ov-base.h:568:22: error: overriding 'virtual octave_map octave_base_value::map_value() const'
virtual octave_map map_value (void) const;
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In member function 'virtual dim_vector octave_swig_type::dims() const':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1183:46: error: 'class octave_value' has no member named 'is_real_nd_array'
} else if (out.is_matrix_type() || out.is_real_nd_array() || out.is_numeric_type() ) {
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: At global scope:
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1742:36: warning: 'Octave_map' is deprecated (declared at /usr/include/octave-3.8.0/octave/oct-map.h:484) [-Wdeprecated-declarations]
virtual Octave_map map_value() const
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1742:24: error: invalid covariant return type for 'virtual Octave_map octave_swig_ref::map_value() const'
virtual Octave_map map_value() const
^
In file included from /usr/include/octave-3.8.0/octave/ov.h:58:0,
from /usr/include/octave-3.8.0/octave/oct-obj.h:34,
from /usr/include/octave-3.8.0/octave/ov-fcn.h:32,
from /usr/include/octave-3.8.0/octave/ov-builtin.h:28,
from /usr/include/octave-3.8.0/octave/defun-int.h:28,
from /usr/include/octave-3.8.0/octave/defun-dld.h:30,
from /usr/include/octave-3.8.0/octave/oct.h:36,
from /builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:154:
/usr/include/octave-3.8.0/octave/ov-base.h:568:22: error: overriding 'virtual octave_map octave_base_value::map_value() const'
virtual octave_map map_value (void) const;
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'void SWIG_Octave_LinkGlobalValue(std::string)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:2052:28: warning: 'static octave_value& symbol_table::varref(const string&, symbol_table::scope_id, symbol_table::context_id, bool)' is deprecated (declared at /usr/include/octave-3.8.0/octave/symtab.h:1322) [-Wdeprecated-declarations]
symbol_table::varref(name);
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'void labelfunc_octave(PLINT, PLFLT, char, PLINT, PLPointer)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:2310:13: warning: unused variable 'i' [-Wunused-variable]
int i;
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'void ct_octave(PLFLT, PLFLT, PLFLT, PLFLT, PLPointer)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:2336:27: warning: unused variable 'i' [-Wunused-variable]
octave_idx_type i;
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'octave_value_list _wrap_plGetCursor(const octave_value_list&, int)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:8412:60: warning: 'octave_value::octave_value(const charMatrix&, bool, char)' is deprecated (declared at /usr/include/octave-3.8.0/octave/ov.h:242) [-Wdeprecated-declarations]
retval4( 0 ) = octave_value( charMatrix( 80, 1 ), true );
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'octave_value_list _wrap_plgdev(const octave_value_list&, int)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:15264:60: warning: 'octave_value::octave_value(const charMatrix&, bool, char)' is deprecated (declared at /usr/include/octave-3.8.0/octave/ov.h:242) [-Wdeprecated-declarations]
retval1( 0 ) = octave_value( charMatrix( 80, 1 ), true );
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'octave_value_list _wrap_plgfnam(const octave_value_list&, int)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:15510:60: warning: 'octave_value::octave_value(const charMatrix&, bool, char)' is deprecated (declared at /usr/include/octave-3.8.0/octave/ov.h:242) [-Wdeprecated-declarations]
retval1( 0 ) = octave_value( charMatrix( 80, 1 ), true );
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'octave_value_list _wrap_plgver(const octave_value_list&, int)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:15793:60: warning: 'octave_value::octave_value(const charMatrix&, bool, char)' is deprecated (declared at /usr/include/octave-3.8.0/octave/ov.h:242) [-Wdeprecated-declarations]
retval1( 0 ) = octave_value( charMatrix( 80, 1 ), true );
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'bool SWIG_Octave_LoadModule(std::string)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21858:5: error: 'begin_frame' is not a member of 'unwind_protect'
unwind_protect::begin_frame("SWIG_Octave_LoadModule");
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21859:35: error: 'unwind_protect_int' was not declared in this scope
unwind_protect_int(error_state);
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21861:47: error: 'unwind_protect_bool' was not declared in this scope
unwind_protect_bool(discard_error_messages);
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21877:5: error: 'run_frame' is not a member of 'unwind_protect'
unwind_protect::run_frame("SWIG_Octave_LoadModule");
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In function 'bool SWIG_Octave_InstallFunction(octave_function, std::string)':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21890:5: error: 'begin_frame' is not a member of 'unwind_protect'
unwind_protect::begin_frame("SWIG_Octave_InstallFunction");
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21891:35: error: 'unwind_protect_int' was not declared in this scope
unwind_protect_int(error_state);
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21893:47: error: 'unwind_protect_bool' was not declared in this scope
unwind_protect_bool(discard_error_messages);
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:21913:5: error: 'run_frame' is not a member of 'unwind_protect'
unwind_protect::run_frame("SWIG_Octave_InstallFunction");
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In member function 'virtual dim_vector octave_swig_type::dims() const':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1200:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: At global scope:
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1859:28: warning: 'octave_value_list octave_set_immutable(const octave_value_list&, int)' defined but not used [-Wunused-function]
static octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) {
^
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:2158:5: warning: 'int _arraylen(const octave_value&)' defined but not used [-Wunused-function]
_arraylen( const octave_value &o_obj )
^
So, it appears that octave 3.8.0 no longer defines OCTAVE_API_VERSION_NUMBER. I've queried the octave developers to see if this is indeed intentional.
No answer yet on OCTAVE_API_VERSION_NUMBER. But even with this set to 49, we get:
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx: In member function 'virtual dim_vector octave_swig_type::dims() const':
/builddir/build/BUILD/plplot-5.9.11/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:1183:46: error: 'class octave_value' has no member named 'is_real_nd_array'
} else if (out.is_matrix_type() || out.is_real_nd_array() || out.is_numeric_type() ) {
^
That function is indeed gone. Current class def is here:
http://octave.sourceforge.net/doxygen/html/d3/d35/classoctave__value.html
Perhaps that will help with finding a replacement.
From John Eaton:
Looking at the 3.6.4 sources, I'm not sure that is_real_nd_array was ever doing anything but returning false. I only see the function in ov.h that forwards to rep, and then generic definition of it in ov-base.h that always returns false. There don't seem to be any other overloads for it.
I guess I would use is_real_type. You should be able to extract an NDArray object from any real-valued object (if not, then that is a bug). In most cases, I'd also recommend that instead of checking the type first, that you just try to extract an NDArray object and then check error_state to see whether it succeeded.
jwe
octave appears to be adverse to re-adding OCTAVE_API_VERSION_NUMBER, so some other solution for that may need to be found.
Why have they dropped OCTAVE_API_VERSION_NUMBER ? It is essential for dealing with changing apis. I don't see how SWIG can support Octave without it.
I recommend not using version numbers to decide which features are available and instead use a configure script that tests for the required features.
jwe
That's the octave comments. There is still the string define OCTAVE_API_VERSION, but I'm not sure one can really deal with that with the pre-processor.
If this is an issue - please make your concerns known to the Octave maintainers. I'm really just a three way middle man at the moment (between plplpot, octave, and swig) as the Fedora packager of plplot and octave.
A version number is not a good choice to deal with changing APIs because it doesn't really tell much about the features available. Octave has many options to disable some of them, so two different systems with the same version may behave differently. Other libraries allow the same
There is also the case of different compatible libraries such as Magick provided by GraphicsMagick and ImageMagick. One can be used in place of the other but by performing checks to version numbers, we'd be limited to only one of them.
There is no configure stage for SWIG to utilise when generating code. If there are C macros in the Octave headers (as a result of an Octave configure) that turn features on and off and they are officially documented, then we can use those. However to deal with changing apis, NOT features, an API version is needed. APIs always change even if not intentional, someone will someday mess up and we will need an API version number to fix these kind of errors.
The string version OCTAVE_API_VERSION is absolutely useless for use by the C preprocessor.
If users of Octave, such as SWIG find the API version number useful, I strongly urge for it to be re-instated. Otherwise I propose dropping support for Octave in SWIG 3.0 as it will taint the SWIG reputation for not working and provide too much of a support burden on SWIG maintainers such as myself. I've started a discussion on the swig-devel mailing list. Please join in. Can someone familiar with Octave please set up a discussion with the Octave maintainers and us SWIG maintainers.
William, if you consider this a bug or regression in Octave, could you please comment on its bug so something can be arranged?
This bug sends email with a reply-to address of 1353@bugs.swig.p.re.sf.net to which the Octave developers have been replying. However, it seems that address is bouncing the emails. Here's what's been said:
By Jordi:
By jwe:
Carnë, I found the discussion on the Octave developers list and have responded now. Thanks for posting the updates.
Support for Octave-3.8.0 added by Karl's commit https://github.com/swig/swig/commit/5b167cc12daf9ea275c17fedaefc975450613ab2 for SWIG 3.0.0. This should fix everything for you.