I followed the VTK documentation step by step to build VTK on Ubuntu 22.04.
Here are the required packages
I am using the v9.4.0 branch.
When I configure with ccmake
(using all default build options), it fails to generate build.ninja, preventing VTK from being built.
ccmake -GNinja ..
cmake --build .
ninja: error: loading 'build.ninja': No such file or directory
Below is the error log:
CMakeError.log (99.4 KB)
However, under the same conditions, if I use cmake
instead, the same error log appears, but the compilation can still proceed.
cmake -GNinja ..
cmake --build .
So, the question is whether I need to be concerned about this error log. Will it affect the libraries I compile?
mwestphal
(Mathieu Westphal (Kitware))
2
I do not see CMake error anywhere in your message or shared log. Can you share it ?
In the shared log file
cc: error: unrecognized command-line option '-Weverything'
gmake[1]: *** [CMakeFiles/cmTC_c0167.dir/build.make:78: CMakeFiles/cmTC_c0167.dir/src.c.o] Error 1
c++: error: unrecognized command-line option '-wd4251'
gmake[1]: *** [CMakeFiles/cmTC_6eb96.dir/build.make:78: CMakeFiles/cmTC_6eb96.dir/src.cxx.o] Error 1
c++: error: unrecognized command-line option '-EHsc'
gmake[1]: *** [CMakeFiles/cmTC_271f3.dir/build.make:78: CMakeFiles/cmTC_271f3.dir/src.cxx.o] Error 1
vtk-9.4.0/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx:53:13: error: ‘environ’ was not declared in this scope; did you mean ‘union’?
gmake[1]: *** [CMakeFiles/cmTC_39a0c.dir/build.make:78: CMakeFiles/cmTC_39a0c.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
vtk-9.4.0/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx:26:15: error: ‘struct stat’ has no member named ‘st_mtimespec’
gmake[1]: *** [CMakeFiles/cmTC_ca061.dir/build.make:78: CMakeFiles/cmTC_ca061.dir/kwsysPlatformTestsCXX.cxx.o] Error 1
mwestphal
(Mathieu Westphal (Kitware))
4
Then do not add these command line options.
But my operation was only limited to git clone
and ccmake
, all the rest are based on the Makefile provided by VTK
where can I find these command line options!!
mwestphal
(Mathieu Westphal (Kitware))
6
This is coming from your environnement, not from VTK.
Check your .bashrc
or .bash_profile
I found that I need to configure multiple times (press ‘c’), then it will suddenly be able to generate the build.ninja (press ‘g’).
@mwestphal Thanks for your help!
I also want to confirm one thing: has the VTK_OPENGL_USE_GLES
parameter been deprecated in version 9.4.0? I can’t find it in ccmake
.
mwestphal
(Mathieu Westphal (Kitware))
9
Thats a @jaswantp question
jaswantp
(Jaswant Panchumarti (Kitware))
10
Ah, the option got discarded for unix because of a change that went in. You can still add a new entry on the command line. I’ll push a fix for that.