compile with py3 and Qt5 on Debian Stretch

Having trouble installing or compiling FreeCAD? Get help here.
user1234
Posts: 190
Joined: Mon Jul 11, 2016 5:08 pm

Re: compile with py3 and Qt5 on Debian Stretch

Postby user1234 » Mon Nov 19, 2018 7:53 pm

I have made two scrips. One for fresh compile from git and one for refresh.

makefresh.sh

Code: Select all

git clone https://github.com/FreeCAD/FreeCAD.git sourcecode
cmake \
-DCMAKE_CXX_COMPILER="/usr/bin/mpic++" \
-DCMAKE_CXX_FLAGS="-I/usr/include/hdf5/openmpi -I/usr/include/mpi" \
-DBUILD_ENABLE_CXX_STD=C++17 \
-DBUILD_QT5=1 \
-DBUILD_WEB=0 \
-DCMAKE_BUILD_TYPE=DebWithRelInfo \
-DFREECAD_BUILD_DEBIAN=1 \
-DFREECAD_USE_OCC_VARIANT="Official Version" \
-DFREECAD_USE_PYBIND11=1 \
-DFREECAD_USE_QTFILEDIALOG=1 \
-DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" \
sourcecode
make -j6
and

refresh.sh

Code: Select all

cd sourcecode
git pull
cd ..
cmake \
-DCMAKE_CXX_COMPILER="/usr/bin/mpic++" \
-DCMAKE_CXX_FLAGS="-I/usr/include/hdf5/openmpi -I/usr/include/mpi" \
-DBUILD_ENABLE_CXX_STD=C++17 \
-DBUILD_QT5=1 \
-DBUILD_WEB=0 \
-DCMAKE_BUILD_TYPE=DebWithRelInfo \
-DFREECAD_BUILD_DEBIAN=1 \
-DFREECAD_USE_OCC_VARIANT="Official Version" \
-DFREECAD_USE_PYBIND11=1 \
-DFREECAD_USE_QTFILEDIALOG=1 \
-DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" \
sourcecode
make -j6
But sometimes, CMake had troubles to find the Qt5 dependencies. Then you have so seach on the computer, where the right folders are. Then you have to write it per hand in the CMake. But when i right remember, on Debian 9 there where much more dependencies. And sometimes when you set Qt5=1, then CMake added regardless Qt4 folders in the CMake.
CMake.png
CMake.png (184.33 KiB) Viewed 735 times
Greetings
user

edit: f3nix was faster .....
User avatar
kkremitzki
Posts: 1795
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile with py3 and Qt5 on Debian Stretch

Postby kkremitzki » Mon Nov 19, 2018 8:02 pm

You can refer to the Debian packaging for a basic Qt5 build: https://salsa.debian.org/science-team/freecad

Build steps
https://salsa.debian.org/science-team/f ... bian/rules

Dependencies
https://salsa.debian.org/science-team/f ... an/control

Right now all you need to build Qt5 + Py3 on Debian Buster is a python3-pivy package. You can refer to my package for that here: https://salsa.debian.org/kkremitzki-guest/pivy

Right now I am coordinating with 2 other Debian people on uploading new versions of Coin and SoQt, upon which Pivy depends, once that is taken care of it should be possible to build on testing just by specifying the right build flags.

Edit: The new coin upload is at https://tracker.debian.org/pkg/coin3, it's available in Debian Experimental: 4.0.0~CMake~6f54f1602475+ds1-1~exp1
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: 8475
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Mon Nov 19, 2018 8:54 pm

wow cool guy lots of stuff.

BTW @Kurt it does make sense to add Gmsh to the recommended packages too. It is needed to mesh in FEM as an addition to Netgen. Some FEM mesh tools does even only work with Gmsh.
User avatar
f3nix
Posts: 299
Joined: Sat May 30, 2015 11:58 am

Re: compile with py3 and Qt5 on Debian Stretch

Postby f3nix » Mon Nov 19, 2018 9:02 pm

gmsh is broken in debian testing and sid. It cannot be used inside FreeCAD.

