Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Error at libonvif/CMakeLists.txt:63 #75

Open
VortexV opened this issue Nov 30, 2023 · 6 comments
Open

CMake Error at libonvif/CMakeLists.txt:63 #75

VortexV opened this issue Nov 30, 2023 · 6 comments

Comments

@VortexV
Copy link

VortexV commented Nov 30, 2023

Ubuntu Studio OS 22.04

mangrove@mangrove-hpelitedesk800g3dm35w:~/libonvif/build$ cmake -DBUILD_GUI=ON ..
-- 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
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13")
CMake Error at libonvif/CMakeLists.txt:63 (add_subdirectory):
The source directory

/home/mangrove/libonvif/libonvif/pybind11

does not contain a CMakeLists.txt file.

CMake Error at libonvif/CMakeLists.txt:65 (pybind11_add_module):
Unknown CMake command "pybind11_add_module".

-- Configuring incomplete, errors occurred!
See also "/home/mangrove/libonvif/build/CMakeFiles/CMakeOutput.log".

@VortexV
Copy link
Author

VortexV commented Nov 30, 2023

Copying the /home/mangrove/libonvif/CMakeLists.txt to /home/mangrove/libonvif/libonvif/pybind11
Creates more similar errors:

~/libonvif/build$ cmake -DBUILD_GUI=ON ..
-- 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
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13")
CMake Error at libonvif/pybind11/CMakeLists.txt:40 (add_subdirectory):
add_subdirectory given source "libonvif" which is not an existing
directory.

CMake Error at libonvif/pybind11/CMakeLists.txt:41 (add_subdirectory):
add_subdirectory given source "onvif-util" which is not an existing
directory.

CMake Error at libonvif/pybind11/CMakeLists.txt:43 (add_subdirectory):
add_subdirectory given source "libavio" which is not an existing directory.

CMake Error at libonvif/pybind11/CMakeLists.txt:64 (install):
install TARGETS given target "libavio" which does not exist.

CMake Error at libonvif/pybind11/CMakeLists.txt:69 (install):
install TARGETS given target "onvif-util" which does not exist.

CMake Error at libonvif/CMakeLists.txt:65 (pybind11_add_module):
Unknown CMake command "pybind11_add_module".

-- Configuring incomplete, errors occurred!
See also "/home/mangrove/libonvif/build/CMakeFiles/CMakeOutput.log".

@sr99622
Copy link
Owner

sr99622 commented Nov 30, 2023

Hello, thank you for reaching out. It definitely looks like something is missing. If I have to guess, I would think that the git clone was done without the recursive flag. This is necessary to get the pybind11 and libavio sub directories to populate. I would suggest deleting the libonvif directory completely and re-starting the git clone from scratch.

git clone --recursive https://github.com/sr99622/libonvif

You will also need the sudo apt commands and the python environment set up as per the installation instructions. If you have already done these, it is not necessary to repeat.

If you have successfully cloned with recursive flag, the pybind11 sub directory will be populated. If not, there will be a pybind11 sub directory, but it will be empty. This applies to the libavio sub directory as well. If these sub directories are populated, the cmake command should work.

If this is not the case, please let me know, we can investigate further.

Best Regards,

Stephen

@VortexV
Copy link
Author

VortexV commented Dec 2, 2023

Thanks for the reply and help!
It did much better, but there is still something missing:

mangrove@mangrove-hpelitedesk800g3dm35w:~/libonvif/onvif-gui$ pip install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/mangrove/libonvif/onvif-gui
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: onvif-gui
  Building wheel for onvif-gui (pyproject.toml) ... done
  Created wheel for onvif-gui: filename=onvif_gui-1.2.10-py3-none-any.whl size=645779 sha256=60b03511bfd9cbbd6530b4b04db4e61124598f3b1957845ce30f58f4f01b7b67
  Stored in directory: /home/mangrove/.cache/pip/wheels/c0/d3/aa/38d6d9536a2615f6a383e867c980e77a9d5e8adf71483e1318
