[Fixed] [Mageia Cauldreon] freecad 0.18 fails to build against Python3 and Qt5

Having trouble installing or compiling FreeCAD? Get help here.
daviddavid
Posts: 4
Joined: Thu Mar 21, 2019 4:43 am

[Fixed] [Mageia Cauldreon] freecad 0.18 fails to build against Python3 and Qt5

Postby daviddavid » Thu Mar 21, 2019 4:49 am

I tried on Mageia Cauldron to build latest freecad against Qt5 and Python3 but it fails to build with the following error:

Code: Select all

CMakeFiles/FreeCADBase.dir/UnitsSchemaMKS.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaImperial1.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaCentimeters.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaMmMin.cpp.o CMakeFiles/FreeCADBase.dir/Quantity.cpp.o CMakeFiles/FreeCADBase.dir/QuantityPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Unit.cpp.o CMakeFiles/FreeCADBase.dir/UnitPyImp.cpp.o CMakeFiles/FreeCADBase.dir/PyTools.c.o CMakeFiles/FreeCADBase.dir/PreCompiled.cpp.o /usr/lib64/libpython3.7m.so /usr/lib64/libxerces-c.so /usr/lib64/libboost_filesystem.so /usr/lib64/libboost_program_options.so /usr/lib64/libboost_regex.so /usr/lib64/libboost_system.so -lboost_thread -lpthread /usr/lib64/libboost_chrono.so /usr/lib64/libboost_date_time.so /usr/lib64/libboost_atomic.so -lpthread /usr/lib64/libz.so /usr/lib64/libQt5Core.so.5.12.1 -lutil -ldl /usr/lib64/libzipios.so -lpython3.7 
/usr/bin/ld: CMakeFiles/FreeCADBase.dir/ParameterPy.cpp.o:(.data.rel.ro._ZTVN2Py15PythonExtensionIN4Base14ParameterGrpPyEEE[_ZTVN2Py15PythonExtensionIN4Base14ParameterGrpPyEEE]+0x28): undefined reference to `Py::PythonExtensionBase::print(_IO_FILE*, int)'
/usr/bin/ld: CMakeFiles/FreeCADBase.dir/ParameterPy.cpp.o:(.data.rel.ro._ZTVN4Base14ParameterGrpPyE[_ZTVN4Base14ParameterGrpPyE]+0x28): undefined reference to `Py::PythonExtensionBase::print(_IO_FILE*, int)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/build.make:1242: lib/libFreeCADBase.so] Error 1
make[2]: Leaving directory '/home/david/mgarepo/freecad/BUILD/FreeCAD-0.18/build'
make[1]: *** [CMakeFiles/Makefile2:686: src/Base/CMakeFiles/FreeCADBase.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Attached full compile log.

Regards,
David
Attachments
log.freecad.txt
(742.84 KiB) Downloaded 16 times
User avatar
Kunda1
Posts: 7010
Joined: Thu Jan 05, 2017 9:03 pm

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby Kunda1 » Tue Mar 26, 2019 2:05 pm

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
daviddavid
Posts: 4
Joined: Thu Mar 21, 2019 4:43 am

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby daviddavid » Mon Apr 08, 2019 3:29 pm

So I found something interesting on the build issue, if I compile freecad with our python3-cxx (7.1.0) package it fails to build but if I use the bundled one it build fine. Before with Qt4 and python2 so with python2-cxx it build too.
User avatar
hhassey
Posts: 134
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby hhassey » Mon Apr 08, 2019 10:58 pm

Trying to build against python3 and Qt5 I installed all the dependencies, followed the compile out of source instructions

Ran Cmake with these options

Code: Select all

#! /bin/sh
cmake -DBUILD_QT5=ON \
-D CMAKE_BUILD_TYPE=Release \
-D PYTHON_LIBRARY=/usr/lib64/libpython3.7m.so \
-D PYTHON_INCLUDE_DIR=/usr/include/python3.7m \
-D PYTHON_PACKAGES_PATH=/usr/lib64/python3.7/site-packages \
-D PYTHON_EXECUTABLE=/usr/bin/python3.7 \
-D FREECAD_USE_QWEBKIT:BOOL=ON \
..
and got this error

Code: Select all

[ 29%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/zipoutputstreambuf.cpp.o
make[2]: *** No rule to make target '/usr/lib64/libpython3.7m.so', needed by 'lib/libFreeCADBase.so'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 30%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/__/zipios++/zipoutputstream.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VolumeTool.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VtkCellIterator.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VtkEdge.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VtkVolume.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_VtkFace.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/Utils_SALOME_Exception.cpp.o
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/chrono.cpp.o
make[1]: *** [CMakeFiles/Makefile2:683: src/Base/CMakeFiles/FreeCADBase.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 30%] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/duplicate.cpp.o
[ 30%] Linking CXX shared library ../../../lib/libSMDS.so
[ 30%] Built target SMDS
make[1]: *** [CMakeFiles/Makefile2:5305: src/Mod/Path/libarea/CMakeFiles/area.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Any ideas why this is happening?

Thanks in advance
User avatar
kkremitzki
Posts: 1914
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby kkremitzki » Mon Apr 08, 2019 11:32 pm

hhassey wrote:
Mon Apr 08, 2019 10:58 pm
Trying to build against python3 and Qt5 I installed all the dependencies, followed the compile out of source instructions

Ran Cmake with these options

Code: Select all

#! /bin/sh
cmake -DBUILD_QT5=ON \
-D CMAKE_BUILD_TYPE=Release \
-D PYTHON_LIBRARY=/usr/lib64/libpython3.7m.so \
-D PYTHON_INCLUDE_DIR=/usr/include/python3.7m \
-D PYTHON_PACKAGES_PATH=/usr/lib64/python3.7/site-packages \
-D PYTHON_EXECUTABLE=/usr/bin/python3.7 \
-D FREECAD_USE_QWEBKIT:BOOL=ON \
..
You shouldn't need all those PYTHON_ flags, it should be sufficient to set -DPYTHON_EXECUTABLE=/usr/bin/python3.
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
hhassey
Posts: 134
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby hhassey » Tue Apr 09, 2019 12:00 am

Whoooohooooooo I have FreeCAD 0.19!!!!!

That made it work!
Thanks so much @khremitzki
User avatar
Kunda1
Posts: 7010
Joined: Thu Jan 05, 2017 9:03 pm

Re: freecad 0.18 fails to build against Python3 and Qt5

Postby Kunda1 » Thu Sep 05, 2019 9:54 pm

Closed issue #3912 associated with this ticket
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features