Attempt of FreeCAD on WSL2 on windows

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
qingfeng.xia
Posts: 227
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford UK/Shenzhen China
Contact:

Attempt of FreeCAD on WSL2 on windows

Post by qingfeng.xia »

Asked by my colleague to debug error of FreeCAD inside WSL, here is the progress, hopefully it could be helpful
  • 1. Pyside2 version confliction, solved
Error:

Code: Select all

      File "/usr/local/lib/python3.6/dist-packages/shiboken2/__init__.py", line 30, in <module>
        _init_pyside_extension()
    <class 'NameError'>: name '_init_pyside_extension' is not defined
    name '_init_pyside_extension' is not defined

Env: Ubuntu 18.04 FreeCAD 0.19 from stable PPA, host is windows 10 x64



To track down the issue by `ldd $(which freecad)`

Code: Select all

        libshiboken2.cpython-36m-x86_64-linux-gnu.so.5.11 => /usr/lib/x86_64-linux-gnu/libshiboken2.cpython-36m-x86_64-linux-gnu.so.5.11 (0x00007f20f4d50000)
        libpyside2.cpython-36m-x86_64-linux-gnu.so.5.11 => /usr/lib/x86_64-linux-gnu/libpyside2.cpython-36m-x86_64-linux-gnu.so.5.11 (0x00007f20f4b1f000)

`gedit /usr/local/lib/python3.6/dist-packages/shiboken2/__init__.py`
it says: `__version__ = "5.15.1"`

Reason:

`pip installed pyside2` version is different , e.g. 5.15.x, while freecad is built with platfrom default 5.11. User pip installed pyside2 has priorty over the system default v5.11.

Solution:

`sudo pip3 remove pyside2`

This solution also apply to any Linux platform if use has install another pyside2 via pip

This should solve the issue

https://github.com/FreeCAD/FreeCAD-addons/issues/183

  • 2. Qt5 Crash inside WSL2
Although FreeCAD startup properly, now but can not create doc or load geometry

Code: Select all


Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3efd0) [0x7fa0695e4fd0]
#1  /lib/x86_64-linux-gnu/libc.so.6(+0x18edc3) [0x7fa069734dc3]
#2  /usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0(+0x3b9ac) [0x7fa05532a9ac]
#3  /usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0(+0x3bc75) [0x7fa05532ac75]

109  /usr/lib/x86_64-linux-gnu/libQt5WebKitWidgets.so.5(+0x2e749) [0x7f25deb10749]

110  0x7f2603747555 in QMetaObject::activate(QObject*, int, int, void**) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x865

111  0x7f25deb05645 in QWebPage::linkClicked(QUrl const&) from /usr/lib/x86_64-linux-gnu/libQt5WebKitWidgets.so.5+0x35

112  0x7f25deb05fa3 in QWebPage::acceptNavigationRequest(QWebFrame*, QNetworkRequest const&, QWebPage::NavigationType) from /usr/lib/x86_64-linux-gnu/libQt5WebKitWidgets.so.5+0x83

I suspect WSL2 has QtWebKitWidgets compatibility issue.


Alternative solution will be : do not use FreeCAD GUI, but import FreeCAD as module to do some job.

Examples are

https://github.com/qingfengxia/parallel ... FreeCAD.py

a Script to detect and import FreeCAD, hopefully it helps. it works for my in docker image.

Usage here

https://github.com/qingfengxia/parallel ... estBase.py
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Post Reply