Successfully built onvif-gui
Installing collected packages: onvif-gui
Successfully installed onvif-gui-1.2.10
mangrove@mangrove-hpelitedesk800g3dm35w:~/libonvif/onvif-gui$ onvif-gui
Traceback (most recent call last):
  File "/home/mangrove/.local/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/home/mangrove/.local/lib/python3.10/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/home/mangrove/.local/lib/python3.10/site-packages/gui/main.py", line 22, in <module>
    from loguru import logger
ModuleNotFoundError: No module named 'loguru'
mangrove@mangrove-hpelitedesk800g3dm35w:~/libonvif/onvif-gui$ 

I did pip install libonvif and libavio before onvif-gui

I also did the onvif-util install, which worked perfectly:

mangrove@mangrove-hpelitedesk800g3dm35w:~/libonvif/build$ onvif-util -a
Looking for cameras on the network...
Found 3 cameras
192.168.1.99 IPCAM(IPCAM)
192.168.1.160 ( hi3518c)
192.168.1.89 LocalHost(NVT IPC-model)

@sr99622
Copy link
Owner

sr99622 commented Dec 2, 2023

Thank you for the so much for the feedback, I did not realize that there was an error in the Build From Source Instructions.

The step to install onvif-gui should be slightly different than the previous. You want to download the pip package rather than compile. The command is

pip install onvif-gui

rather than the 'pip install .' shown. This will bring in the dependencies like loguru.

@VortexV
Copy link
Author

VortexV commented Dec 2, 2023

I am happy to help out :)

Apparently, loguru is not in the right place:

(myenv) mangrove@mangrove-hpelitedesk800g3dm35w:~/myenv$ pip install onvif-gui
Requirement already satisfied: onvif-gui in ./lib/python3.10/site-packages (1.2.10)
Requirement already satisfied: pyqt6 in ./lib/python3.10/site-packages (from onvif-gui) (6.6.0)
Requirement already satisfied: loguru in ./lib/python3.10/site-packages (from onvif-gui) (0.7.2)
Requirement already satisfied: libonvif in ./lib/python3.10/site-packages (from onvif-gui) (2.0.10)
Requirement already satisfied: avio in ./lib/python3.10/site-packages (from onvif-gui) (2.1.8)
Requirement already satisfied: numpy in ./lib/python3.10/site-packages (from onvif-gui) (1.26.2)
Requirement already satisfied: opencv-python in ./lib/python3.10/site-packages (from onvif-gui) (4.8.1.78)
Requirement already satisfied: PyQt6-sip<14,>=13.6 in ./lib/python3.10/site-packages (from pyqt6->onvif-gui) (13.6.0)
Requirement already satisfied: PyQt6-Qt6>=6.6.0 in ./lib/python3.10/site-packages (from pyqt6->onvif-gui) (6.6.1)
(myenv) mangrove@mangrove-hpelitedesk800g3dm35w:~/myenv$ onvif-gui
Traceback (most recent call last):
  File "/home/mangrove/.local/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/home/mangrove/.local/lib/python3.10/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/home/mangrove/.local/lib/python3.10/site-packages/gui/main.py", line 22, in <module>
    from loguru import logger
ModuleNotFoundError: No module named 'loguru'

@sr99622
Copy link
Owner

sr99622 commented Dec 3, 2023

Thank you so much for your patience. After the latest error, I took a closer look at the installation package and found a couple issues that have evolved since it was first put together, and it has been updated.

Additionally, It looks like you might have installed the package in the system python as well as to the virtual environment. This might explain the loguru error when it seems to have been installed in the virtual environment. I would recommend attempting to remove the onvif-gui install in the system python.

The best chance for getting onvif-gui to work would be to wipe the python virtual environment and start over fresh.

Assuming that you start from the command prompt without starting the virtual environment and the myenv folder is in the home directory:

cd ~
pip uninstall onvif-gui
pip cache purge
rm -R myenv
virtualenv myenv
source myenv/bin/activate
pip install onvif-gui
onvif-gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants