Cygwin64 + Octave + Swig

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cygwin64 + Octave + Swig

Brad Bell
I am having some trouble with a very simple swig/octave example on
cygwin 64. To be specific, the example is
     http://www.seanet.com/~bradbell/cppad_swig/swig_xam.i.htm
The souce code for the example can be found at
     https://github.com/bradbell/cppad_swig/tree/master/swig_xam
This example works fine on Fedora 25. It also works, on Cygwin, for
Python and Perl.


If, on Cygwin, I try to compile a swig module with Octave without C++11,
I get the
following error message:
... swig_xamOCTAVE_wrap.cxx:173:
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/bits/c++0x_warning.h:32:2:
error: #error This file requires compiler and library support for the
ISO C++ 2011 standard. This support must be enabled with the
-std=c++11 or -std=gnu++11 compiler options.


If I add -std=c++11 to the compiler options, I get the following error
message:
/usr/include/octave-4.2.0/octave/oct-cmplx.h:100:1: error:
‘M_PI’ was not declared in this scope
...

If in swig_xamOCTAVE_wrap.cxx before including oct.h, I add the code
     # ifndef M_PI
     # define M_PI 3.14159265358979323846
     # endif
I get the error message
... swig_xamOCTAVE_wrap.cxx:2104:46:
error: ‘op_lshift’ is not a member of ‘octave_value’
if
(!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2))



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cygwin64 + Octave + Swig

Brad Bell
The current Cygwin-64 installs octave-4.2.0 while Fedora 25 installs
octave-4.0.3. Looking at swig issue 875
     https://github.com/swig/swig/pull/875
we see the heading
     Octave: add support for version 4.2
Perhaps this is the problem and I should redirect this discussion to
that issue ?

On 02/23/2017 06:46 AM, Brad Bell wrote:

> I am having some trouble with a very simple swig/octave example on
> cygwin 64. To be specific, the example is o
>     http://www.seanet.com/~bradbell/cppad_swig/swig_xam.i.htm
> The souce code for the example can be found at
>     https://github.com/bradbell/cppad_swig/tree/master/swig_xam
> This example works fine on Fedora 25. It also works, on Cygwin, for
> Python and Perl.
>
>
> If, on Cygwin, I try to compile a swig module with Octave without
> C++11, I get the
> following error message:
> ... swig_xamOCTAVE_wrap.cxx:173:
> /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/bits/c++0x_warning.h:32:2:
>
> error: #error This file requires compiler and library support for the
> ISO C++ 2011 standard. This support must be enabled with the
> -std=c++11 or -std=gnu++11 compiler options.
>
>
> If I add -std=c++11 to the compiler options, I get the following error
> message:
> /usr/include/octave-4.2.0/octave/oct-cmplx.h:100:1: error:
> ‘M_PI’ was not declared in this scope
> ...
>
> If in swig_xamOCTAVE_wrap.cxx before including oct.h, I add the code
>     # ifndef M_PI
>     # define M_PI 3.14159265358979323846
>     # endif
> I get the error message
> ... swig_xamOCTAVE_wrap.cxx:2104:46:
> error: ‘op_lshift’ is not a member of ‘octave_value’
> if
> (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2))
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cygwin64 + Octave + Swig

William S Fulton
Octave 4.2 support works with swig-3.0.12 and was tested using Ubuntu and hence that issue is closed. Have you tried #include <math.h>?  Try to reduce the generated wrappers to an absolute minimum and if it is a problem in the octave cygwin headers, then contact the Octave or cygwin mailing lists for support.

William

On 26 February 2017 at 12:19, Brad Bell <[hidden email]> wrote:
The current Cygwin-64 installs octave-4.2.0 while Fedora 25 installs
octave-4.0.3. Looking at swig issue 875
     https://github.com/swig/swig/pull/875
we see the heading
     Octave: add support for version 4.2
Perhaps this is the problem and I should redirect this discussion to
that issue ?

On 02/23/2017 06:46 AM, Brad Bell wrote:
> I am having some trouble with a very simple swig/octave example on
> cygwin 64. To be specific, the example is o
>     http://www.seanet.com/~bradbell/cppad_swig/swig_xam.i.htm
> The souce code for the example can be found at
>     https://github.com/bradbell/cppad_swig/tree/master/swig_xam
> This example works fine on Fedora 25. It also works, on Cygwin, for
> Python and Perl.
>
>
> If, on Cygwin, I try to compile a swig module with Octave without
> C++11, I get the
> following error message:
> ... swig_xamOCTAVE_wrap.cxx:173:
> /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/c++/bits/c++0x_warning.h:32:2:
>
> error: #error This file requires compiler and library support for the
> ISO C++ 2011 standard. This support must be enabled with the
> -std=c++11 or -std=gnu++11 compiler options.
>
>
> If I add -std=c++11 to the compiler options, I get the following error
> message:
> /usr/include/octave-4.2.0/octave/oct-cmplx.h:100:1: error:
> ‘M_PI’ was not declared in this scope
> ...
>
> If in swig_xamOCTAVE_wrap.cxx before including oct.h, I add the code
>     # ifndef M_PI
>     # define M_PI 3.14159265358979323846
>     # endif
> I get the error message
> ... swig_xamOCTAVE_wrap.cxx:2104:46:
> error: ‘op_lshift’ is not a member of ‘octave_value’
> if
> (!octave_value_typeinfo::lookup_binary_op(octave_value::op_##name,tid1,tid2))
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cygwin64 + Octave + Swig

Brad Bell
Reverting to Octave-4.0.1-2 worked for my test cases; see the heading check on
    http://www.seanet.com/~bradbell/cppad_swig/testing.htm#check

The most recent version of Swig currently available using the Cygwin setup program is 3.0.11-1. I will make a note to try Octave 4.2 once new newer version of Swig becomes available on Cygwin.

Thanks.


On 02/27/2017 01:52 PM, William S Fulton wrote:
Octave 4.2 support works with swig-3.0.12 and was tested using Ubuntu and hence that issue is closed. Have you tried #include <math.h>?  Try to reduce the generated wrappers to an absolute minimum and if it is a problem in the octave cygwin headers, then contact the Octave or cygwin mailing lists for support.

William

On 26 February 2017 at 12:19, Brad Bell <[hidden email]> wrote:
The current Cygwin-64 installs octave-4.2.0 while Fedora 25 installs
octave-4.0.3. Looking at swig issue 875
     https://github.com/swig/swig/pull/875
we see the heading
     Octave: add support for version 4.2
Perhaps this is the problem and I should redirect this discussion to
that issue ?

... snip ...

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...