You shouldn't need to set all those flags, the only Python 3 flag required is -DPYTHON_EXECUTABLE="/usr/bin/python3".reox wrote: ↑Sun Jan 13, 2019 5:02 pm I got QT5 + Py3.7 working on debian sid using these changes: https://github.com/reox/FreeCAD_gitpack ... f4af524697
I'm not sure about all the cmake variables, maybe some of them are also autogenerated...
Compile w/Py3 & Qt5 for Dummies
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: 2518
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Compile w/Py3 & Qt5 for Dummies
Re: Compile w/Py3 & Qt5 for Dummies
good to know, thanks!kkremitzki wrote: ↑Sun Jan 13, 2019 5:07 pmYou shouldn't need to set all those flags, the only Python 3 flag required is -DPYTHON_EXECUTABLE="/usr/bin/python3".reox wrote: ↑Sun Jan 13, 2019 5:02 pm I got QT5 + Py3.7 working on debian sid using these changes: https://github.com/reox/FreeCAD_gitpack ... f4af524697
I'm not sure about all the cmake variables, maybe some of them are also autogenerated...
I basically copy/pasted from Moult and changed the SUFFIX
Re: Compile w/Py3 & Qt5 for Dummies
this is how it worked for me on ubuntu 18.04:
add ppa for pybind11:
https://launchpad.net/~nschloe/+archive ... -backports
install a lot of packages. Most are suggested by cmake errors:
- libocct*
- libboost*
- libcoin-dev
- python3-pyside2
- python3-pivy (freecad-ppa)
- libshiboke2-dev
- libeigen3-dev
- pybind11
- netgen
- netgen-headers
....
use some variables:
add ppa for pybind11:
https://launchpad.net/~nschloe/+archive ... -backports
install a lot of packages. Most are suggested by cmake errors:
- libocct*
- libboost*
- libcoin-dev
- python3-pyside2
- python3-pivy (freecad-ppa)
- libshiboke2-dev
- libeigen3-dev
- pybind11
- netgen
- netgen-headers
....
use some variables:
Code: Select all
cmake -D BUILD_QT5=ON \
-D PYTHON_EXECUTABLE=/usr/bin/python3.6 \
-D FREECAD_USE_PYBIND11:BOOL=ON \
-D USE_BOOST_PYTHON:BOOL=OFF \
-D BUILD_ENABLE_CXX11:BOOL=ON \
-D BUILD_PLOT:BOOL=OFF \
-D BUILD_SHIP:BOOL=OFF \
-D FREECAD_USE_OCC_VARIANT="Official Version" \
-D BUILD_FLAT_MESH:BOOL=ON \
-D BUILD_FEM_NETGEN:BOOL=ON \
-D ENABLE_MED:BOOL=OFF \
..
Re: Compile w/Py3 & Qt5 for Dummies
Somehow I am missing /usr/lib/python3.6/site-packages/shiboken2.<cpython....>.so
for conda it's installed here:
but it seems there is no equivalent for ubuntu 18.04:
edit: next problem is fem-netgen meshing which doesn't work very well. I guess the internal smesh needs some modifications to work with latest netgen package.
Maybe someone can provide a smesh package for external smesh? https://github.com/LaughlinResearch/SMESH which works with netgen6.2 (at least for conda-packages)
for conda it's installed here:
Code: Select all
locate shiboken2 |grep conda |grep python3.7/site-packages
/home/k/conda/envs/freecad-gcc7/lib/python3.7/site-packages/shiboken2.cpython-37m-x86_64-linux-gnu.so
/home/k/conda/pkgs/pyside2-5.6.0a1-py37h4a9562c_1004/lib/python3.7/site-packages/shiboken2.cpython-37m-x86_64-linux-gnu.so
Code: Select all
dpkg -S shiboken2 |grep python |grep .so
libshiboken2-dev: /usr/lib/x86_64-linux-gnu/libshiboken2-python2.7.x86_64-linux-gnu.so
libshiboken2-py3-5.11: /usr/lib/x86_64-linux-gnu/libshiboken2.cpython-36m-x86_64-linux-gnu.so.5.11
libshiboken2-py3-5.11: /usr/lib/x86_64-linux-gnu/libshiboken2.cpython-36m-x86_64-linux-gnu.so.5.11.2
libshiboken2-dev: /usr/lib/x86_64-linux-gnu/libshiboken2.cpython-36m-x86_64-linux-gnu.so
libshiboken2-5.11: /usr/lib/x86_64-linux-gnu/libshiboken2-python2.7.x86_64-linux-gnu.so.5.11
libshiboken2-5.11: /usr/lib/x86_64-linux-gnu/libshiboken2-python2.7.x86_64-linux-gnu.so.5.11.2
edit: next problem is fem-netgen meshing which doesn't work very well. I guess the internal smesh needs some modifications to work with latest netgen package.
Maybe someone can provide a smesh package for external smesh? https://github.com/LaughlinResearch/SMESH which works with netgen6.2 (at least for conda-packages)
Re: Compile w/Py3 & Qt5 for Dummies
I'm not the most knowledgeable in these matters, and it's possible I don't understand your question, but wouldn't shiboken2.cpython-37m-x86_64-linux-gnu.so be the same as libshiboken2.cpython-37m-x86_64-linux-gnu.so for a debian package-installed shiboken2?
You already show it listed, and it's what I use for my local compilation of FreeCAD on Ubuntu 18.04. To be clear: my /usr/lib/python3.6/site-packages/ is empty except for a shortcut for vtk. Scratch that, that's the python2.7 folder, I don't even have a python3.6 folder. Remember, on Debian/Ubuntu, site-packages is not used.
Nevermind the -python2.7.x86_64-linux-gnu above, I believe wmayer explained that it's disregarded.
For me, Shiboken2_DIR is /usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.11.2
You already show it listed, and it's what I use for my local compilation of FreeCAD on Ubuntu 18.04. To be clear: my /usr/lib/python3.6/site-packages/ is empty except for a shortcut for vtk. Scratch that, that's the python2.7 folder, I don't even have a python3.6 folder. Remember, on Debian/Ubuntu, site-packages is not used.
Code: Select all
Shiboken2Config: Using default python: -python2.7.x86_64-linux-gnu
libshiboken built for Release
PYTHON_CONFIG_SUFFIX: .cpython-36m-x86_64-linux-gnu
libshiboken built for Release
For me, Shiboken2_DIR is /usr/lib/x86_64-linux-gnu/cmake/Shiboken2-5.11.2
Re: Compile w/Py3 & Qt5 for Dummies
Kurt did it already on the freecad-community PPA https://launchpad.net/~freecad-communit ... ubuntu/ppa
There's a salome-smesh_8.3.0.2 package, and the LaughlinResearch repo was used. From his blog:
https://kkremitzki.github.io/blog/free- ... mber-2018/
I haven't tried it... It built only on amd64, but failed on i386.kkremitzki wrote: smesh
GitHub
A stand-alone library of the mesh framework from the Salome Platform
I've gotten this standalone version of SMESH packaged and awaiting sponsorship at https://salsa.debian.org/kkremitzki-guest/salome-smesh. Eventually, I want to package the entire Salome Platform, but it's extremely large and really several source packages. Packaging this as an intermediate step allows us to remove SMESH from FreeCAD's included sources.
It's also available on the FreeCAD Community Extras PPA.
Re: Compile w/Py3 & Qt5 for Dummies
Thanks for the reply @NormanC.
1. libshiboken2.cpython-.....so in /usr/lib
2. shiboken2.cpython-.....so in /usr/lib/pythonx.y/site-packages
The second one is necesarry if shiboken is used from python (which is done in pivy and some freecad-modules. This trace-backs lead to the assumption there is missing the second library:
I wonder why you guys don't have this problem.
This is german and means that there is no salome-smesh but there is a package which refers to salome-smesh. Any ideas?
Hmm I do think there have to be two different shiboken libraries:I'm not the most knowledgeable in these matters, and it's possible I don't understand your question, but wouldn't shiboken2.cpython-37m-x86_64-linux-gnu.so be the same as libshiboken2.cpython-37m-x86_64-linux-gnu.so for a debian package-installed shiboken2?
1. libshiboken2.cpython-.....so in /usr/lib
2. shiboken2.cpython-.....so in /usr/lib/pythonx.y/site-packages
The second one is necesarry if shiboken is used from python (which is done in pivy and some freecad-modules. This trace-backs lead to the assumption there is missing the second library:
Code: Select all
During initialization the error Cannot load shiboken2 module occurred in /home/k/projects/FreeCAD/build/Mod/Tux/InitGui.py
Please look into the log file for further information
I wonder why you guys don't have this problem.
Hmmm, somehow I am not able to install this package:NormandC wrote: ↑Sat Feb 09, 2019 7:43 pm Kurt did it already on the freecad-community PPA https://launchpad.net/~freecad-communit ... ubuntu/ppa
Code: Select all
sudo apt-get install salome-smesh
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Paket salome-smesh ist nicht verfügbar, wird aber von einem anderen Paket
referenziert. Das kann heißen, dass das Paket fehlt, dass es abgelöst
wurde oder nur aus einer anderen Quelle verfügbar ist.
E: Für Paket »salome-smesh« existiert kein Installationskandidat.
Re: Compile w/Py3 & Qt5 for Dummies
try
Code: Select all
apt-cache policy salome-smesh
It looks like that it is only build for bionic. do you have the right sources.list entry?
Re: Compile w/Py3 & Qt5 for Dummies
There is a shiboken2 package that is installed on my system, but it only contains the changelog, copyright and man page. Kurt ported it to the PPA from Debian (it is currently in experimental and testing).looo wrote: ↑Sun Feb 10, 2019 11:14 am Hmm I do think there have to be two different shiboken libraries:
1. libshiboken2.cpython-.....so in /usr/lib
2. shiboken2.cpython-.....so in /usr/lib/pythonx.y/site-packages
The second one is necesarry if shiboken is used from python (which is done in pivy and some freecad-modules. This trace-backs lead to the assumption there is missing the second library:
https://packages.debian.org/buster/amd6 ... 2/filelist
As I said: I'm pretty sure it is Debian policy to have libraries installed in /usr/lib/, nothing is installed in /usb/lib/pythonx.y/site-packages. And shared library files always have a "lib" suffix. Kurt did it for the upcoming FreeCAD package in Debian. https://packages.debian.org/sid/libfreecad-python3-0.18
I can't say, my Py3/Qt5 build runs fine. I remember seeing this error early on, but not anymore. It may be a CMake configuration issue on your end.
Sorry, I didn't look into the package details. salome-smesh is the same of the source package, the binary packages are actually libsalome-smesh and libsalome-smesh-dev. Is the dev package necessary? I guess so.
Code: Select all
sudo apt install libsalome-smesh-dev
Re: Compile w/Py3 & Qt5 for Dummies
I tried to build with the freecad-community salome-smesh package but it failed.
There is only one single variable in CMake for smesh, SMESH_DIR and I set it to /usr/lib/cmake/salome-smesh. Of course, I enabled FREECAD_USE_EXTERNAL_SMESH.
I also tried to build with flatmesh and netgen and failed, and after a search found that both require pybind11 2.2, while Ubuntu 18.04 provides 2.0. Goody, I didn't remember that.
Code: Select all
[ 67%] Building CXX object src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/Mesher.cpp.o
/home/normand2/compilation/FreeCAD/freecad-code/src/Mod/MeshPart/App/Mesher.cpp:44:10: fatal error: SMESH_Gen.hxx: No file or folder of this type
#include <SMESH_Gen.hxx>
^~~~~~~~~~~~~~~
compilation terminated.
src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/build.make:162: recipe for target 'src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/Mesher.cpp.o' failed
make[2]: *** [src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/Mesher.cpp.o] Error 1
CMakeFiles/Makefile2:2836: recipe for target 'src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/all' failed
make[1]: *** [src/Mod/MeshPart/App/CMakeFiles/MeshPart.dir/all] Error 2
Any idea? That file is on my system, in /usr/include/smesh/SMESH_Gen.hxxkkremitzki wrote:ping
There is only one single variable in CMake for smesh, SMESH_DIR and I set it to /usr/lib/cmake/salome-smesh. Of course, I enabled FREECAD_USE_EXTERNAL_SMESH.
I also tried to build with flatmesh and netgen and failed, and after a search found that both require pybind11 2.2, while Ubuntu 18.04 provides 2.0. Goody, I didn't remember that.