stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.39k stars 854 forks source link

Problems with the build #912

Closed lucaAnza closed 8 months ago

lucaAnza commented 8 months ago

After i execute this scripts

# Get Pangolin
cd ~/your_fav_code_directory
git clone --recursive https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin

# Install dependencies (as described above, or your preferred method)
./scripts/install_prerequisites.sh recommended

# Configure and build
cmake -B build
cmake --build build

# with Ninja for faster builds (sudo apt install ninja-build)
cmake -B build -GNinja
cmake --build build

# GIVEME THE PYTHON STUFF!!!! (Check the output to verify selected python version)
cmake --build build -t pypangolin_pip_install

# Run me some tests! (Requires Catch2 which must be manually installed on Ubuntu.)
cmake -B build -G Ninja -D BUILD_TESTS=ON
cmake --build build
cd build
ctest

It returns this error:

CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
[  6%] Built target pango_core
[ 13%] Built target pango_image
[ 19%] Built target pango_opengl
[ 23%] Built target pango_windowing
[ 24%] Built target pango_vars
[ 30%] Built target pango_display
[ 31%] Built target tinyobj
[ 33%] Built target pango_geometry
[ 34%] Built target pango_glgeometry
[ 36%] Built target pango_packetstream
[ 38%] Built target pango_plot
[ 53%] Built target pango_video
[ 65%] Built target pango_python
[ 66%] Built target pango_scene
[ 67%] Built target pango_tools
[ 79%] Built target pypangolin
[ 80%] Built target tutorial_1_gl_intro_classic_triangle
[ 81%] Built target tutorial_1_gl_intro_pango_triangle
[ 82%] Built target tutorial_2_gl_intro_classic_triangle_vbo
[ 83%] Built target tutorial_2_gl_intro_pango_triangle_vbo
[ 84%] Built target tutorial_3_gl_intro_classic_triangle_vbo_shader
[ 85%] Built target tutorial_3_gl_intro_pango_triangle_vbo_shader
[ 86%] Built target tutorial_4_gl_intro_viewport
[ 87%] Built target tutorial_5_gl_intro_view_transforms
[ 87%] Built target HelloPangolin
[ 88%] Built target SimpleDisplay
[ 89%] Built target SimpleMultiDisplay
[ 90%] Built target SimpleDisplayImage
[ 91%] Built target SimplePlot
[ 92%] Built target SimpleVideo
[ 93%] Built target SimpleRecord
[ 94%] Built target HelloPangolinOffscreen
[ 94%] Built target SimpleScene
[ 95%] Built target VideoConvert
[ 96%] Built target VideoJsonPrint
[ 97%] Built target VideoJsonTransform
[ 98%] Built target Plotter
[ 99%] Built target VideoViewer
[100%] Built target ModelViewer
[  9%] Built target pango_core
[ 21%] Built target pango_image
[ 31%] Built target pango_opengl
[ 37%] Built target pango_windowing
[ 39%] Built target pango_vars
[ 49%] Built target pango_display
[ 52%] Built target pango_packetstream
[ 55%] Built target pango_plot
[ 80%] Built target pango_video
[100%] Built target pypangolin
[100%] Built target pypangolin_wheel
[100%] Installing for selected Python '/usr/bin/python3.10'
/usr/bin/python3.10: No module named pip
gmake[3]: *** [CMakeFiles/pypangolin_pip_install.dir/build.make:71: CMakeFiles/pypangolin_pip_install] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:957: CMakeFiles/pypangolin_pip_install.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:964: CMakeFiles/pypangolin_pip_install.dir/rule] Error 2
gmake: *** [Makefile:390: pypangolin_pip_install] Error 2
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
[  6%] Built target pango_core
[ 13%] Built target pango_image
[ 19%] Built target pango_opengl
[ 23%] Built target pango_windowing
[ 24%] Built target pango_vars
[ 30%] Built target pango_display
[ 31%] Built target tinyobj
[ 33%] Built target pango_geometry
[ 34%] Built target pango_glgeometry
[ 36%] Built target pango_packetstream
[ 38%] Built target pango_plot
[ 53%] Built target pango_video
[ 65%] Built target pango_python
[ 66%] Built target pango_scene
[ 67%] Built target pango_tools
[ 79%] Built target pypangolin
[ 80%] Built target tutorial_1_gl_intro_classic_triangle
[ 81%] Built target tutorial_1_gl_intro_pango_triangle
[ 82%] Built target tutorial_2_gl_intro_classic_triangle_vbo
[ 83%] Built target tutorial_2_gl_intro_pango_triangle_vbo
[ 84%] Built target tutorial_3_gl_intro_classic_triangle_vbo_shader
[ 85%] Built target tutorial_3_gl_intro_pango_triangle_vbo_shader
[ 86%] Built target tutorial_4_gl_intro_viewport
[ 87%] Built target tutorial_5_gl_intro_view_transforms
[ 87%] Built target HelloPangolin
[ 88%] Built target SimpleDisplay
[ 89%] Built target SimpleMultiDisplay
[ 90%] Built target SimpleDisplayImage
[ 91%] Built target SimplePlot
[ 92%] Built target SimpleVideo
[ 93%] Built target SimpleRecord
[ 94%] Built target HelloPangolinOffscreen
[ 94%] Built target SimpleScene
[ 95%] Built target VideoConvert
[ 96%] Built target VideoJsonPrint
[ 97%] Built target VideoJsonTransform
[ 98%] Built target Plotter
[ 99%] Built target VideoViewer
[100%] Built target ModelViewer
*********************************
No test configuration file found!
*********************************
Usage

  ctest [options]

I am actually using Linux Mint 21.3

christian-rauch commented 8 months ago

The error is shown in the first three lines:

CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

The code block in the documentation is not a script and you are not supposed to run all the commands. You have to decide if you want to build with the default generator:

cmake -B build
cmake --build build

or use Ninja:

cmake -B build -GNinja
cmake --build build

Can you build Pangolin if you only run either of those commands?

lucaAnza commented 8 months ago

When i use cmake -B build it prints.

-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- libtiff Found and Enabled
-- libopenexr Found and Enabled
-- Found Eigen: '/usr/include/eigen3'
CMake Deprecation Warning at components/pango_python/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- pybind11 v2.10.2 
-- Python module `setuptools` required for correct wheel filename generation. Please install if needed.
-- Selected Python: '/usr/bin/python3.10'. cmake --build . -t pypangolin_pip_install to use pypangolin module.
-- libdc1394 Found and Enabled
-- V4L Found and Enabled
-- ffmpeg Found and Enabled: /usr/include/x86_64-linux-gnu;/usr/include/x86_64-linux-gnu;/usr/include/x86_64-linux-gnu;/usr/include/x86_64-linux-gnu;/usr/include/x86_64-linux-gnu
-- Configuring done (0.2s)
-- Generating done (0.1s)
-- Build files have been written to: /home/luke/Desktop/Pangolin/build

then when i type cmake --build build it prints.

[  6%] Built target pango_core
[ 13%] Built target pango_image
[ 19%] Built target pango_opengl
[ 23%] Built target pango_windowing
[ 24%] Built target pango_vars
[ 30%] Built target pango_display
[ 31%] Built target tinyobj
[ 33%] Built target pango_geometry
[ 34%] Built target pango_glgeometry
[ 36%] Built target pango_packetstream
[ 38%] Built target pango_plot
[ 53%] Built target pango_video
[ 65%] Built target pango_python
[ 66%] Built target pango_scene
[ 67%] Built target pango_tools
[ 79%] Built target pypangolin
[ 80%] Built target tutorial_1_gl_intro_classic_triangle
[ 81%] Built target tutorial_1_gl_intro_pango_triangle
[ 82%] Built target tutorial_2_gl_intro_classic_triangle_vbo
[ 83%] Built target tutorial_2_gl_intro_pango_triangle_vbo
[ 84%] Built target tutorial_3_gl_intro_classic_triangle_vbo_shader
[ 85%] Built target tutorial_3_gl_intro_pango_triangle_vbo_shader
[ 86%] Built target tutorial_4_gl_intro_viewport
[ 87%] Built target tutorial_5_gl_intro_view_transforms
[ 87%] Built target HelloPangolin
[ 88%] Built target SimpleDisplay
[ 89%] Built target SimpleMultiDisplay
[ 90%] Built target SimpleDisplayImage
[ 91%] Built target SimplePlot
[ 92%] Built target SimpleVideo
[ 93%] Built target SimpleRecord
[ 94%] Built target HelloPangolinOffscreen
[ 94%] Built target SimpleScene
[ 95%] Built target VideoConvert
[ 96%] Built target VideoJsonPrint
[ 97%] Built target VideoJsonTransform
[ 98%] Built target Plotter
[ 99%] Built target VideoViewer
[100%] Built target ModelViewer

I can't understand if it is build correctly. And i don't know how to see if it works. Thank you for the support!

christian-rauch commented 8 months ago

You should probably look up some documentation about how to use CMake etc.

The last lines in the log show you that a couple of executables have been built, e.g. SimpleDisplay. They are somewhere in your build folder. Try ./build/examples/SimpleDisplay/SimpleDisplay.

I am closing this since there is no issue with building Pangolin.