Python make errors

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).

Python make errors

Postby segfault » Sat Oct 27, 2012 10:26 pm

Hey there, just trying to compile on Arch from latest SVN (revision 13423) and getting the following out of cmake:
Code: Select all
In file included from /home/luke/Src/VegaStrike/vegastrike/src/cmd/ai/aggressive.cpp:24:0:
/home/luke/Src/VegaStrike/vegastrike/src/vs_random.h: In member function 'unsigned int VSRandom::genrand_int32()':
/home/luke/Src/VegaStrike/vegastrike/src/vs_random.h:132:57: warning: narrowing conversion of 'VSRandom::MATRIX_A()' from 'int' to 'unsigned int' inside { } is ill-formed in C++11 [-Wnarrowing]
In file included from /home/luke/Src/VegaStrike/vegastrike/src/cmd/ai/aggressive.cpp:25:0:
/home/luke/Src/VegaStrike/vegastrike/src/python/python_compile.h: In member function 'PyObject* PythonBasicType::NewObject() const':
/home/luke/Src/VegaStrike/vegastrike/src/python/python_compile.h:43:57: error: 'PyString_FromString' was not declared in this scope
/home/luke/Src/VegaStrike/vegastrike/src/cmd/ai/aggressive.cpp: In member function 'bool Orders::AggressiveAI::ProcessCurrentFgDirective(Flightgroup*)':
/home/luke/Src/VegaStrike/vegastrike/src/cmd/ai/aggressive.cpp:759:22: warning: unused variable 'callme' [-Wunused-variable]
make[2]: *** [CMakeFiles/engine_com.dir/src/cmd/ai/aggressive.o] Error 1
make[1]: *** [CMakeFiles/engine_com.dir/all] Error 2
make: *** [all] Error 2



Looking online a bit I found that in the new Python3 PyString_FromString() call seems to have been replaced by PyBytes_FromString() according to this post:
https://github.com/OpenImageIO/oiio/issues/197

A quick grep of the source shows the depricated call being used in other files as well. Just wondering if I should sumbit this as a bug and work on fixing it or do I just have an incorrect version of python?
I am running Python 3.3.0-1 it looks like.

I also just hit another error also linked to python it looks like;

Code: Select all
/home/luke/Src/VegaStrike/vegastrike/src/python/python_compile.cpp: In function 'void CompileRunPython(const string&)':
/home/luke/Src/VegaStrike/vegastrike/src/python/python_compile.cpp:85:84: error: cannot convert 'PyCodeObject*' to 'PyObject* {aka _object*}' for argument '1' to 'PyObject* PyEval_EvalCode(PyObject*, PyObject*, PyObject*)'
make[2]: *** [CMakeFiles/engine_com.dir/src/python/python_compile.o] Error 1
make[1]: *** [CMakeFiles/engine_com.dir/all] Error 2
make: *** [all] Error 2


Will dig into this error a little as well.
Thanks.
User avatar
segfault
Merchant
Merchant
 
Posts: 39
Topics: 2
Joined: Mon Aug 16, 2010 8:50 pm
Location: Ottawa, Canada

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Python make errors

Postby klauss » Sat Oct 27, 2012 10:58 pm

That's because you're building against python3. We don't support python3 yet.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Python make errors

Postby segfault » Sat Oct 27, 2012 11:00 pm

perfect, will downgrade.

Thanks for the quick reply... you are a machine, Klauss.
User avatar
segfault
Merchant
Merchant
 
Posts: 39
Topics: 2
Joined: Mon Aug 16, 2010 8:50 pm
Location: Ottawa, Canada

Re: Python make errors

Postby segfault » Sat Oct 27, 2012 11:07 pm

..... do we want to support Python3?
Wonder how much work it would be to convert.
User avatar
segfault
Merchant
Merchant
 
Posts: 39
Topics: 2
Joined: Mon Aug 16, 2010 8:50 pm
Location: Ottawa, Canada

Re: Python make errors

Postby loki1950 » Sun Oct 28, 2012 8:53 am

Going to have too before too long ;) BTW you did not need to down grade from 3 you just needed to install 2.6 and the relevant dev libraries.


Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 18/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and DELL E6400 4GB ram/100 GB HD Mint 17.3 6
User avatar
loki1950
The Shepherd
 
