compile with py3 and Qt5 on Debian Stretch

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
bernd
Posts: 8247
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Sun Nov 25, 2018 9:15 am

my code:

Code: Select all

#!/bin/bash

apt-get install python-dbg python-pyside2.qtopengl python-setuptools python3-dbg python3-numpy python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtopengl python3-pyside2.qtwidgets python3-setuptools libsoqt4-dev  libsimage-dev

rm -rf mypivy
mkdir mypivy
cd mypivy/

git clone https://salsa.debian.org/kkremitzki-guest/pivy
cd pivy
git archive upstream | gzip > ../pivy_0.6.4.orig.tar.gz
dpkg-buildpackage -us -uc


the error:

Code: Select all

$
$ sudo bash /vagrant/py3pivy.sh 
Cloning into 'pivy'...
warning: redirecting to https://salsa.debian.org/kkremitzki-guest/pivy.git/
remote: Enumerating objects: 5731, done.
remote: Counting objects: 100% (5731/5731), done.
remote: Compressing objects: 100% (1683/1683), done.
remote: Total 5731 (delta 3882), reused 5707 (delta 3859)
Receiving objects: 100% (5731/5731), 14.67 MiB | 928.00 KiB/s, done.
Resolving deltas: 100% (3882/3882), done.
fatal: Not a valid object name
dpkg-buildpackage: info: source package pivy
dpkg-buildpackage: info: source version 0.6.4-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Kurt Kremitzki <kurt@kwk.systems>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
dpkg-source: info: using options from pivy/debian/source/options: --compression=bzip2 --compression-level=9 --single-debian-patch
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying fix_python_modules.patch
 debian/rules clean
dh clean --with python2,python3 --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
I: pybuild base:217: python3.6 setup.py clean 
running clean
Cleaning headers:.
removing '/home/vagrant/build_FC/pivy/.pybuild/cpython3_3.6_pivy/build' (and everything under it)
'build/bdist.linux-amd64' does not exist -- can't clean it
'build/scripts-3.6' does not exist -- can't clean it
I: pybuild base:217: python2.7 setup.py clean 
running clean
Cleaning headers:.
removing '/home/vagrant/build_FC/pivy/.pybuild/cpython2_2.7_pivy/build' (and everything under it)
'build/bdist.linux-amd64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
I: pybuild base:217: python3.6-dbg setup.py clean 
running clean
Cleaning headers:.
removing '/home/vagrant/build_FC/pivy/.pybuild/cpython3_3.6_dbg_pivy/build' (and everything under it)
'build/bdist.linux-amd64' does not exist -- can't clean it
'build/scripts-3.6' does not exist -- can't clean it
I: pybuild base:217: python2.7-dbg setup.py clean 
running clean
Cleaning headers:.
removing '/home/vagrant/build_FC/pivy/.pybuild/cpython2_2.7_dbg_pivy/build' (and everything under it)
'build/bdist.linux-amd64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 dpkg-source -b .
dpkg-source: info: using options from pivy/debian/source/options: --compression=bzip2 --compression-level=9 --single-debian-patch
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building pivy using existing ./pivy_0.6.4.orig.tar.gz
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
dpkg-source: error: tar -xf - --no-same-permissions --no-same-owner subprocess returned exit status 2
dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit status 2
$ 
$ 
User avatar
kkremitzki
Posts: 1679
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile with py3 and Qt5 on Debian Stretch

Postby kkremitzki » Sun Nov 25, 2018 10:06 am

Ah, it looks like this is the difference between git clone and gbp clone which is what I actually use. git clone does not check out the upstream and pristine-tar branches automatically, so you should be able to amend the script by:

Code: Select all

git archive remotes/origin/upstream
instead of just referring to it as upstream.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
bernd
Posts: 8247
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Sun Nov 25, 2018 11:25 am

GReat !

It is possible without creating the deb too: https://forum.freecadweb.org/viewtopic. ... 89#p270460
User avatar
bernd
Posts: 8247
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Thu Nov 29, 2018 11:38 am

User avatar
bernd
Posts: 8247
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Thu Nov 29, 2018 1:02 pm

How do I tell FreeCADs cmake to use Python3 instead of Python2 ?
wmayer
Site Admin
Posts: 14645
Joined: Thu Feb 19, 2009 10:32 am

Re: compile with py3 and Qt5 on Debian Stretch

Postby wmayer » Thu Nov 29, 2018 2:27 pm

Run cmake configure once and then change the Python executable to python3. Rerun configure and check the other Python variables, they should point to py3 specific stuff now.
User avatar
bernd
Posts: 8247
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Thu Nov 29, 2018 9:30 pm

I'm not really able to solve this Werner ...
kkremitzki wrote:
Tue Nov 20, 2018 10:46 pm
bernd wrote:
Tue Nov 20, 2018 10:42 pm
I havae problems with Qt5 on Debian Buster ...
Can you try adding -DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" to your cmake flags?
This does not work on Python3. Means if I use 3.6 instead of 2.7 the errors do not vanish like for 2.7
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: compile with py3 and Qt5 on Debian Stretch

Postby triplus » Thu Nov 29, 2018 11:57 pm

bernd wrote:
Thu Nov 29, 2018 9:30 pm
This does not work on Python3. Means if I use 3.6 instead of 2.7 the errors do not vanish like for 2.7
Such suffix can be useful for creating Py2/Qt5 FreeCAD build. If you are after Py3/Qt5 build you will need to change the suffix to look for Py3 libraries. For example on Ubuntu 16.04:

Py2/Qt5:

Code: Select all

python2.7-x86_64-linux-gnu
Py3/Qt5:

Code: Select all

.cpython-35m-x86_64-linux-gnu
https://forum.freecadweb.org/viewtopic. ... 50#p208325

Image

https://forum.freecadweb.org/viewtopic. ... 10#p238646
wmayer
Site Admin
Posts: 14645
Joined: Thu Feb 19, 2009 10:32 am

Re: compile with py3 and Qt5 on Debian Stretch

Postby wmayer » Fri Nov 30, 2018 8:55 am

bernd wrote:
Thu Nov 29, 2018 9:30 pm
I'm not really able to solve this Werner ...
kkremitzki wrote:
Tue Nov 20, 2018 10:46 pm
bernd wrote:
Tue Nov 20, 2018 10:42 pm
I havae problems with Qt5 on Debian Buster ...
Can you try adding -DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" to your cmake flags?
This does not work on Python3. Means if I use 3.6 instead of 2.7 the errors do not vanish like for 2.7
Which errors?
Note, that with recent commits from Wednesday it should now work that CMake determines itself the variable PYTHON_CONFIG_SUFFIX. Therefore it reads in Shiboken2Config.cmake which internally sets PYTHON_CONFIG_SUFFIX to an inappropriate value. Afterwards from the given path of the config file CMake searches for further config files which has .cpython<PYTHON_VERSION> in its name and if it has found one it determines the correct value of PYTHON_CONFIG_SUFFIX and then re-reads Shiboken2Config.cmake.

You can check if the procedure succeeded by looking at the CMake output. You should find a line of the form: PYTHON_CONFIG_SUFFIX: ...
git commit 1dded002ca
wmayer
Site Admin
Posts: 14645
Joined: Thu Feb 19, 2009 10:32 am

Re: compile with py3 and Qt5 on Debian Stretch

Postby wmayer » Fri Nov 30, 2018 9:04 am