Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
derek-v-s
Posts: 26
Joined: Mon May 06, 2019 9:47 pm
Contact:

Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by derek-v-s »

It took the better part of a day to determine all of the required packages, and setup Qt creator for building: So hopefully I'll be able to contribute by updating the wiki and reducing the effort involved for other potential contributors using Tumbleweed, Qt Creator, Qt5 and Python 3.

The following commands will hopefully install everything required for building:

Code: Select all

zypper in --no-recommends -t pattern devel_C_C++ devel_qt5

zypper in libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel boost-devel swig libboost_program_options-devel libboost_mpi_python3-devel libboost_system-devel libboost_program_options-devel libboost_regex-devel libboost_python3-devel libboost_thread-devel libboost_system-devel libboost_headers-devel libboost_graph-devel python3 python3-devel python3-matplotlib python3-matplotlib-qt5 python3-pyside2 python3-pyside2-devel python3-pivy gcc gcc-fortran cmake occt-devel libXi-devel opencv-devel libxerces-c-devel Coin-devel SoQt-devel freetype2-devel eigen3-devel libode6 vtk-devel libmed-devel hdf5-openmpi-devel openmpi2-devel netgen-devel freeglut-devel libspnav-devel f2c doxygen dos2unix glew-devel

zypper in libqt5-creator gdb
The openSUSE .spec file was used as a starting point for determining required packages.
https://build.opensuse.org/package/view ... eeCAD.spec

Note that I did install FreeCAD 0.18 via the package manager first, so if what I've provided is incomplete, that's probably the difference.

---

The following CMakeLists.txt patch was found at https://build.opensuse.org/package/show ... ry/FreeCAD

0001-find-openmpi2-include-files.patch

Code: Select all

-                find_file(MpidotH mpi.h PATHS ${OPENMPI_INCLUDE_DIRS} NO_DEFAULT_PATH)
+                find_file(MpidotH mpi.h PATHS ${OPENMPI_INCLUDE_DIRS} /usr/lib64/mpi/gcc/openmpi2/include NO_DEFAULT_PATH)
---

In Qt Creator, add the following to the bottom of:
Projects -> Manage Kits -> Kits -> Default (or your kit) -> CMake Configuration:

Code: Select all

PYTHON_EXECUTABLE=/usr/bin/python3.7
PYTHON_INCLUDE_DIR=/usr/include/python3.7m
PYTHON_LIBRARY=/usr/lib64/libpython3.7m.so
PYTHON_PACKAGES_PATH=/usr/lib64/python3.7/site-packages
BUILD_QT5=ON
If you aren't using Python 3.7.x, you will need to replace the "3.7".
Check with "python3 -V" and ignore the number furthest right.

---

In Qt Creator, switch Projects -> Run -> Run Configuration from FreeCADMainCMD to FreeCADMain (unless you want the command line only version)

---

Just FYI, the following are currently offered by openSUSE Tumbleweed:

Code: Select all

Python version: 3.7.2
Qt version: 5.12.3
Coin version: 3.1.3
OCC version: 7.3.0
Last edited by derek-v-s on Mon May 13, 2019 2:22 am, edited 2 times in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by Kunda1 »

This is great. Do you do any tumbleweed packaging ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
derek-v-s
Posts: 26
Joined: Mon May 06, 2019 9:47 pm
Contact:

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by derek-v-s »

Hi Kunda1 :-]

I've been interested in working with the Open Build Service, but there has been no need or request yet.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by vocx »

derek-v-s wrote: Sat May 11, 2019 2:12 am Just FYI, the following are currently offered by openSUSE Tumbleweed:

Code: Select all

Python version: 3.7.2
Qt version: 5.12.3
Coin version: 3.1.3
OCC version: 7.3.0
In Debian and Ubuntu, FreeCAD is compiled against Coin 4.0. I wonder why SUSE users only have Coin 3.x. Maybe you can try to get Coin 4.x there as well.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
derek-v-s
Posts: 26
Joined: Mon May 06, 2019 9:47 pm
Contact:

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by derek-v-s »

Hi vocx :-]

https://bitbucket.org/Coin3D/coin/downloads/ shows Coin-3.1.3.tar.gz as seemingly the most recent thing offered aside from files that start with ubuntu, fedora and debian. I don't know what that means.

https://bitbucket.org/Coin3D/coin/src/tip/RELNOTES stops at 3.1.3

I can't find any mention of a 4.0 release.
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by kkremitzki »

4.0 is unreleased but so overdue in terms of features we need that have already been added that we just went with it.
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
derek-v-s
Posts: 26
Joined: Mon May 06, 2019 9:47 pm
Contact:

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by derek-v-s »

Hi kkremitzki :-]

Thanks.

I found https://build.opensuse.org/package/show ... table/Coin

> "It is currently building, but does not link all needed methods"

Coin.spec says "Version: 4.0~pre.11701"
User avatar
hobbes1069
Posts: 291
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by hobbes1069 »

Apologies for partially hijacking this thread but...

I'm the FreeCAD maintainer for Fedora and it's been in a terrible state for the last couple of years.

Not to blame any individual, but does everyone understand that relying on unreleased software makes it VERY difficult on package maintainers?

Right now I'm trying to get Pivy to build for both Python2 and Python3 because I can't seem to get FreeCAD to work with the python3 version even though Fedora is in the middle of eradicating all python2 packages due to the Python2 EOL at the end of this year.

Do I package the latest checkout of Pivy from bitcoin? Or do I change over to the FreeCAD fork?

I'm also working on getting Pyside2 into Fedora because freecad needs it for Qt5 but it's a PITA as well. It was building and something change in the build environment and now its not.

I'm seriously about to give up and just point everyone to the 500+MB appimage download.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by Kunda1 »

hobbes1069 please don't lose faith. thank you for all your efforts. You are integral to many people using FC on different flavors of *NIX. We're slowly making this happen and I hope we can keep our dependency documentation up to date as we come through this dependency hell.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Building with Qt Creator, Qt5 and Python 3 on openSUSE Tumbleweed

Post by vocx »

hobbes1069 wrote: Sun May 12, 2019 12:47 pm ...
Not to blame any individual, but does everyone understand that relying on unreleased software makes it VERY difficult on package maintainers?
...
I think the problem is not specific to Fedora. FreeCAD has existed for a long time but the dependencies like Pivy, Coin, Pyside2, Calculix, etc., haven't been maintained properly it seems. They were packaged into Debian a long time ago but weren't kept up to date. Now the new maintainers are trying to solve these issues by re-packaging everything, and making sure those packages are maintained. So, it's a work in progress. Definitely FreeCAD tends to work better in Debian-based systems, to the detriment of other systems like Fedora and SUSE.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply