stevenlovegrove / Pangolin

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

Missing dependency in install_prerequisites.sh #962

Open hseysen opened 6 days ago

hseysen commented 6 days ago

I'm on a fresh Ubuntu 22.04 install, and I pulled the repository, ran ./scripts/install_prerequisites.sh recommended. After this, trying to build was unsuccessful, I additionally installed python3-dev python3-pip python3-venv, and then the cmake -B build command succeeded. I think the script needs an update.

christian-rauch commented 5 days ago

After this, trying to build was unsuccessful

Can you provide more details?

I think the script needs an update.

With the few pieces of information given, this is hard to determine.

Since the CI passes, all dependencies should be satisfied. If you can reproduce this on the CI or provide more details to reproduce this, I can have a look at this.

hseysen commented 3 days ago

Here are the issues I face when cloning and building the repository on a fresh (did nothing but install ubuntu-drivers and git to clone the repository) Ubuntu 22.04 installed on my machine:

~/git/Pangolin$ cmake -B build
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/user/git/Pangolin/build/CMakeFiles/CMakeOutput.log".

Solved it by running sudo apt-get install build-essential Then running it again:

~/git/Pangolin$ cmake -B build
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- Found Eigen: '/usr/include/eigen3'
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL EGL 
-- Found epoxy: /usr/lib/x86_64-linux-gnu/libepoxy.so (found version "1.5.10") 
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Development
  Development.Module Development.Embed) (found version "3.10.12")
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindPython/Support.cmake:3180 (find_package_handle_standard_args)
  /usr/share/cmake-3.22/Modules/FindPython3.cmake:490 (include)
  components/pango_python/CMakeLists.txt:9 (find_package)
  CMakeLists.txt:111 (include)

-- Configuring incomplete, errors occurred!
See also "/home/user/git/Pangolin/build/CMakeFiles/CMakeOutput.log".

Then I ran sudo apt-get install python3-dev and tried again:

~/git/Pangolin$ cmake -B build
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- Found Eigen: '/usr/include/eigen3'
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed 
-- pybind11 v2.13.6 
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
No module named 'setuptools'. Search paths:

  /usr/lib/python310.zip
  /usr/lib/python3.10
  /usr/lib/python3.10/lib-dynload
  /usr/local/lib/python3.10/dist-packages
  /usr/lib/python3/dist-packages
CMake Error at cmake/MakePythonWheel.cmake:26 (message):
  Python module `setuptools` required for correct wheel filename generation.
Call Stack (most recent call first):
  components/pango_python/CMakeLists.txt:91 (MakeWheel)
  CMakeLists.txt:111 (include)

-- Configuring incomplete, errors occurred!
See also "/home/user/git/Pangolin/build/CMakeFiles/CMakeOutput.log".

Then I ran sudo apt-get install python3-pip and tried again:

~/git/Pangolin$ cmake -B build
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- Found Eigen: '/usr/include/eigen3'
-- pybind11 v2.13.6 
-- Selected Python: '/usr/bin/python3.10'. cmake --build . -t pypangolin_pip_install to use pypangolin module.
-- V4L Found and Enabled
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION - Success
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2 - Success
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT - Success
-- 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
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'wayland-egl'
--   Found wayland-egl, version 18.1.0
-- Checking for module 'wayland-cursor'
--   Found wayland-cursor, version 1.20.0
-- Checking for module 'xkbcommon'
--   Found xkbcommon, version 1.4.0
-- Found Threads: TRUE  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: OpenGL 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components: EGL 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/git/Pangolin/build
christian-rauch commented 3 days ago

So what is the error? CMake tells you Build files have been written to which means that the build files have been generated successfully. There is no error. The dependencies you install manually are required and installed automatically if you follow the instructions.

hseysen commented 3 days ago

There is no error. The dependencies you install manually are required and installed automatically if you follow the instructions.

As I mentioned earlier, I indeed followed the instructions and ran the script that installs the prerequisites. The fact that the packages were not installed automatically and user needs to manually do additional installations is the issue in my opinion.

christian-rauch commented 3 days ago

The dependencies you installed manually are for optional features. They are only required if you use those features. Have a look at the documentation https://github.com/stevenlovegrove/Pangolin?tab=readme-ov-file#dependencies. You can install the recommended or all set of packages. If you only install the recommended packages, and not those for optional features, and you still want to use the optional features, then of course you have to install the remaining dependencies manually. But as per documentation, I would also just suggest running install_prerequisites with all to "install all packages". This is what the CI does to build and test all features.