Ticket #4145 - build failure with assembly module enabled

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
efferre
Posts: 41
Joined: Tue Jul 03, 2018 12:41 pm

Ticket #4145 - build failure with assembly module enabled

Post by efferre »

when building freecad using Genoo Linux I get the following error related to the Assembly module:

Code: Select all

[ 95%] Building CXX object src/Mod/TechDraw/Gui/CMakeFiles/TechDrawGui.dir/ViewProviderSymbol.cpp.o
cd /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999_build/src/Mod/TechDraw/Gui && /usr/bin/ccache /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H
 -DHAVE_LIMITS_H -DMOD_TECHDRAW_HANDLE_FACES=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_SVG_LIB
 -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DTechDrawGui_EXPORTS -D_OCC64 -I/var/tmp/portage/media-gfx/freecad-9999/work/freecad-
9999_build -I/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999_build/src -I/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src -I/var/tmp
/portage/media-gfx/freecad-9999/work/freecad-9999_build/src/Mod/TechDraw/Gui -I/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/TechDraw/G
ui -I/usr/include/coin -I/usr/include/python2.7 -I/usr/lib64/opencascade-7.3.0/ros/lin/inc -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtXmlPattern
s -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtXml -isystem /
usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtOpenGL -isystem /usr/include/qt5/QtPrintSupport -isystem /usr/include
/qt5/QtSvg -isystem /usr/include/qt5/QtUiTools -DNDEBUG -Wall -Wextra -Wno-write-strings -march=core2 -O2 -pipe -ggdb -fPIC -fPIC -std=gnu++11 -o CMake
Files/TechDrawGui.dir/ViewProviderSymbol.cpp.o -c /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/TechDraw/Gui/ViewProviderSymbol.cpp
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘void AssemblyGui::ViewProvid
erConstraintInternal::updateVis(const TopoDS_Shape&)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:85:23: error: no matching function for call to ‘A
ssemblyGui::ViewProviderConstraintInternal::updateVisual(const TopoDS_Shape&)’
     updateVisual(shape);
                       ^
In file included from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProvider.h:28,
                 from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.h:27,
                 from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:24:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProviderExt.h:150:10: note: candidate: ‘void PartGui::ViewProviderPartExt::u
pdateVisual()’
     void updateVisual();
          ^~~~~~~~~~~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProviderExt.h:150:10: note: candidate expects 0 arguments, 1 provided
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘virtual void AssemblyGui::Vi
ewProviderConstraint::setDisplayMode(const char*)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:110:57: warning: unused parameter ‘ModeName’ [-Wu
nused-parameter]
 void ViewProviderConstraint::setDisplayMode(const char* ModeName)
                                             ~~~~~~~~~~~~^~~~~~~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘void AssemblyGui::ViewProvid
erConstraint::draw()’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:255:20: error: no matching function for call to ‘AssemblyGui::ViewProviderConstraint::updateVisual(TopoDS_Shape&)’
     updateVisual(s1);
                    ^
In file included from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProvider.h:28,
                 from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.h:27,
                 from /var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:24:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProviderExt.h:150:10: note: candidate: ‘void PartGui::ViewProviderPartExt::updateVisual()’
     void updateVisual();
          ^~~~~~~~~~~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Part/Gui/ViewProviderExt.h:150:10: note: candidate expects 0 arguments, 1 provided
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘virtual void AssemblyGui::ViewProviderConstraint::onSelectionChanged(const Gui::SelectionChanges&)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:336:78: warning: unused parameter ‘msg’ [-Wunused-parameter]
 void ViewProviderConstraint::onSelectionChanged(const Gui::SelectionChanges& msg)
                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘virtual TopoDS_Shape AssemblyGui::ViewProviderConstraint::getConstraintShape(int)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:353:61: warning: unused parameter ‘link’ [-Wunused-parameter]
 TopoDS_Shape ViewProviderConstraint::getConstraintShape(int link)
                                                         ~~~~^~~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘virtual bool AssemblyGui::ViewProviderConstraint::setEdit(int)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:416:42: warning: unused parameter ‘ModNum’ [-Wunused-parameter]
 bool ViewProviderConstraint::setEdit(int ModNum)
                                      ~~~~^~~~~~
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp: In member function ‘virtual void AssemblyGui::ViewProviderConstraint::unsetEdit(int)’:
/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999/src/Mod/Assembly/Gui/ViewProviderConstraint.cpp:440:44: warning: unused parameter ‘ModNum’ [-Wunused-parameter]
 void ViewProviderConstraint::unsetEdit(int ModNum)
                                        ~~~~^~~~~~