@kkremitzki any update on https://bugs.debian.org/cgi-bin/bugrepo ... bug=904946 ?

Cheers,
Mateusz
user1234
Posts: 190
Joined: Mon Jul 11, 2016 5:08 pm

Re: compile with py3 and Qt5 on Debian Stretch

Postby user1234 » Mon Nov 19, 2018 9:13 pm

vtk7.1.1-dev is also broken on testing.
Jee-Bee
Posts: 1968
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: compile with py3 and Qt5 on Debian Stretch

Postby Jee-Bee » Mon Nov 19, 2018 9:29 pm

why not vtk 8??
user1234
Posts: 190
Joined: Mon Jul 11, 2016 5:08 pm

Re: compile with py3 and Qt5 on Debian Stretch

Postby user1234 » Mon Nov 19, 2018 9:38 pm

Is not on debian testing.
Greetings
User avatar
kkremitzki
Posts: 1795
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile with py3 and Qt5 on Debian Stretch

Postby kkremitzki » Mon Nov 19, 2018 10:12 pm

f3nix wrote:
Mon Nov 19, 2018 9:02 pm
gmsh is broken in debian testing and sid. It cannot be used inside FreeCAD.

@kkremitzki any update on https://bugs.debian.org/cgi-bin/bugrepo ... bug=904946 ?

Cheers,
Mateusz
I have Gmsh 4 packaged which seems to resolve the issue, but it may be a while before it's available, can you try to use the package from the Community Extras PPA? https://launchpad.net/~freecad-communit ... ubuntu/ppa

The build recipe is here if you want to try that: https://salsa.debian.org/kkremitzki-guest/gmsh
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
kkremitzki
Posts: 1795
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile with py3 and Qt5 on Debian Stretch

Postby kkremitzki » Mon Nov 19, 2018 10:13 pm

bernd wrote:
Mon Nov 19, 2018 8:54 pm
wow cool guy lots of stuff.

BTW @Kurt it does make sense to add Gmsh to the recommended packages too. It is needed to mesh in FEM as an addition to Netgen. Some FEM mesh tools does even only work with Gmsh.
Yes, that seems reasonable.
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: 8475
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile with py3 and Qt5 on Debian Stretch

Postby bernd » Tue Nov 20, 2018 10:42 pm

I havae problems with Qt5 on Debian Buster ...

Code: Select all

cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17  \
-DBUILD_QT5=ON \
-DFREECAD_BUILD_DEBIAN=ON \
-DLIB_SUFFIX="" \
-DOCC_INCLUDE_DIR="/usr/include/occt" \
-DOCCT_CMAKE_FALLBACK=True \
../freecad

Code: Select all

$ cmake \
> -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17  \
> -DBUILD_QT5=ON \
> -DFREECAD_BUILD_DEBIAN=ON \
> -DLIB_SUFFIX="" \
> -DOCC_INCLUDE_DIR="/usr/include/occt" \
> -DOCCT_CMAKE_FALLBACK=True \
> ../freecad
-- Compiler: GNU, version: 8.2.0
-- prefix: /opt/local/FreeCAD-0.17
-- datadir: data
-- docdir: doc
-- includedir: include
-- libdir: /opt/local/FreeCAD-0.17/lib
-- cmake: 3.12.3
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   system
--   thread
--   chrono
--   date_time
--   atomic
-- Found Xerces-C: /usr/lib/x86_64-linux-gnu/libxerces-c.so
-- PyCXX found:
--   Headers:  /home/vagrant/Documents/build_FC/freecad/freecad/src
--   Sources:  /home/vagrant/Documents/build_FC/freecad/freecad/src/CXX
--   Version:  6.2.8
-- Found OCC: /usr/include/occt (found version "7.3.0") 
-- -- Found OCE/OpenCASCADE version: 7.3.0
-- -- OCE/OpenCASCADE include directory: /usr/include/occt
-- -- OCE/OpenCASCADE shared libraries directory: /opt/local/FreeCAD-0.17/lib
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.

