I have been trying to compile FreeCAD master and the Realthunder branch on an Ubuntu system. I can successfully build both with Python 3.6, but not 3.7.
For one thing, Cmake seems to recognize both the Python 3.7 installation I specify on the command line and a Python 2.7 one I didn't. I have installed the shiboken2 packages from Ubuntu.
Then I get errors that Shiboken2 wants to link to Python 2.7 symbols, which aren't there. Do I need to get shiboken2 for Python 3.7 somewhere?
Thank you!
Compiling on Ubuntu: Shiboken2 problems
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- kkremitzki
- Veteran
- Posts: 2517
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Compiling on Ubuntu: Shiboken2 problems
You didn't specify which particular Ubuntu version you're on nor the CMake flags you used which would be helpful.
You have both Python 3.6 and 3.7 on the same system? Is one a custom installation? If so, everything in FreeCAD's dependency chain which is linked against Python needs to be rebuilt to link to your custom Python.
Regardless of whether newer Ubuntus have Python 3.6 or 3.7, both work, so it's not a problem with a particular Python version.
For those, if you're on Ubuntu 18.04 or newer, it should be sufficient to call CMake just with
You have both Python 3.6 and 3.7 on the same system? Is one a custom installation? If so, everything in FreeCAD's dependency chain which is linked against Python needs to be rebuilt to link to your custom Python.
Regardless of whether newer Ubuntus have Python 3.6 or 3.7, both work, so it's not a problem with a particular Python version.
For those, if you're on Ubuntu 18.04 or newer, it should be sufficient to call CMake just with
Code: Select all
cmake ../freecad -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3
Re: Compiling on Ubuntu: Shiboken2 problems
I'm using 18.04 and Python 3.5,3.6 and 3.7 from the official Ubuntu repositories.
I now that I have to have shiboken2 for python3.7 in some form ... I had hoped someone would tell me how. Also I don't know why cmake still wants to link Python 2.7...
Specifying python3 is not sufficient, because that's linked to 3.6.
I've figured out by now that the pytho3.7 stuff doesn't have shiboken2 from the repositories, so I'm going to install that manually.
I now that I have to have shiboken2 for python3.7 in some form ... I had hoped someone would tell me how. Also I don't know why cmake still wants to link Python 2.7...
Specifying python3 is not sufficient, because that's linked to 3.6.
Code: Select all
cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.7m -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m/ -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so -DFREECAD_USE_EXTERNAL_SMESH=OFF ../freecad-source/
Code: Select all
==============
Summary report
==============
-- Build type:
-- Python: [/usr/bin/python3.7m] [-python2.7.x86_64-linux-gnu]
-- PCL: not enabled
-- pybind11: not enabled
- kkremitzki
- Veteran
- Posts: 2517
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Compiling on Ubuntu: Shiboken2 problems
On Ubuntu 16.04 I also have to include PYTHON_BASENAME and PYTHON_SUFFIX flags, so maybe adding those in this format would help:
https://salsa.debian.org/science-team/f ... /rules#L33
(DEB_HOST_MULTIARCH is for example x86_64-linux-gnu)
https://salsa.debian.org/science-team/f ... /rules#L33
(DEB_HOST_MULTIARCH is for example x86_64-linux-gnu)
Re: Compiling on Ubuntu: Shiboken2 problems
whenever I scan some output with that package name it always reads as shitbroken2 , rather unfortunate naming.
On Fedora30
On Fedora30
Code: Select all
python3 -V
Python 3.7.5