make[2]: *** [src/Mod/Assembly/Gui/CMakeFiles/AssemblyGui.dir/build.make:182: src/Mod/Assembly/Gui/CMakeFiles/AssemblyGui.dir/ViewProviderConstraint.cpp.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-gfx/freecad-9999/work/freecad-9999_build'
make[1]: *** [CMakeFiles/Makefile2:4735: src/Mod/Assembly/Gui/CMakeFiles/AssemblyGui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
probably the build failure is related to the commit 6da72b9859f6d21119831d44a8d132c8e2dfb544 where someone left behind assembly module.

If the assembly module is deprecated probably it's better to remove it from the tree to avoid such kind of problems or by making it impossible to enable during configuration time.

I have opened also the ticket issue #4145
Last edited by Kunda1 on Wed Oct 02, 2019 1:41 am, edited 1 time in total.
Reason: Added ticket number to thread title
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: build failure with assembly module enabled

Post by vocx »

efferre wrote: Mon Sep 30, 2019 9:55 am when building freecad using Genoo Linux I get the following error related to the Assembly module:
...
probably the build failure is related to the commit 6da72b9859f6d21119831d44a8d132c8e2dfb544 where someone left behind assembly module.
...
I think git commit 6da72b9859 is part of the big merge of App::Link from realthunder.

I'm having trouble understanding what you are reporting.

First of all, according to your bug report, you have this version

Code: Select all

OS: Gentoo/Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16776 (Git)
Build type: Release
Branch: (HEAD detached at refs/git-r3/HEAD)
Hash: b547373f35c3fd2a12fca5035af575c835062056
Python version: 2.7.15
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
This isn't the most recent version. The current master branch has 1580 more commits than your version of the source. I just compiled this right now without errors.

Code: Select all

OS: Ubuntu 18.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18356 (Git)
Build type: Release
Branch: master
Hash: 12335c7d52376c140c5328d57902d2c0afdeb588
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
If the assembly module is deprecated probably it's better to remove it from the tree to avoid such kind of problems or by making it impossible to enable during configuration time.
...
The assembly workbench in the source code is basically old prototype code; it is right now a placeholder for when a real Assembly workbench is developed. However, it is completely deactivated currently; it is not built by default, and it has been like that for a long time. I've never had any compilation errors regarding assembly inside Mod/; therefore, I have to assume this is a problem with the way you are compiling, and not with FreeCAD itself.

Code: Select all

cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release ../freecad-source-vocx && make -j3
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
truf
Posts: 1
Joined: Fri Oct 18, 2019 7:04 pm

Re: Ticket #4145 - build failure with assembly module enabled

Post by truf »

I can confirm this the issue with the way we configure/compile FreeCAD
I'm also having Gentoo and tried to enable all the modules including disabled by default assembly :)
Once disabled that assembly module i see no issues with compilation
efferre
Posts: 41
Joined: Tue Jul 03, 2018 12:41 pm

Re: build failure with assembly module enabled

Post by efferre »

vocx wrote: Mon Sep 30, 2019 3:54 pm
efferre wrote: Mon Sep 30, 2019 9:55 am when building freecad using Genoo Linux I get the following error related to the Assembly module:
...
probably the build failure is related to the commit 6da72b9859f6d21119831d44a8d132c8e2dfb544 where someone left behind assembly module.
...
I think git commit 6da72b9859 is part of the big merge of App::Link from realthunder.

I'm having trouble understanding what you are reporting.

First of all, according to your bug report, you have this version

Code: Select all

OS: Gentoo/Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16776 (Git)
Build type: Release
Branch: (HEAD detached at refs/git-r3/HEAD)
Hash: b547373f35c3fd2a12fca5035af575c835062056
Python version: 2.7.15
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
I am sorry for the latency but I didn't receive any notification about your reply :-(

I have tested today updating from the repository (commit e583b2a468c09ec11b5e1287ff94fd8914b824dc) so I am updated. The result is the same and the error is identical to the one reported at the beginning. I am using gcc 8.3.0
vocx wrote: Mon Sep 30, 2019 3:54 pm
The assembly workbench in the source code is basically old prototype code; it is right now a placeholder for when a real Assembly workbench is developed. However, it is completely deactivated currently; it is not built by default, and it has been like that for a long time. I've never had any compilation errors regarding assembly inside Mod/; therefore, I have to assume this is a problem with the way you are compiling, and not with FreeCAD itself.
Ok, if it's kept as a reference I would say it must at least compile successfully :-) In the past I have already sent a pull request to fix build problems when the assembly module option is activated, in this case the issue is out of my knowledge and I am not able to fix it by myself.

I have not problems in compiling freecad, the building process only fails with -DBUILD_ASSEMBLY=ON (which is by default disabled as you say above).
vocx wrote: Mon Sep 30, 2019 3:54 pm

Code: Select all

cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Release ../freecad-source-vocx && make -j3
What happens if you insert also the -DBUILD_ASSEMBLY=ON option to your flags? Which compiler version are you using?
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Ticket #4145 - build failure with assembly module enabled

Post by ezzieyguywuf »

efferre wrote: Mon Dec 02, 2019 10:18 am Ok, if it's kept as a reference I would say it must at least compile successfully
I agree with this: if the user is able to select a portion of the code base in the build system, then it should compile.

If the only reason to keep the code is for reference, then we should remove the BUILD_ASSEMBLY cmake variable altogether, so that it is impossible to try and compile this old code.
truf wrote: Fri Oct 18, 2019 8:19 pm I'm also having Gentoo
Who knew there were so many of us gentoo users around!

This is off-topic, but I’ve been toying with and compiling freecad In gentoo for years now, so if you have any issues or questions please feel free to reach out via ping or dm
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: build failure with assembly module enabled

Post by vocx »

efferre wrote: Mon Dec 02, 2019 10:18 am Ok, if it's kept as a reference I would say it must at least compile successfully ...
No. Do not compile the Assembly workbench. It doesn't work. I don't understand why you try to compile it. It hasn't been updated or maintained by anybody in ages. You don't need to do anything with it. Unless you are going to pick it apart to learn more about the code, there is no point in using it. Just leave it there.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: build failure with assembly module enabled

Post by waebbl »

vocx wrote: Tue Dec 03, 2019 12:52 am
efferre wrote: Mon Dec 02, 2019 10:18 am Ok, if it's kept as a reference I would say it must at least compile successfully ...
No. Do not compile the Assembly workbench. It doesn't work. I don't understand why you try to compile it. It hasn't been updated or maintained by anybody in ages. You don't need to do anything with it. Unless you are going to pick it apart to learn more about the code, there is no point in using it. Just leave it there.
I'm maintaining a gentoo build script for freecad for some time. I also have an option for users to enable them building with assembly workbench enabled. This is so, simply because the cmake files list an option for it. I'm now going to disable the option for gentoo users in my build script.

In this point I totally agree with @efferre that it should compile, if the cmake file lists an option for it. A new user who is just downloading the source code and trying to compile it, doesn't know, the code for assembly being there just for reference and might enable it, if interested in having a version with as much functionality enabled as possible.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: build failure with assembly module enabled

Post by vocx »

waebbl wrote: Mon Dec 23, 2019 5:37 pm ... if interested in having a version with as much functionality enabled as possible.
This makes no sense. The default CMake configuration already provides the most common and complete configuration.

Trying to activate all options without knowing what they do doesn't make sense. It's like trying to install every single package in a Linux repository. It's crazy.

You want to change the situation? Then you are welcome to fix the assembly workbench and make it compile with a current system. None of the other developers have enough interest in changing the situation, so they haven't done it already.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: build failure with assembly module enabled

Post by waebbl »

vocx wrote: Mon Dec 23, 2019 7:01 pm
waebbl wrote: Mon Dec 23, 2019 5:37 pm ... if interested in having a version with as much functionality enabled as possible.
This makes no sense. The default CMake configuration already provides the most common and complete configuration.
It makes sense on a Gentoo system, where users have the option to enable or disable specific features / options for packages they wish to install. It's freedom of choice for the user. That's what Gentoo stands for.
It's up to the build system, both the upstream build system, as well as the gentoo side of the build to ensure the package can be built using the desired options. For the assembly option, I chose to disable it until there's an update to it upstream, as I alreday noted.
vocx wrote: Mon Dec 23, 2019 7:01 pm You want to change the situation? Then you are welcome to fix the assembly workbench and make it compile with a current system. None of the other developers have enough interest in changing the situation, so they haven't done it already.
I do not want to change the situation. I'm not a FreeCAD developer and don't care a lot about this specific situation. I only care about the build and that the package can be delivered to the user, the way he or she likes it. BTW, if none of the developers currently care about the assembly workbench, what's the meaning of having an option for it in the cmake file? This option should be commented out until the workbench is back in a working state. At least a pointer noting that it doesn't build would be meaningful.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: Ticket #4145 - build failure with assembly module enabled

Post by waebbl »

BTW, I can disable the option, or add a comment to the cmakefile fragment and prepare a PR if it's desired.
Post Reply