Skip to content

Commit bbaa777

Browse files
authored
Merge pull request #428 from ApproximateIdentity/debug-build-documentation
Add docs for debug build
2 parents f33e65d + e83bc13 commit bbaa777

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ If some dependency is not enabled in the pre-built wheels, you can also run the
140140
- Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build
141141
- Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability
142142

143+
#### Manual debug builds
144+
145+
In order to build `opencv-python` in an unoptimized debug build, you need to side-step the normal process a bit.
146+
147+
1. Install the packages `scikit-build` and `numpy` via pip.
148+
2. Run the command `python setup.py bdist_wheel --build-type=Debug`.
149+
3. Install the generated wheel file in the `dist/` folder with `pip install dist/wheelname.whl`.
150+
151+
If you would like the build produce all compiler commands, then the following combination of flags and environment variables has been tested to work on Linux:
152+
```
153+
export CMAKE_ARGS='-DCMAKE_VERBOSE_MAKEFILE=ON'
154+
export VERBOSE=1
155+
156+
python3 setup.py bdist_wheel --build-type=Debug
157+
```
158+
159+
See this issue for more discussion: https://github.com/skvark/opencv-python/issues/424
160+
143161
#### Source distributions
144162

145163
Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources. If you need a OpenCV version which is not available in PyPI as a source distribution, please follow the manual build guidance above instead of this one.

0 commit comments

Comments
 (0)