You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.
* Update README.md
* Update README.md
Co-authored-by: Eric Platon <[email protected]>
Co-authored-by: TheMarpe <[email protected]>
The first time you build, the repository submodules need be initialized:
35
+
```
36
+
git submodule update --init --recursive
37
+
38
+
# Tip: You can ask Git to do that automatically:
39
+
git config submodule.recurse true
40
+
```
41
+
42
+
Later submodules also need to be updated.
43
+
44
+
#### Local build with pip
34
45
To build and install using pip:
35
46
```
36
47
python3 -m pip install .
37
48
```
38
49
Add parameter `-v` to see the output of the building process.
39
50
40
-
51
+
#### Wheel with pip
41
52
To build a wheel, execute the following
42
53
```
43
54
python3 -m pip wheel . -w wheelhouse
44
55
```
45
56
57
+
#### Shared library
46
58
To build a shared library from source perform the following:
47
59
48
60
> ℹ️ To speed up build times, use `cmake --build build --parallel [num CPU cores]` (CMake >= 3.12).
49
61
For older versions use: Linux/macOS: `cmake --build build -- -j[num CPU cores]`, MSVC: `cmake --build build -- /MP[num CPU cores]`
50
62
51
63
```
52
-
git submodule update --init --recursive
53
64
cmake -H. -Bbuild
54
65
cmake --build build
55
66
```
56
67
To specify custom Python executable to build for, use `cmake -H. -Bbuild -D PYTHON_EXECUTABLE=/full/path/to/python`.
57
68
69
+
#### Common issues
70
+
71
+
* Many build fails due to missing dependencies. This also happens when submodules are missing or outdated (`git submodule update --recursive`).
72
+
* 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 .`
73
+
* 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.
0 commit comments