Build problems (Ubuntu 19.04 / Python 3.7)

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
Joel_graff
Posts: 1223
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Build problems (Ubuntu 19.04 / Python 3.7)

Postby Joel_graff » Fri May 17, 2019 11:09 pm

So I'm trying to get FreeCAD to build on Ubuntu 19.04 and Python 3.7 and I'm having issues.

First, there's this error in the CMakeFiles error log:

Code: Select all

/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_579bb.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_579bb.dir/CheckFunctionExists.c.o  -o cmTC_579bb -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_579bb.dir/build.make:87: cmTC_579bb] Error 1
make[1]: Leaving directory '/home/joel/Projects/fc-build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_579bb/fast] Error 2
Second, when I run FreeCAD, most workbenches' InitGui.py file triggers the following error:

Code: Select all

During initialization the error type object 'type' has no attribute '__signature__' occurred in

So, on a whim, I fired up cmake-gui just to see if I could work it out that way. After configurating and generating the build files, it told me it couldn't find PySide2. I noticed it was looking for Python2.7 files, so I changed them all to Python3.7 and it resulted in:

Code: Select all

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

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


CMake Error at CMakeLists.txt:1102 (MESSAGE):
  =================

  PySide not found.

  =================
  
The missing file doesn't exist anywhere.

So I suspect this has to do with Pyside2 and Python2.7 vs Python3...
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
kkremitzki
Posts: 1526
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Build problems (Ubuntu 19.04 / Python 3.7)

Postby kkremitzki » Fri May 17, 2019 11:28 pm

What cmake flags are you using? It should be enough to do cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 /path/to/freecad/source.
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
Joel_graff
Posts: 1223
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Build problems (Ubuntu 19.04 / Python 3.7)

Postby Joel_graff » Sat May 18, 2019 1:31 am

Yeah, that's what I used. Then ran cmake-gui and it gave me the issue about not finding PySide. For a while it was complaining about not finding QT4. Not sure why that went away. :?
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
kkremitzki
Posts: 1526
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Build problems (Ubuntu 19.04 / Python 3.7)

Postby kkremitzki » Sat May 18, 2019 2:17 am

Hmm, well I don't use cmake-gui (in the cmake-qt-gui package) but cmake-curses-gui which provides the ccmake command, and even when I first provide some flags with cmake and then later run ccmake it still honors the flags originally set. So, I'm not sure what's causing it, but the first troubleshooting step I would probably take would be to just blow away the build directory and make a clean one, re-run the cmake command, and re-try the build.
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
Joel_graff
Posts: 1223
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Build problems (Ubuntu 19.04 / Python 3.7)

Postby Joel_graff » Sat May 18, 2019 11:55 am

kkremitzki wrote:
Sat May 18, 2019 2:17 am
but the first troubleshooting step I would probably take would be to just blow away the build directory and make a clean one, re-run the cmake command, and re-try the build.
Yeah, I do that as a matter of course with every rebuild. Deleting the cache just doesn't cut it, I've found.

Just tried the AppImage. Interestingly, the same error shows up in the status bar:

Code: Select all

AttributeError: type object 'type' has no attribute '__signature__'
and the terminal generates the same errors I had before.
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails
User avatar
Joel_graff
Posts: 1223
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Build problems (Ubuntu 19.04 / Python 3.7)

Postby Joel_graff » Thu May 23, 2019 12:07 pm

Just a small update on this issue - I found if I go into the __init__.py file cited in the errors and add the instancing operator, the error is resolved (and it moves to the next occurrence). That is:

Code: Select all

type.__signature__
becomes:

Code: Select all

type().__signature__
This is much deeper in the weeds of Python internals than I am accustomed to, but on the surface it stinks of a python versioning issue / incompatibility to me.
You can find the FreeCAD Trails workbench for transportation engineering on my github at:
https://www.github.com/joelgraff/freecad.trails