Fedora 30 - python3 migration compilation issue

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Post Reply
Message
Author
Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Fedora 30 - python3 migration compilation issue

#1 Post by Ophiuchus »

Still do not have a working local setup since the switch to python3.

I installed dev headers and executables for python3 and boost-python3, made python3 the default python and gave cmake the python3 links to the includes and libs.
In the final linking it can not find PyErr_ExceptionMatches.

Code: Select all

[ 61%] Linking CXX executable freeoriond
/usr/bin/ld: CMakeFiles/freeoriond.dir/python/CommonFramework.cpp.o: undefined reference to symbol 'PyErr_ExceptionMatches'
/usr/bin/ld: //usr/lib64/libpython3.7m.so.1.0: error adding symbols: DSO missing from command line
Not sure where to look, include and library dirs look fine.

Code: Select all

$ python -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())" ; python -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
/usr/include/python3.7m
/usr/lib64
$ find /usr/include/python3.7m/ -iname "*.h*" -exec grep PyErr_ExceptionMatches {} \+ 
/usr/include/python3.7m/pyerrors.h:PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

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

Re: Fedora 30 - python3 migration compilation issue

#2 Post by adrian_broher »

Did you build from a new build tree?

Why did you pass the header and library locations manually?
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Fedora 30 - python3 migration compilation issue

#3 Post by Ophiuchus »

adrian_broher wrote: Fri Apr 10, 2020 2:10 pm Did you build from a new build tree?
Yes, fresh build tree.
adrian_broher wrote: Fri Apr 10, 2020 2:10 pm Why did you pass the header and library locations manually?
Because beforehand it found the python 2 libs etc when it shouldn't. Then I googled that boost sometimes does not find the right paths. So I set them manually. But I think at that point in time I guess I did not have all necessary libs/headers in place.

I now did again a fresh build tree without manually setting the paths, .. and now also linking went fine. Now I can sink my precious time into development again :D
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply