[0.19.2] Improve finding vtk-9

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

[0.19.2] Improve finding vtk-9

Post by waebbl »

Based on a bug report in Gentoo Bugzilla (https://bugs.gentoo.org/797700), I did some research on the issue. Although I couldn't reproduce this issue, I found some (minor) issues when configuring internal smesh. The patchset from https://github.com/wwmayer/FreeCAD/comm ... 0f7e25a9ff has been applied. This request is only for configuring against VTK-9, compilation succeeds on my tests, if the patch from @wmayer is applied.

The configuration step contains the output

Code: Select all

[...]
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- VTK components: not found or used
[...]
-- OCC:                 7.5.2 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TK
Bool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP;TKHLR;
TKFeat] [/usr/lib64/opencascade-7.5.2] [/usr/include/opencascade-7.5.2]
-- SMESH:               build internal
--  MEDFile:            [/usr/lib64/libmedC.so;/usr/lib64/libmed.so] [/usr/include]
--  HDF5:               1.10.5
--  VTK:                9.0.1
indicating, the general find_package call in SetupSalomeSMESH.cmake is called, instead of the individual calls using components[1]. The source for this seems to be test for VTK_MODULES_ENABLED in [2]. This variable is no longer avaiable in vtk-config.cmake for VTK-9. Instead this config file uses the variable ${CMAKE_FIND_PACKAGE_NAME}_AVAILABLE_COMPONENTS, i.e. VTK_AVAILABLE_COMPONENTS to test for each component.

Additionally a warning is shown for the names of the components with VTK-9. With this version, the vtk prefix for component names is no longer given, which gives a deprecation warning during configuration.

Code: Select all

-- Found OpenGLU: /usr/lib64/libGLU.so
CMake Deprecation Warning at /usr/lib64/cmake/vtk-9.0/vtk-config.cmake:64 (message):
  The new name for the 'vtkCommonCore' component is 'CommonCore'
Call Stack (most recent call first):
  cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:29 (find_package)
  CMakeLists.txt:53 (SetupSalomeSMESH)
I'm going to prepare a PR to improve on this. Feel free to refuse accepting it, if you think this isn't necessary.

[1] https://github.com/FreeCAD/FreeCAD/blob ... ke#L40-L46
[2] https://github.com/FreeCAD/FreeCAD/blob ... .cmake#L32
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: [0.19.2] Improve finding vtk-9

Post by waebbl »

Post Reply