some vtk-modules not available in conda-forge vtk

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
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

some vtk-modules not available in conda-forge vtk

Post by looo »

Code: Select all

CMake Error at /home/lo/miniconda3/conda-bld/FreeCAD_1482828307657/_b_env_placehold_placehold_p/lib/cmake/vtk-7.0/vtkModuleAPI.cmake:120 (message):
  Requested modules not available:

    vtkIOMPIParallel
    vtkParallelMPI
Call Stack (most recent call first):
  /home/lo/miniconda3/conda-bld/FreeCAD_1482828307657/_b_env_placehold_placehold_p/lib/cmake/vtk-7.0/VTKConfig.cmake:88 (vtk_module_config)
  CMakeLists.txt:619 (find_package)
Is this used anywhere? If not, can we exclude it?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: some vtk-modules not available in conda-forge vtk

Post by looo »

maybe switching the search paths here would solve this.

ps.: removing the system-vtk (which in my case was version 6) also solves this issue.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: some vtk-modules not available in conda-forge vtk

Post by wmayer »

The cmake handling of vtk is weird.

At the beginning we only checked for the vtk library as a whole without checking for specific components. This caused problems (on Debian) when the vtk component for the GUI binding is linked against Qt5 while FreeCAD is built against Qt4.

To solve this issue we started to check for only certain components. This however lead to build errors of smesh because the include path didn't include the hdf5 stuff any more. The problem is that on some platforms vtkIOMPIParallel, vtkParallelMPI or vtkhdf5 is required while on other platform these components do not even exist.

So, to solve this problem it is checked if a corresponding cmake file exists and if yes the module is appended.

Now the new problem is that you had installed vtk6 and 7. FreeCAD is supposed to link against vtk7 but the above mechanism finds the cmake files of vtk6 which don't exist for vtk7 any more.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: some vtk-modules not available in conda-forge vtk

Post by wmayer »

In this file https://www.apt-browse.org/browse/ubunt ... nfig.cmake I found the variable VTK_MODULES_ENABLED that lists all available vtk modules.

Now it's possible to check this list if a module is available instead of directly checking path names. Can you try if you replace the corresponding block in the cmake file with:

Code: Select all

        # check which modules are available
        if(UNIX AND NOT APPLE)
            find_package(VTK COMPONENTS vtkCommonCore REQUIRED NO_MODULE)
            list(APPEND VTK_COMPONENTS vtkIOMPIParallel vtkParallelMPI vtkhdf5)
            foreach(_module ${VTK_COMPONENTS})
                list (FIND VTK_MODULES_ENABLED ${_module} _index)
                if (${_index} GREATER -1)
                    list(APPEND AVAILABLE_VTK_COMPONENTS ${_module})
                endif()
            endforeach()
        endif()
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: some vtk-modules not available in conda-forge vtk

Post by ulrich1a »

I am now getting the following error on Debian with a self compiled VTK 7:

Code: Select all

CMakeFiles/FemGui.dir/TaskPostBoxes.cpp.o: In function `vtkRenderingCore_AutoInit::~vtkRenderingCore_AutoInit()':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Destruct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Destruct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Destruct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Destruct()'
CMakeFiles/FemGui.dir/TaskPostBoxes.cpp.o: In function `vtkRenderingCore_AutoInit':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Construct()'
CMakeFiles/FemGui.dir/AppFemGui.cpp.o: In function `vtkRenderingCore_AutoInit':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Construct()'
CMakeFiles/FemGui.dir/ViewProviderFemPostObject.cpp.o: In function `vtkRenderingCore_AutoInit':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Construct()'
CMakeFiles/FemGui.dir/ViewProviderFemPostPipeline.cpp.o: In function `vtkRenderingCore_AutoInit':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Construct()'
CMakeFiles/FemGui.dir/ViewProviderFemPostFilter.cpp.o: In function `vtkRenderingCore_AutoInit':
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkInteractionStyle_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingFreeType_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL_AutoInit_Construct()'
/usr/local/include/vtk-7.0/vtkRenderingCoreModule.h:41: undefined reference to `vtkRenderingOpenGL2_AutoInit_Construct()'
collect2: error: ld returned 1 exit status
src/Mod/Fem/Gui/CMakeFiles/FemGui.dir/build.make:2317: recipe for target 'Mod/Fem/FemGui.so' failed
make[2]: *** [Mod/Fem/FemGui.so] Error 1
CMakeFiles/Makefile2:3631: recipe for target 'src/Mod/Fem/Gui/CMakeFiles/FemGui.dir/all' failed
make[1]: *** [src/Mod/Fem/Gui/CMakeFiles/FemGui.dir/all] Error 2
Ulrich
Post Reply