Cylinder Example Cannot be Created by CMake

Actually I have to do ninja -j4 first to compile, then do ninja install afterwards. Still no luck. There is no lib folder, only vtkmodules, build, vtk-9.1.0.data folder and vtk.py in the installation folder.

Is there any other way to build or install VTK in Unix environment?
How about download VTK? it is it better to git clone the repository?

That’s odd.

That’s the way supposed to work.

No, that’s the way to clone it.

It seems to me that something is wrong during VTK build. Can you share the build messages log? Please, do a ninja -j4 >>vtk_build.log 2>&1 from your VTK build directory and share the vtk_build.log file here.

Before trying to log the build, can you try to compile the distributed source? https://www.vtk.org/files/release/9.1/VTK-9.1.0.tar.gz instead of cloning the GitHub repository? Maybe the repository clone is intended to VTK developers and not to end users.

Hi Paulo Carvalho,

I try 3 times from downloading VTK-9.1.0 from
https://www.vtk.org/files/release/9.1/VTK-9.1.0.tar.gz

I compile that distributed source with CMake using Ninja and Make and still no lib folder at the installation folder.
I have browse the installation folder the /opt/hamzstlib/Vtk9, the libraries with extensions .so exist deep inside the build and vtkmodules folder.

I will build the VTK-9.1.0 again and create the build.log then I will share it here. Wait for it. I am building VTK from git repository now. If it is not working then I rebuild the VTK-9.1.0 from the release source.

1 Like

Did you run ninja install from the build folder?

Yes I run ninja install.

Tell me Aron, or screenshot the installation folder of your VTK if you have time. Your installation folder what is the files and folder inside it. Are you using VTK-9.1.0 too? or build from git repo?

Files in my installation folders are buried deep inside folders, vtkmodules containing .so files and some .dir as well, no VTKConfig.make file. Maybe this is the problem.

Thank You

Did you run ninja and then ninja install?

Yes I run ninja and then ninja install

can anyone here tell me what is supposed to be inside the installation folder?
I will share the build log after the building is finish. It took 8 hours and more

curl -O https://vtk.org/files/release/9.1/VTK-9.1.0.tar.gz
tar xvfz VTK-9.1.0.tar.gz
cmake \
  -G Ninja \
  -S ./VTK-9.1.0 \
  -B ./vtk-build \
  -D CMAKE_BUILD_TYPE=Release \
  -D VTK_ENABLE_WRAPPING=ON \
  -D VTK_WRAP_PYTHON=ON

 cmake --build ./vtk-build
 cmake --install ./vtk-build --prefix ./vtk-install

Then you can build an example like

cmake \
   -G Ninja \
   -S ./VTK-9.1.0/Examples/DataManipulation/Cxx \
   -B ./vtk-example \
   -D VTK_DIR=$PWD/vtk-build

cmake --build ./vtk-example

Or from the install tree

cmake \
   -G Ninja \
   -S ./VTK-9.1.0/Examples/DataManipulation/Cxx \
   -B ./vtk-example \
   -D VTK_DIR=$PWD/vtk-install/lib/cmake/vtk-9.1

cmake --build ./vtk-example

bin/ include/ lib/ share/

These four directories have lots of files and subdirectory themselves. bin/ has the runtime libraries (.so files) and some utility executables; include/ has the .h files; /lib has, among other files, the link-time libraries (.a files) and CMake library find scripts (find*.cmake files) and, finally, share/ has some auxiliary files that need to be distributed as well (e.g. license files).

For me, on a fresh install, it is :

turlais@smth INST]$ ls
bin include lib64 share

turlais@smth INST]$ ls lib64/cmake/
vtk-9.1

Using lib64 in VTK_DIR or creating a symbolic link ( ln -s lib64 lib )
works.

system Fedora release 35

cmake version 3.22.2

Hi Paulo,
I just finish building with this script (you can see the screenshot of my vtk-build folder that has been built below):

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

It create vtk-build folder inside /opt/hamzstlib directory, then I run:
cmake --build ./vtk-build
then from /opt/hamzstlib directory, I run this:
cmake --install ./vtk-build --prefix ./vtk91
The result is still the same build directory, vtk.py, vtk-9.1.0.data directory, and vtkmodules directory.


1vtk2

Weird that your installation folder with Paulo Carvalho is the same.

Now why mine is like this? Can you share your building and installation scripts when you install it using Cmake?

Fedora is a great OS btw.

Hi Sebastien,

I follow your scripts, this is the installation folders, why is it different than it is supposed to? and I still cannot build example too.


Uploading: 1vtkinstall2.png…

For the example, it still cannot work, I do not know where to link VTK_DIR because there is no VTKConfig.cmake nor vtk-config.cmake within the installation directory.
Should I link VTK_DIR to the installation folder or the build folder? which directory or path for this VTK_DIR for my case ?

What is your OS and your building and installation scripts to get the:

bin/ include/ lib/ share/

I am trying to create the build.log now.

Hi Paulo,

I have created the build.log from ninja -j4

here is the link:
https://raw.githubusercontent.com/glanzkaiser/glanzshamzs/main/vtk_build.log

Hope you can figure it out and help me install VTK.
Thank You