New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeCAD (RT Fork) #19175
Comments
Well, there are two issues:
It's recommended to use UCRT64 instead of MINGW64. |
@MehdiChinoune writes:
Do you confirm that their page is wrong about using "mingw-w64 GCC toolchain" ? You also state:
This again contradicts a bit to what the aforementioned page says:
If they write misleading things, it might be worth filing a corresponding issue in (or mentioning an existing one from) their repo. EDIT: Ah, I get the 2nd part – you meant it's MSYS2 who recommend using UCRT64 instead of MINGW64. |
RT fork includes anyway several improvements which have not yet been ported into master. One of these improvements is TopoNaming which porting is underway but not yet done. If FreeCAD doesn't build with mingw-w64-gcc how was made the package |
I think It's unmaintained/outdated, try yourself building it on MINGW64 or UCRT64. |
After a more careful insight I have understood that the FreeCAD package was done using CLANG64 (and not MINGW64) environment. The package name is misleading. |
There is a possibility to backport some patches if they are not that much. But I see the fork highly diverged from the upstream. |
The LinkMerge Branch is the closest one to Master. It was rebased more or less in May 2023 (that is the reason of "Merge" tag added to the Branch name) but yes it is still very different. |
Hi MehdiChinoune
I have googled for mingw undefined vtable and I have found the page https://stackoverflow.com/questions/7720205/linking-error-undefined-reference-to-vtable-for-xxx which seems to me quite instructive. More specifically I would like to point to the lines:
But of course if the Mingw64 build problem with FreeCAD is also related with missing implementation of some virtual function it is something that should be fixed by FC developers. |
Two years ago I fully ported FreeCAD to MinGW64: https://forum.freecad.org/viewtopic.php?t=62169 At that time I was able to build the complete project. However, I couldn't get it working with gcc but clang. The build process gets stuck when it should link the FreeCADApp library. Actually, I don't get an error message but a never ending output message that I cancel after 20 minutes. With clang I don't get this problem and I can still build FreeCAD with it (did it just yesterday) but I have to disable some modules now:
|
@wwmayer we have already freecad for clang64. |
Yes I too had disabled those two modules (FEM and Web). Here following cleaner output (just first lines of a long sequence) captured with make &> tmp
|
Here is more detailed info obtained with
I think that the problem is that libFreeCADBase.dll.a is missing in the linking command. It would also be better if dependent libraries were enclosed in:
In the past I had already experienced linking problems with MINGW import libraries (dll.a) when not eclosed in such a group. |
Just to make it clear: I do NOT use CLANG64 or CLANG32 but exclusively MINGW64. Although, inside my MSYS2 installation I have the directories clang32, clang64, clangarm64, mingw32 and ucrt64 with each of them having the sub-directories bin, etc, include, lib and share but all these sub-directories are completely empty. All installed packages are in the sub-directories of mingw64. The clang compiler is provided by the package mingw-w64-clang-x86_64-clang. So, when building FreeCAD it links the same Python library as when building with gcc. So, you should give it a try to see if this way you can still use the Klayout stuff. |
@MehdiChinoune |
It was another issue with FreeCAD. |
Hi @MehdiChinoune, I have seen that the package mingw-w64-x86_64-boost |
Not every boost component provides a shared library and one of them is signals2. For such components the whole implementation is available inside the sub-directory "details". What are the linker errors related to signals2? |
Here is an example (undefined reference to `vtable for boost::signals2::signal near the end of following lines):
|
But now I have seen that at the beginning of link command there are also other kind of errors:
|
Consider doing a clean build. delete the source and build folders, re-applied the patches and rebuild. |
Now I have cloned current FreeCAD from official repository which should have all patches. Then I have created a build folder inside of it and, from this folder I entered:
I had a configuration error due to missing QtWebEngine in Qt5.
It seems to me that nothing has changed. |
This is normal because it's not available for MSYS. So, you have to switch off the Start and Web modules.
My latest upgrade of MSYS was from March or so and the vtk version is 9.2.7. With gcc it works fine and with clang I get linking errors but no compile errors.
I wonder how this can be possible. DocExportStatus is a struct defined in App/Document.cpp with only two members. A destructor should be generated by the compiler. |
Hi @wwmayer, |
Could you post cmake-log (What was cmake showing during configuration) |
Hi MehdiChinoune, here it is what I see in cmake GUI after cmd Configure:
|
Please, purge your build directory and use mingw-w64-cmake, you are using cmake 3.27.0-rc3 |
Initilally I used mingw-w64-cmake. In fact the command:
was entered from mingw-64 console. I used ccmake 3.27.0-rc3 to change the build option and to reconfigure. |
This is not the full log
|
The log you are showing is similar to the following log I see in the first run with a new build directory:
To fix it I have to set HDF5_DIR=C:\msys64\mingw64\lib\cmake in the cmake-gui. |
You could apply my patch from https://github.com/msys2/MINGW-packages/blob/e6f025815/mingw-w64-freecad/001-fix-build-on-mingw.patch |
Applied the pathes from from https://github.com/msys2/MINGW-packages/blob/e6f025815/mingw-w64-freecad/001-fix-build-on-mingw.patch but it ddn't fix the linkage of libFreeCADApp.dll and neither the problem with salomesmesh/VTK-9-3. The only difference was that it was not necessary to set HDF5_DIR=C:\msys64\mingw64\lib\cmake in cmake-gui. |
@MehdiChinoune |
For libc++ which used on CLANG64 which is uses llvm+clang+libc++ |
OK, thanks. |
I tried with ucrt64 but I got again the same errors at the linkage of libFreeCADApp.dll (and also same problem with WEB and FEM modules):
|
Hi @wwmayer
Undefined ref to ~DocExportStatus() disappears if I add ~DocExportStatus(){} in the struct DocExportStatus {...} but the undefined reference to `vtable for App::Document' is still there:
Undefined ref to ~DocExportStatus() doesn't disappears if I set ~DocExportStatus() =default; Does it mean that the problem is in the destruction of status or in the destruction of objs ?
|
Looking inside build/src/App/CmakeFiles/FreeCADApp.dir/Document.cpp.obj I can see that _ZTVN3App8DocumentE is really not defined (U stays for Undefined) which explains the first error
|
I couldn't reproduce the failure.
It built successfully, something wrong with your setup |
Hi MehdiChinoune, many thanks for your help. With Ninja worked also for me.
But FreeCADApp was successfully built. |
Which CMake generator did you use before? |
I was using MSYS Makefiles. |
I am using MSYS Makefiles, too. |
Now I am trying to build LinkMerge but I have a problem with
This line is triggered by #ifdef HAVE_SHIBOKEN2 and this is the first strange point. The second question is about pyside. Having installed shiboken6, I had to install also pyside6 How was this dependence incompatibility handled in the build of FC master ? |
I don't know how the LinkMerge branch handles it but in the official branch there is this line in Gui/CMakeLists.txt:
IIRC there was a name collision with the pyside6-tools package. I simply renamed the conflicting file.
It's not a FreeCAD issue at all but a msys issue. |
Thanks @wwmayer But the next question is how is it that the building of FreeCAD master was succesful without having installed pyside2 and pyside2-tools (because of the MSYS issue). This question holds also for the official build at https://packages.msys2.org/package/mingw-w64-ucrt-x86_64-freecad?repo=ucrt64. Perhaps MehdiChinoune, was able to build using only Qt6. In the first run I also tried this way but I had configuration errors (which now I don't remember). |
@wsteffe take a look at https://github.com/msys2/MINGW-packages/blob/317b892db/mingw-w64-freecad/PKGBUILD#L80 |
I had already passed this option because you suggested it in your previous post in this same thread. |
Is your MSYS2 up-to-date.
|
No sorry, now I have understood. I don't know why but I have reconfigured again inside the cmake-gui after cmd:
I think there is a problem in the cmake-gui because it has automatically set FREECAD_QT_VERSION="auto" overwriting the command line options. Now I have removed Qt5 (exept base,swg and multimedia which are required by opencascade) set FREECAD_QT_VERSION=6 in gui and the reconfiguration was completed without errors. |
shiboken & PySide is not a strict build dependency. If it's installed then by default (see also the option FREECAD_USE_SHIBOKEN and FREECAD_USE_PYSIDE) it tries to link the shared library but if it's not installed then it tries to load its Python modules at runtime. This is because shiboken provides a C++ and a Python API to convert between C++ and Python types. |
Hi @wwmayer, thanks for hint. In fact I have built LinkMerge branch (patched as in https://github.com/wsteffe/FreeCAD/tree/LinkMerge) using FREECAD_QT_VERSION=5 without SHIBOKEN. To do that I removed shiboken from my system and configured with:
But it would be better to set FREECAD_USE_SHIBOKEN=False in the comand line if possible. |
Hi @wwmayer, test.py
The dist/test.exe is executed without errors but when I want to make similar imports from the inside of klayout python parser I have to put all modules in the dist/_internal folder that is generated by pyinstaller. Also the subfolders of Mod/Part had to be moved up in this place (otherwise BOPTools module was not found). These changes fixed all imports but I am still having an error in the last line. test1.py
import pya is related with the klayout python interpeter. pya has to be imported in all klayout packages: The macro debugger gives the following error:
The problem could well be specific to klayout environment but perhaps you may have an idea of what could be missing. Klayout and FC were both built in the same environment (MSYS2/ucrt64). |
Hi @wwmayer, |
MSYS2 doesn't package forks when the original project is still maintained. |
Package name
FreeCAD Link
Brief description of package
It is the Link branch FreeCAD, with lots of new features and enhancement.
I need RT branch instead of master because I have to extrude multiple solids in a single body which is not allowed on FC master.
My layoutDD project which is an extension of klayout project (https://www.klayout.de/) imports python modules from FreeCAD LinkMerge fork. Currently it works on Linux but not on Windows platform because the python parser of klayout is built with Mingw64 and it is not compatible with windows realeses of FC (which are built with MS VS).
URL for package's homepage
https://github.com/realthunder/FreeCAD/tree/LinkMerge
Provide a basic test case to validate the package's functionality.
No response
MINGW environments where you need the package
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: