Cylinder Example Cannot be Created by CMake

Your build log is free from errors. And you’re building all the main VTK libraries. Please, do a ninja install, go to the installation directory and report the outputs of these commands:
find -name *.h*
find -name *.so
find -name *.cmake
find -name *.a

I suspect that by enabling Python and Java wrappings, your installation directory is not adequate for C++ applications, hence the Cylinder example fails to build.

I think this configuration will result in an installation better suited for building the C++ examples:

cmake -GNinja \
  -S ./VTK-9.1.0 \
  -B ./vtk-build \
  -D CMAKE_INSTALL_PREFIX=/opt/hamzstlib/vtk91 \
  -D BUILD_SHARED_LIBS=ON \
  -D VTK_BUILD_EXAMPLES=ON \
  -D CMAKE_BUILD_TYPE=Release \
  -D VTK_ENABLE_WRAPPING=OFF \
  -D VTK_WRAP_JAVA=OFF \
  -D VTK_WRAP_PYTHON=OFF \
  -D VTK_USE_TK=ON \
  -D VTK_WHEEL_BUILD=OFF /opt/hamzstlib/VTK-9.1.0 

I also believe that by disabling wrappings, you will build VTK in ~2 hours instead of taking all day long.

Hi all,

thanks for the reply it is finally work. Someone gives me the instruction

Basically at the beginning, I activate python environment while do the building till installation. Install all needed Python packages as well for VTK.

Then I create personal directory named Kitware under /opt/hamzstlib/ with branches for src/ build/ install/
It will be like this:
/opt/hamzstlib/Kitware/build/VTK
/opt/hamzstlib/Kitware/install/VTK
/opt/hamzstlib/Kitware/src/VTK

The source will contain the latest VTK from the website (VTK-9.1.0) then build it using ccmake and then I do make install.

It is installed to /usr/local and since I know from your posts what should be in the VTK installation directory I just move everything that is VTK related to
/opt/hamzstlib/Kitware/install/VTK

Lastly, the most important so vtk-config.cmake can be found:
I set the environment variable by
export VTK_DIR=/opt/hamzstlib/Kitware/install/VTK/lib/cmake/vtk-9.1

Finally. Told you I never give up. Now I want to try all other examples. If I could maybe convert from C++ to Python for some examples… Good luck for me then…

Thank You all.


1 Like

Hi Sebastien,

I try this example, but it cannot work, do you know why?

It looks some late-bind library not being loaded/found. Particularly one that implements pointing device interaction. Are your VTK .so files in LD_LIBRARY_PATH, for instance?