Posts: 5708
Topics: 51
Joined: Fri May 13, 2005 1:37 pm
Location: Ottawa

Re: Python make errors

Postby segfault » Sun Oct 28, 2012 3:12 pm

Ah, thanks. Good to know.
User avatar
segfault
Merchant
Merchant
 
Posts: 39
Topics: 2
Joined: Mon Aug 16, 2010 8:50 pm
Location: Ottawa, Canada

Re: Python make errors

Postby klauss » Sun Oct 28, 2012 5:57 pm

segfault wrote:..... do we want to support Python3?
Wonder how much work it would be to convert.


Well, I'm pretty sure most of our python code won't work in python3, so we'd have to stick to one version or carry multiple versions of the code. I'm leaning towards the first, but we can't stick to 3 just yet, it'd make it harder for the folks running old distros.

I'm not sure we can make our python code work with both versions. So, until distributions start pushing py3 as default, I'd stick with py2.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Python make errors

Postby nanite » Tue Nov 13, 2012 2:49 am

Just to follow up on this... Since the prebuilt Ubuntu 12.04 package isn't compatible with the current Ubuntu (12.10) I decided to try to compile it. I initially got the same error as the original poster.

I noticed that the CMake spits out the following:
Code: Select all
Found PythonLibs: /usr/lib/python3.2/config/libpython3.2.so (found version "2.7.3")


If python3-dev happens to be installed then it's even worse:
Code: Select all
Found PythonLibs: /usr/lib/libpython3.2mu.so (found version "3.2.3")

So as the original poster indicated, it is probably necessary to totally deinstall python 3 to get the Cmake script to see python 2.7.


The ./configure script however seems to find python 2.7 correctly, ignoring python 3. The following is the output of grep -i python config.log
Code: Select all
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
| #define BOOST_PYTHON_NO_PY_SIGNATURES 1
| #define BOOST_PYTHON_STATIC_LIB 1
configure:18031: Compiling with CPPFLAGS: -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I$(top_srcdir)/$(BOOSTDIR)/1_45    -DHAVE_SDL=1 -DSDL_WINDOWING=1      -DHAVE_AL=1   -DHAVE_OGG  -DNV_CUBE_MAP=1 -DHAVE_FFMPEG -D__STDC_CONSTANT_MACROS  -I/usr/include/python2.7 -DHAVE_PYTHON=1    -I$(top_srcdir)/src .
configure:18035: Compiling with LIBS:    -lvorbisfile -lvorbis -logg   -L/usr/lib/x86_64-linux-gnu -lSDL  -lGL  -lGLU -lXmu -lXi  -lglut  -lexpat  -lpng  -ljpeg  -lopenal  -lvorbisfile -lvorbis -logg  -lavcodec -lavformat -lavutil -lswscale -L/usr/lib -lpython2.7 -Xlinker -export-dynamic -pthread .
BOOST_CPPFLAGS='-DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I$(top_srcdir)/$(BOOSTDIR)/1_45'
CPPFLAGS='-DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I$(top_srcdir)/$(BOOSTDIR)/1_45    -DHAVE_SDL=1 -DSDL_WINDOWING=1      -DHAVE_AL=1   -DHAVE_OGG  -DNV_CUBE_MAP=1 -DHAVE_FFMPEG -D__STDC_CONSTANT_MACROS  -I/usr/include/python2.7 -DHAVE_PYTHON=1    -I$(top_srcdir)/src '
LIBS='   -lvorbisfile -lvorbis -logg   -L/usr/lib/x86_64-linux-gnu -lSDL  -lGL  -lGLU -lXmu -lXi  -lglut  -lexpat  -lpng  -ljpeg  -lopenal  -lvorbisfile -lvorbis -logg  -lavcodec -lavformat -lavutil -lswscale -L/usr/lib -lpython2.7 -Xlinker -export-dynamic -pthread '
PYTHON_CPPFLAGS=' -I/usr/include/python2.7 -DHAVE_PYTHON=1 '
PYTHON_LIBS='-L/usr/lib -lpython2.7 -Xlinker -export-dynamic'
#define BOOST_PYTHON_NO_PY_SIGNATURES 1
#define BOOST_PYTHON_STATIC_LIB 1



