File tree Expand file tree Collapse file tree 4 files changed +16
-15
lines changed
Expand file tree Collapse file tree 4 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 11PIP_EDITABLE = python -m pip install --editable . --no-deps --no-build-isolation
22
33debug : mahotas/* .cpp mahotas/* .h mahotas/* .hpp
4- $(PIP_EDITABLE ) --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=debug --config-settings=setup-args=-Dglibcpp_debug=true
4+ $(PIP_EDITABLE ) --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=release --config-settings=setup-args=-Db_ndebug=false --config-settings=setup-args=-Dglibcpp_debug=true
55
66debug3 : mahotas/* .cpp mahotas/* .h mahotas/* .hpp
7- python3 -m pip install --editable . --no-deps --no-build-isolation --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=debug --config-settings=setup-args=-Dglibcpp_debug=true
7+ python3 -m pip install --editable . --no-deps --no-build-isolation --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=release --config-settings=setup-args=-Db_ndebug=false --config-settings=setup-args=-Dglibcpp_debug=true
88
99fast : mahotas/* .cpp mahotas/* .h mahotas/* .hpp
1010 $(PIP_EDITABLE ) --config-settings=build-dir=build/fast --config-settings=setup-args=-Dbuildtype=release
Original file line number Diff line number Diff line change @@ -193,9 +193,9 @@ Development happens on github
193193([ https://github.com/luispedro/mahotas ] ( https://github.com/luispedro/mahotas ) ).
194194
195195The ` Makefile ` that is shipped with the source of mahotas can be useful
196- too. ` make debug ` rebuilds the editable install with a Meson debug build and
197- enables ` _GLIBCXX_DEBUG ` . ` make fast ` rebuilds it in release mode. ` make tests `
198- runs the test suite after a debug rebuild.
196+ too. ` make debug ` rebuilds the editable install in optimized mode while keeping
197+ assertions enabled and adding ` _GLIBCXX_DEBUG ` . ` make fast ` rebuilds it in
198+ plain release mode. ` make tests ` runs the test suite after a debug rebuild.
199199
200200``` bash
201201make debug
@@ -208,12 +208,13 @@ If you want the equivalent of the old `DEBUG=1` build without
208208``` bash
209209python -m pip install -e . --no-deps --no-build-isolation \
210210 --config-settings=build-dir=build/debug \
211- --config-settings=setup-args=-Dbuildtype=debug
211+ --config-settings=setup-args=-Dbuildtype=release \
212+ --config-settings=setup-args=-Db_ndebug=false
212213```
213214
214215Be careful not to use the debug build in production unless you are chasing a
215- bug. The ` _GLIBCXX_DEBUG ` configuration used by ` make debug ` is very slow as it
216- adds many runtime checks.
216+ bug. The ` _GLIBCXX_DEBUG ` configuration used by ` make debug ` can still be much
217+ slower than a plain release build because it adds many runtime checks.
217218
218219## Links & Contacts
219220
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ of runtime checks.
2323
2424There are two levels:
2525
26- 1. A Meson `` debug `` build turns on assertions. The code will run slower, but
26+ 1. A release build with `` b_ndebug=false `` turns on assertions. The code will run slower, but
2727 probably not noticeably slower, except for very large images.
28- 2. ``make debug `` uses a Meson `` debug `` build and additionally defines
29- ``_GLIBCXX_DEBUG ``. This only has an effect with libstdc++, but when
30- available it enables checked iterators in the C++ standard library. The
31- result will be code that runs **much slower ** as many iterator operations
32- are now checked. However, it catches many errors.
28+ 2. ``make debug `` uses an optimized release build with assertions enabled and
29+ additionally defines ``_GLIBCXX_DEBUG ``. This only has an effect with
30+ libstdc++, but when available it enables checked iterators in the C++
31+ standard library. The result can still be **much slower ** as many iterator
32+ operations are now checked. However, it catches many errors.
3333
3434The Makefile that comes with the source helps you::
3535
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ source. For a normal install, use::
4949
5050For a debug-style editable install, use::
5151
52- python -m pip install -e . --no-deps --no-build-isolation --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=debug
52+ python -m pip install -e . --no-deps --no-build-isolation --config-settings=build-dir=build/debug --config-settings=setup-args=-Dbuildtype=release --config-settings=setup-args=-Db_ndebug=false
5353
5454
5555Bleeding Edge (Development)
You can’t perform that action at this time.
0 commit comments