octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building pytave on windows


From: Abhinav Tripathi
Subject: Re: Building pytave on windows
Date: Wed, 10 May 2017 10:34:11 +0530

On Tue, May 9, 2017 at 8:21 PM, Mike Miller <address@hidden> wrote:
On Tue, May 09, 2017 at 15:33:54 +0530, Abhinav Tripathi wrote:
> Reading through earlier conversations on the mailing list, I have reached
> upto a point.. And now I am getting the following error:
[…]
> In file included from
> c:\octave\octave-4.2.0\lib\gcc\x86_64-w64-mingw32\4.9.4\include\c++\complex:44:0,
>                  from oct-py-types.h:27,
>                  from oct-py-error.cc:33:
> c:\octave\octave-4.2.0\lib\gcc\x86_64-w64-mingw32\4.9.4\include\c++\cmath:1123:11:
> error: '::hypot' has not been declared
>    using ::hypot;
>            ^

I think this is a bug in the Python header files, which are probably not
extensively tested against building Python extensions under MinGW, even
less so using a GCC with C++11 support.

Python's pyconfig.h does the following on Windows systems

    #if defined(__GNUC__) && defined(_WIN32)
    …
    #define hypot _hypot
    …
    #endif /* GNUC */

Try adding a `#undef hypot` immediately after every `#include
<Python.h>`. You may have to add this to every .cc file.

If that fixes the error we can add something to work around this.

There are some others looking at fixing this in Python upstream

  https://bugs.python.org/issue11566
  https://github.com/python/cpython/pull/880

Undefining hypot didn't fix the problem. But, as suggested on the python's issue page, including cmath before Python.h did the trick.
The build completed successfully!!
.
BUT, when I open octave and cd to pyatve's directory, it says that pycall, pyexec, pyeval all these are undefined!!
Moreover, if instead of cding, if I just do addpath for pytave then I got a lot of warnings due to PKG_ADD.
I do not have proper experience with oct files, but I tried the following, out of which nothing worked:
.
-- I saw that the files are named *.oct.exe while in PKG_ADD the names are only *.oct 
     So, I renamed the files to remove .exe from file names. Now, I added pytave to path in octave and there was no warning but still all the functions are undefined.
-- I edited PKG_ADD to include .exe in the end of .oct but now I get syntax error in the .oct.exe file which can be seen here:
***********************************************************************
>> addpath 'D:/repos/pytave'
>> py.int
parse error near line 1 of file D:/repos/pytave\pycall.oct.exe

  syntax error

>>> MZ�
      ^

error: called from
    subsref at line 49 column 9
***********************************************************************

I am guessing second approach is right but the problem is related to how oct files are created on windows. Again, I have no knowledge of how oct files are created/called so any insight is welcome...
.
Also, I get similar syntax error when I try to rmpath pytave and am not able to remove pytave from path. I think atleast this is a bug in how oct files are handled.
.
.
Just a side note, I saw that octave 4.2.1 is available for windows so I used that this time, just to use the latest version of things.
 
> To get around python extra libs problem, do "export PYTHON_EXTRA_LIBS=-g"
> as suggested by Mike earlier

I had forgotten about this issue, can you report it on the tracker?

--
mike

Done.
.

Regards,
Abhinav 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]