-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkIOMPIParallel;vtkParallelMPI;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType
-- Check for medfile (libmed and libmedc) ...
-- Checking for module 'Coin'
--   No package 'Coin' found
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.11.2/Shiboken2Config.cmake:5 (include):
  include could not find load file:

    /usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.11.2/Shiboken2Config-python2.7.cmake
Call Stack (most recent call first):
  CMakeLists.txt:963 (find_package)


====================
shiboken2 not found.
====================

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/PySide2-5.11.2/PySide2Config.cmake:5 (include):
  include could not find load file:

    /usr/lib/x86_64-linux-gnu/cmake/PySide2-5.11.2/PySide2Config-python2.7.cmake
Call Stack (most recent call first):
  CMakeLists.txt:970 (find_package)


==================
PySide2 not found.
==================

-- -- matplotlib-2.2.2 has been found.
-- Platform is 64-bit, set -D_OCC64
-- Build type: 
git
/home/vagrant/Documents/build_FC/freecad/build/src/Build/Version.h.out written
-- Found zipios++: 
-- Found zipios++ headers.
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   python27
-- found Boost: 1_67
-- boost-incude dirs are: /usr/include
-- boost-python lib is: 
-- boost_LIBRARY_DIRS is: /usr/lib/x86_64-linux-gnu
-- Boost_LIBRARIES is: /usr/lib/x86_64-linux-gnu/libboost_python27.so
-- area module (for Path Workbench) will be installed to: /opt/local/FreeCAD-0.17/lib
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
CMake Error at src/Gui/CMakeLists.txt:110 (find_package):
  By not providing "FindQt5X11Extras.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5X11Extras", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5X11Extras" with
  any of the following names:

    Qt5X11ExtrasConfig.cmake
    qt5x11extras-config.cmake

  Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set
  "Qt5X11Extras_DIR" to a directory containing one of the above files.  If
  "Qt5X11Extras" provides a separate development package or SDK, be sure it
  has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/vagrant/Documents/build_FC/freecad/build/CMakeFiles/CMakeOutput.log".
See also "/home/vagrant/Documents/build_FC/freecad/build/CMakeFiles/CMakeError.log".
$ 
but

Code: Select all

$ dpkg -l | grep libshiboken
ii  libshiboken2-5.11                      5.11.2-1+b1                  amd64        CPython bindings generator for C++ libraries (Python2 shared library)
ii  libshiboken2-dev                       5.11.2-1+b1                  amd64        CPython bindings generator for C++ libraries (development files)
ii  libshiboken2-py3-5.11                  5.11.2-1+b1                  amd64        CPython bindings generator for C++ libraries (Python3 shared library)
$ 
$ dpkg -l | grep pyside
ii  libpyside2-5.11                        5.11.2-1+b1                  amd64        Python 2 bindings for Qt5 (base files)                                                                                                              
ii  libpyside2-dev                         5.11.2-1+b1                  amd64        Python bindings for Qt5 (development files)                                                                                                         
ii  libpyside2-py3-5.11                    5.11.2-1+b1                  amd64        Python 3 bindings for Qt5 (base files)                                                                                                              
ii  pyside2-tools                          5.11.2-1+b1                  amd64        development tools for PySide2 (uic, rcc, lupdate)                                                                                                   
ii  python-pyside2.qtcore                  5.11.2-1+b1                  amd64        Python bindings for Qt5 core module (Python 2)                                                                                                      
ii  python-pyside2.qtgui                   5.11.2-1+b1                  amd64        Python bindings for Qt5 Gui module (Python 2)                                                                                                       
ii  python-pyside2.qtsvg                   5.11.2-1+b1                  amd64        Python bindings for Qt5 Svg module (Python 2)                                                                                                       
ii  python-pyside2.qtwidgets               5.11.2-1+b1                  amd64        Python bindings for Qt5 Widgets module (Python 2)                                                                                                   
ii  python-pyside2uic                      5.11.2-1                     all          User Interface Compiler for PySide2 (Python 2)                                                                                                      
$