And one final unrelated thing, I found that I had to install the following to make CMake happy, in addition to the things mentioned on the wiki page http://wiki.vega-strike.org/HowTo:Compile_from_SVN
Code: Select all
apt-get install libavcodec-dev libavformat-dev libavutil-dev  libogre-dev  libswscale-dev
nanite
Insys Pilot
Insys Pilot
 
Posts: 2
Joined: Tue Nov 13, 2012 2:15 am

Re: Python make errors

Postby nanite » Tue Nov 13, 2012 2:51 am

Ah but to follow up to the last message, now I get this error during the make:
Code: Select all
./src/resizable.h:19:9: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

Never mind, I just should have done ./configure --enable-permissive as explained in this other thread http://forums.vega-strike.org/viewtopic.php?f=5&t=18164
nanite
Insys Pilot
Insys Pilot
 
Posts: 2
Joined: Tue Nov 13, 2012 2:15 am

Re: Python make errors

Postby klauss » Tue Nov 13, 2012 5:47 am

I see. We have to fix our configure scripts to let them know py3 is no good.

Notice tough that we do have 12.10 builds now. I'll update the 0.5.1 announcement with a link to them.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Python make errors

Postby shahidjee » Thu Jan 24, 2013 3:35 am

Thats why I decided to use the ifdef. The server code doesn't need sound event while the client does. Though I wrongly assumed that the CLIENT define from my earlier win32 code would have also been used for all OSes. I can add the required files into the win32 build but I don't see any real need for it to be there on any build since the server does use sound events. Same for a lot of things. Doesn't need to render anything or use any shaders.. no need for sound, though it may need mesh code if it does any collision testing (and it has access to a collision mesh).

*EDIT* Anyone else find their threads hijacked by new users?
shahidjee
Atmospheric Pilot
Atmospheric Pilot
 
Posts: 1
Joined: Thu Jan 24, 2013 3:32 am

Re: Python make errors

Postby klauss » Thu Jan 24, 2013 9:20 am

This seems to be on the wrong topic. But, in any case, please notice SoundContainer contains no sound in itself, and the instance of SoundContainer created in the server is pretty much empty. If that is undesirable, we discussed a way to get around even that with pheonixstorm, I'd have to dig the conversation up. I don't think it's worth it, they only exist for the player.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Python make errors

Postby Eutrot » Sat Feb 16, 2013 4:27 pm

Actually, using ccmake resolves the problem without removing python3 from the system.

I experienced the same error (PyString_FromString not found during compilation). I am running Debian Wheezy and have Python3 installed.

I have used the procedure recommended here : http://wiki.vega-strike.org/HowTo:Compile_from_SVN.

However when running ccmake, after pressing "c" to autoconfigure :
- I pressed "t" to toggle advanced mode,
- then I scrolled to the options PYTHON_INCLUDE_DIR and PYTHON_LIBRARY, which were set to Python3 paths,
- I set them respectively to /usr/include/python2.7 and /usr/lib/libpython2.7.a
- I pressed "c" again, then "g".

Then I could compile Vega Strike with make without any error.
Eutrot
Insys Pilot
Insys Pilot
 
Posts: 2
Joined: Sat Feb 16, 2013 3:16 pm

Re: Python make errors

Postby loki1950 » Sat Feb 16, 2013 5:56 pm

Welcome aboard Eutrot that's a simple workaround that keeps things whole in system land :)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 18/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and DELL E6400 4GB ram/100 GB HD Mint 17.3 6
User avatar
loki1950
The Shepherd
 
Posts: 5708
Topics: 51
Joined: Fri May 13, 2005 1:37 pm
Location: Ottawa

Re: Python make errors

Postby Eutrot » Sat Feb 16, 2013 7:07 pm

Thank you Loki. I suppose that's just what ccmake is for...
Eutrot
Insys Pilot
Insys Pilot
 
Posts: 2
Joined: Sat Feb 16, 2013 3:16 pm

Re: Python make errors

Postby klauss » Sat Feb 16, 2013 7:36 pm

Yes. You ought to be able to do a similar thing in autotools land with configure --with-python=2.7
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina



Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 1 guest