FreeCAD 0.18.4 fails to build with vtk 9.0

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Thu May 28, 2020 12:03 pm

We're working on upgrading Fedora Rawhide to vtk 9.0 and it looks like quite a bit has changed in this release.

Error:

Code: Select all

[  0%] Building CXX object
src/3rdParty/salomesmesh/CMakeFiles/Driver.dir/src/Driver/Driver_Mesh.cpp.o
cd /builddir/build/BUILD/FreeCAD-0.18.4/build/src/3rdParty/salomesmesh &&
/usr/bin/c++  -DCSFDB -DDriver_EXPORTS -DHAVE_CONFIG_H -DHAVE_LIMITS_H -DLIN
-DOCC_CONVERT_SIGNALS -D_OCC64 -I/builddir/build/BUILD/FreeCAD-0.18.4/build
-I/builddir/build/BUILD/FreeCAD-0.18.4/build/src
-I/builddir/build/BUILD/FreeCAD-0.18.4/src
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/Driver
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/DriverUNV
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/DriverDAT
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/DriverSTL
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/StdMeshers
-I/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc
-I/builddir/build/BUILD/FreeCAD-0.18.4/build/src/3rdParty/salomesmesh
-I/usr/include/opencascade -I/usr/include/med  -Wall -Wextra -Wno-write-strings
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-std=c++11 -D_OCC64 -Wno-sign-compare -Wno-reorder -Wno-switch
-Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment
-Wno-unused-parameter -fPIC   -o
CMakeFiles/Driver.dir/src/Driver/Driver_Mesh.cpp.o -c
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/Driver/Driver_Mesh.cpp
In file included from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_VtkVolume.hxx:26,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_Mesh.hxx:45,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:28:
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx:
In member function 'vtkCellLinks* SMDS_UnstructuredGrid::GetLinks()':
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_UnstructuredGrid.hxx:98:12:
error: invalid user-defined conversion from
'vtkSmartPointer<vtkAbstractCellLinks>' to 'vtkCellLinks*' [-fpermissive]
   98 |     return Links;
      |            ^~~~~
In file included from /usr/include/vtk/vtkGenericDataArray.h:73,
                 from /usr/include/vtk/vtkAOSDataArrayTemplate.h:36,
                 from /usr/include/vtk/vtkCellArray.h:141,
                 from /usr/include/vtk/vtkUnstructuredGrid.h:31,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_VtkEdge.hxx:30,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_Mesh.hxx:43,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:28:
/usr/include/vtk/vtkSmartPointer.h:188:3: note: candidate is:
'vtkSmartPointer<ArrayType>::operator T*() const [with T =
vtkAbstractCellLinks]' (near match)
  188 |   operator T*() const noexcept { return static_cast<T*>(this->Object);
}
      |   ^~~~~~~~
/usr/include/vtk/vtkSmartPointer.h:188:3: note:   no known conversion from
'vtkAbstractCellLinks*' to 'vtkCellLinks*'
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:
In member function 'bool SMDS_BallElement::ChangeNode(const SMDS_MeshNode*)':
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:72:38:
error: binding reference of type 'const vtkIdType*&' {aka 'const long long
int*&'} to 'vtkIdType*' {aka 'long long int*'} discards qualifiers
   72 |   grid->GetCellPoints(myVtkID, npts, pts);
      |                                      ^~~
In file included from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_VtkEdge.hxx:30,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_Mesh.hxx:43,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:28:
/usr/include/vtk/vtkUnstructuredGrid.h:196:75: note:   initializing argument 3
of 'void vtkUnstructuredGrid::GetCellPoints(vtkIdType, vtkIdType&, const
vtkIdType*&)'
  196 |   void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType
const*& pts)
      |                                                       
~~~~~~~~~~~~~~~~~~^~~
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:
In member function 'virtual const SMDS_MeshNode* SMDS_BallElement::GetNode(int)
const':
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:87:39:
error: binding reference of type 'const vtkIdType*&' {aka 'const long long
int*&'} to 'vtkIdType*' {aka 'long long int*'} discards qualifiers
   87 |   grid->GetCellPoints( myVtkID, npts, pts );
      |                                       ^~~
In file included from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_VtkEdge.hxx:30,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/inc/SMDS_Mesh.hxx:43,
                 from
/builddir/build/BUILD/FreeCAD-0.18.4/src/3rdParty/salomesmesh/src/SMDS/SMDS_BallElement.cpp:28:
/usr/include/vtk/vtkUnstructuredGrid.h:196:75: note:   initializing argument 3
of 'void vtkUnstructuredGrid::GetCellPoints(vtkIdType, vtkIdType&, const
vtkIdType*&)'
  196 |   void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType
