depthai-python icon indicating copy to clipboard operation
depthai-python copied to clipboard

Compiling with Existing Dephai-Core

Open samialperen opened this issue 2 years ago • 1 comments

I have a specific docker for oak-d related stuff. I installed depthai-ros (as well as depthai-core) using [https://raw.githubusercontent.com/luxonis/depthai-ros/main/install_dependencies.sh](this script). I can use depthai-ros and everything without any problem. I want to install depthai-python inside my docker too, but I do not want to install depthai-core again. Is there any way to change CMakeList to depthai-core's location where it was installed with depthai-ros?

samialperen avatar Oct 12 '22 16:10 samialperen

@samialperen - sure:)

Add the following CMake defines: -D DEPTHAI_PYTHON_USE_FIND_PACKAGE=ON -D depthai_DIR=[path/to/install/lib/cmake/depthai]

themarpe avatar Oct 14 '22 15:10 themarpe

@themarpe I am getting this error.

-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/cassie/.hunter
-- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: 8671a89 | Config-ID: ec0f559 ]
-- [hunter] PYBIND11_ROOT: /home/cassie/.hunter/_Base/cb0ea1f/8671a89/ec0f559/Install (ver.: 2.9.2)
-- Found pybind11: /home/cassie/.hunter/_Base/cb0ea1f/8671a89/ec0f559/Install/include (found version "2.9.2")
CMake Warning at CMakeLists.txt:170 (message):
  Mypy not available - stubs won't be generated or checked


CMake Error at cmake/pybind11-mkdoc.cmake:2 (include):
  include could not find load file:

    target-public-headers
Call Stack (most recent call first):
  CMakeLists.txt:219 (include)


CMake Error at cmake/pybind11-mkdoc.cmake:15 (get_target_public_headers):
  Unknown CMake command "get_target_public_headers".
Call Stack (most recent call first):
  CMakeLists.txt:222 (target_pybind11_mkdoc_setup)


-- Configuring incomplete, errors occurred!
See also "/home/cassie/depthai-python/build/CMakeFiles/CMakeOutput.log".
See also "/home/cassie/depthai-python/build/CMakeFiles/CMakeError.log".

samialperen avatar Oct 17 '22 16:10 samialperen

@samialperen that'll be a minor issue when depthai-python & dephtai-core aren't cloned alongside. In this case I'd suggest either: clone depthai-python with submodules, but still use the above CMake defines Or copy that file from depthai-core into cmake/ of depthai-python folder

themarpe avatar Oct 17 '22 16:10 themarpe

@themarpe, so my overall goal is to just use device_manager. I tried the second method you suggested and now have this error. Computation and space is quite limited for my current project, so as long as I can make the device manager work, I do not need anything else from depthai-python

cassie@alp:~/depthai-python/build$ cmake .. -DDEPTHAI_PYTHON_USE_FIND_PACKAGE=ON -Ddepthai_DIR=/usr/local/lib/cmake/depthai
CMake Error at CMakeLists.txt:19 (file):
  file failed to open for reading (No such file or directory):

    /home/cassie/depthai-python/depthai-core/cmake/Hunter/config.cmake


-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/cassie/.hunter
-- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: 8671a89 | Config-ID: ec0f559 ]
-- [hunter] PYBIND11_ROOT: /home/cassie/.hunter/_Base/cb0ea1f/8671a89/ec0f559/Install (ver.: 2.9.2)
-- Found pybind11: /home/cassie/.hunter/_Base/cb0ea1f/8671a89/ec0f559/Install/include (found version "2.9.2")
CMake Warning at CMakeLists.txt:170 (message):
  Mypy not available - stubs won't be generated or checked


-- Checking for pybind11_mkdoc
-- Checking for pybind11_mkdoc - not found, docstrings not available
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/cassie/depthai-python/find_version.py", line 35, in get_package_dev_version
    return get_package_version() + ".dev+" + commit_hash
  File "/home/cassie/depthai-python/find_version.py", line 27, in get_package_version
    version_core = get_version_from_cmake_lists(version_depthai_core_path)
  File "/home/cassie/depthai-python/find_version.py", line 13, in get_version_from_cmake_lists
    with open(path, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/cassie/depthai-python/depthai-core/CMakeLists.txt'
-- Configuring incomplete, errors occurred!
See also "/home/cassie/depthai-python/build/CMakeFiles/CMakeOutput.log".
See also "/home/cassie/depthai-python/build/CMakeFiles/CMakeError.log".

samialperen avatar Oct 17 '22 16:10 samialperen

@samialperen To use device manager, just install latest depthai using python3 examples/install_requirements.py

For above, yeah, you'll have to clone both - do git submodule update --init --recursive in depthai-python

themarpe avatar Oct 17 '22 17:10 themarpe

Thanks!

samialperen avatar Oct 17 '22 19:10 samialperen