Arch compile error in Python[ServerFramework|AI].cpp

Questions, problems and discussion about compiling FreeOrion.
Message
Author
Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

Re: Arch compile error in Python[ServerFramework|AI].cpp

#16 Post by Chriss » Mon May 25, 2015 2:29 pm

Actually, This got changed 8 days ago or so by adrian_brother - he added the find_package(PythonInterp REQUIRED) without a version (other similar calls for server and client have the version 2). Maybe that's what broke things for my environment.
Attached patches are released under GPL 2.0 or later.

User avatar
Vezzra
Release Manager, Design
Posts: 4673
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Arch compile error in Python[ServerFramework|AI].cpp

#17 Post by Vezzra » Mon May 25, 2015 3:30 pm

Chriss wrote:Actually, This got changed 8 days ago or so by adrian_brother - he added the find_package(PythonInterp REQUIRED) without a version (other similar calls for server and client have the version 2). Maybe that's what broke things for my environment.
It says "authored on 23 Apr", so that would be a month, not just 8 days ago, but other than that, your guess sounds absolutely reasonable.

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

Re: Arch compile error in Python[ServerFramework|AI].cpp

#18 Post by Chriss » Mon May 25, 2015 4:04 pm

:shock:
oopsie :oops:

Kay, if you could commit that change and the boost 1.58 fix then I can go ahead and migrate the Arch package to Git sometime later this week.
Attached patches are released under GPL 2.0 or later.

User avatar
Vezzra
Release Manager, Design
Posts: 4673
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Arch compile error in Python[ServerFramework|AI].cpp

#19 Post by Vezzra » Mon May 25, 2015 4:23 pm

Chriss wrote:Kay, if you could commit that change and the boost 1.58 fix then I can go ahead and migrate the Arch package to Git sometime later this week.
I want Dilvish to take a look at your fixes before, as that's Linux stuff and I'm not on Linux here - can't test your patches. Dilvish?

User avatar
adrian_broher
Programmer
Posts: 1072
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Arch compile error in Python[ServerFramework|AI].cpp

#20 Post by adrian_broher » Tue May 26, 2015 8:34 am

Chriss
  • What's the output of `python -V`?
  • The boost python library needs to be compiled against a specific version of python. FO requires 2.7. I don't know what Arch provides. Fedora provides both library variants as separate and parallel installable packages, The Debian package allows to link against either python2 or python3.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Dilvish
AI Lead, Programmer
Posts: 4719
Joined: Sat Sep 22, 2012 6:25 pm

Re: Arch compile error in Python[ServerFramework|AI].cpp

#21 Post by Dilvish » Tue May 26, 2015 5:17 pm

Apparently in some systems with both python2 and python3 installed, find_package(PythonInterp) will give 2.7, but find_package(PythonLibs) will find 3.x
See, for example, https://public.kitware.com/Bug/view.php?id=13794

As noted in the above link, this is apparently fixed cmake 3.1, but it may still need attention from us: as described in
https://bugs.debian.org/cgi-bin/bugrepo ... bug=677598 it sounds like the search for PythonLibs can still be a little finicky.

it sounds like probably we should be using

Code: Select all

find_package(PythonInterp 2.7 EXACT)
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

Re: Arch compile error in Python[ServerFramework|AI].cpp

#22 Post by Chriss » Tue May 26, 2015 9:58 pm

adrian_broher wrote:Chriss
  • What's the output of `python -V`?
  • The boost python library needs to be compiled against a specific version of python. FO requires 2.7. I don't know what Arch provides. Fedora provides both library variants as separate and parallel installable packages, The Debian package allows to link against either python2 or python3.

Code: Select all

[chris@desk ~]$ python -V
Python 3.4.3
[chris@desk ~]$ python2 -V
Python 2.7.9
[chris@desk ~]$ cmake --version
cmake version 3.2.2
I don't know any commands to check, but I have seen both of those python versions in cmake output messages, so I suppose that arch's boost:python is available for both.

Regarding EXACT, it seems to be enough to specify 2 to get version 2 and not 3 in my install. 2.7 with or without EXACT yields the same result.
Attached patches are released under GPL 2.0 or later.

Post Reply