From 23bb8a2d8dc41a38ac6e4004e5ef316e4ece1f57 Mon Sep 17 00:00:00 2001 From: Eric Platon Date: Mon, 7 Jun 2021 10:37:51 +0900 Subject: [PATCH 1/3] Detail and notes about building the lib. * Add local submodule dependencies to the dependency list. * Break down and structure the build process, depending on the scenario. * Add common issues section along the build process. --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a732745a6..9d504e574 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifacto - cmake >= 3.4 - C++14 compiler (clang, gcc, msvc, ...) - Python3 + - Submodule dependencies with Git Along these, dependencies of depthai-core are also required See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#dependencies) @@ -31,30 +32,44 @@ See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#depende ### Building +The first time you build, the repository submodules need be initialized: +``` +git submodule update --init --recursive +``` + +Later submodules also need to be updated. + +#### Local build with pip To build and install using pip: ``` python3 -m pip install . ``` Add parameter `-v` to see the output of the building process. - +#### Wheel with pip To build a wheel, execute the following ``` python3 -m pip wheel . -w wheelhouse ``` +#### Shared library To build a shared library from source perform the following: > ℹ️ To speed up build times, use `cmake --build build --parallel [num CPU cores]` (CMake >= 3.12). For older versions use: Linux/macOS: `cmake --build build -- -j[num CPU cores]`, MSVC: `cmake --build build -- /MP[num CPU cores]` ``` -git submodule update --init --recursive cmake -H. -Bbuild cmake --build build ``` To specify custom Python executable to build for, use `cmake -H. -Bbuild -D PYTHON_EXECUTABLE=/full/path/to/python`. +#### Common issues + +* Many build fails due to missing dependencies. This also happens when submodules are missing or outdated (`git submodule update --recursive`). +* If libraries and headers are not in standard places, or not on the search paths, CMake reports it cannot find what it needs (e.g. `libusb`). CMake can be hinted at where to look, for exmpale: `CMAKE_LIBRARY_PATH=/opt/local/lib CMAKE_INCLUDE_PATH=/opt/local/include pip install .` +* Some distribution installers may not get the desired library. For example, an install on a RaspberryPi failed, missing `libusb`, as the default installation with APT led to v0.1.3 at the time, whereas the library here required v1.0. + ## Running tests From 1171e649a5ec8647acbe24520428555ee8517389 Mon Sep 17 00:00:00 2001 From: Eric Platon Date: Thu, 10 Jun 2021 13:51:38 +0900 Subject: [PATCH 2/3] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9d504e574..33103d456 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,9 @@ See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#depende The first time you build, the repository submodules need be initialized: ``` git submodule update --init --recursive + +# Tip: You can ask Git to do that automatically: +git config submodule.recurse true ``` Later submodules also need to be updated. From fe6424277641dbff0f0fe705ddacdbb04a7bf06d Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Fri, 11 Jun 2021 10:06:54 +0200 Subject: [PATCH 3/3] Update README.md Co-authored-by: Eric Platon --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 33103d456..7c3844cfe 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ python3 -m pip install --extra-index-url https://artifacts.luxonis.com/artifacto - cmake >= 3.4 - C++14 compiler (clang, gcc, msvc, ...) - Python3 - - Submodule dependencies with Git Along these, dependencies of depthai-core are also required See: [depthai-core dependencies](https://github.com/luxonis/depthai-core#dependencies)