const*& pts)
      |                                                       
~~~~~~~~~~~~~~~~~~^~~
make[2]: *** [src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/build.make:86:
src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_BallElement.cpp.o]
Error 1
https://bugzilla.redhat.com/show_bug.cgi?id=1840957

Thanks,
Richard
vocx
Posts: 5205
Joined: Thu Oct 18, 2018 9:18 pm

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby vocx » Thu May 28, 2020 4:37 pm

hobbes1069 wrote: Thu May 28, 2020 12:03 pm cd /builddir/build/BUILD/FreeCAD-0.18.4/build/src/3rdParty/salomesmesh &&
You should probably try with 0.19 only.
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
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Thu May 28, 2020 7:56 pm

Trying 0.19_pre from github I get the following:

Code: Select all

RCC: Error in '/builddir/build/BUILD/FreeCAD-0.19_pre/src/Mod/Draft/Resources/Draft.qrc': Cannot find file 'patterns/brick01'
Thanks,
Richard
mderouss
Posts: 7
Joined: Sun Mar 18, 2018 11:13 pm

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby mderouss » Thu May 28, 2020 10:32 pm

Hmmm. Weird. Strictly speaking, the file 'patterns/brick01' does *not* exist - the actual file is 'patterns/brick01.svg', and that's what is specified in the Draft.qrc file. Which leads me to ask, because there is an issue with this right now for 0.19 and Ubuntu and I know Fedora likes to live close to the edge ( :) ), which resource compiler ( from which version of which package ) do you believe is being invoked here ?
User avatar
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Fri May 29, 2020 1:20 am

I'm only working on Fedora Rawhide right now which is on Qt5 / PySide2 5.14.x...

I actually got the build completing now using straight master, but now I have a NEW issue...

It's been a wishlist for a long time to do a FHS compliant install but the install directories on FreeCAD are kind of borked which forced me to install everything into /usr/lib64/freecad, including the binaries, and symlink them back to /usr/bin.

It looks like there's been SOME changes to install to the correct directory, but the work is incomplete. The binaries and libraries ALMOST install to the correct location.

Binaries -> /usr/bin
Libraries -> /usr/lib64 (this is almost correct but since they are private libraries and some of the names are VERY generic, they should go into /usr/lib64/freecad)

But then data stuff like Mod just get dumped into /usr/share without being in a "freecad" subdirectory.

So now I'm back in install hell... But at least it builds!

Thanks,
Richard
User avatar
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Tue Jun 09, 2020 6:30 pm

I'm not having much luck building master, so before I keep hitting my head against the wall, do we even know if it's compatible with VTK 9.0?

Thanks,
Richard
vocx
Posts: 5205
Joined: Thu Oct 18, 2018 9:18 pm

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby vocx » Wed Jun 10, 2020 6:16 pm

hobbes1069 wrote: Tue Jun 09, 2020 6:30 pm ...do we even know if it's compatible with VTK 9.0?
It seems that you are using very new libraries, like Python 3.9 as well, so I don't think VTK9 is particularly tested. Most people around here use relatively conservative Debian libraries.
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
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Wed Jun 10, 2020 6:31 pm

vocx wrote: Wed Jun 10, 2020 6:16 pm
hobbes1069 wrote: Tue Jun 09, 2020 6:30 pm ...do we even know if it's compatible with VTK 9.0?
It seems that you are using very new libraries, like Python 3.9 as well, so I don't think VTK9 is particularly tested. Most people around here use relatively conservative Debian libraries.
Yes, it's part of "Fedora First" We have the latest GCC (10.1.1), Python, and soon, VTK.

It's rather a chicken and the egg problem isn't it? You need the library to port to it, but I need it ported before I can use it. :)

Perhaps I should just submit a bug request then as it doesn't appear to be getting much attention here.

Thanks,
Richard
vocx
Posts: 5205
Joined: Thu Oct 18, 2018 9:18 pm

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby vocx » Wed Jun 10, 2020 6:42 pm

hobbes1069 wrote: Wed Jun 10, 2020 6:31 pm ...
Perhaps I should just submit a bug request then as it doesn't appear to be getting much attention here.
Well, FreeCAD already has a ton of open bug reports but not enough programmers to look at them. So, it's better if you can try to solve the problem yourself instead of passing the burden to the developers. If you provide a pull request, it's bound to get more attention than a bug report in the tracker.
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
hobbes1069
Posts: 273
Joined: Wed Nov 09, 2011 3:49 pm
Location: Southaven, MS

Re: FreeCAD 0.18.4 fails to build with vtk 9.0

Postby hobbes1069 » Wed Jun 10, 2020 7:36 pm

Unfortunately I'm not much of a programmer and the changes appear to be significant.