#477 closed defect (fixed)
Turn on LEMON_ENABLE_DEBUG in Debug mode
| Reported by: | Alpar Juttner | Owned by: | Alpar Juttner |
|---|---|---|---|
| Priority: | major | Milestone: | LEMON 1.4 release |
| Component: | core | Version: | hg main |
| Keywords: | Cc: | ||
| Revision id: |
Description
CMAKE should set -DLEMON_ENABLE_DEBUG in Debug mode. (This is basically relevant to the test and demo codes only)
Attachments (2)
Change History (9)
Changed 12 years ago by
| Attachment: | dd57dfa12bd5.patch added |
|---|
Changed 12 years ago by
| Attachment: | ce896fa7fd65.patch added |
|---|
comment:2 Changed 12 years ago by
The attached changeset [ce896fa7fd65] is an alternative implementation. It passes -DLEMON_ENABLE_DEBUG to the compiler instead of hard-wiring it in lemon/config.h. The difference is that if LEMON is built in debug mode, then [dd57dfa12bd5] will also set LEMON_ENABLE_DEBUG in external codes using LEMON, while [ce896fa7fd65] will not.
Always using -DLEMON_ENABLE_DEBUG helps revealing bugs, but may also slow down the execution in DEBUG mode too much. Note that -DLEMON_ENABLE_DEBUG may do extensive consistency checks, and will probably do even more in the future, see #462, #466
All in all, the question is --- which solution do you prefer?
comment:3 Changed 12 years ago by
| Milestone: | → LEMON 1.4 release |
|---|
comment:4 follow-up: 5 Changed 12 years ago by
I would prefer [ce896fa7fd65]. Users can still define LEMON_ENABLE_DEBUG, when they compile external code.
comment:5 Changed 12 years ago by
Replying to deba:
I would prefer [ce896fa7fd65]. Users can still define LEMON_ENABLE_DEBUG, when they compile external code.
Yes they can. What I'm a bit uncertain whether they will actually do.
An alternative solution would be if Debug modes turned on LEMON_ENABLE_DEBUG, but the user could switch is off if it slows the execution down too much.
comment:6 follow-up: 7 Changed 11 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
[ce896fa7fd65] has been merged into the main branch.
comment:7 Changed 11 years ago by
Replying to alpar:
[ce896fa7fd65] has been merged into the main branch.
In fact a little bit modified version of it: [ee96cd1cad8a]


The attached changeset [dd57dfa12bd5] implements this by adding
to
lemon/config.hinDebugandMaintainerbuild types. The drawback of this solution is thatLEMON_ENABLE_DEBUGwill always be turned on in these modes. Which may or may not be desired.What is your opinion?
The alternative solution would be to pass
-DLEMON_ENABLE_DEBUGas a compilation flag when the test and demo codes are compiled.By the way
LEMON_ENABLE_DEBUGseems to reveal a bug in test/min_cost_flow_test.cc, see #478