add DEBUG option to Makefile/Makefile.config.example
authorJonathan L Long <jonlong@cs.berkeley.edu>
Fri, 21 Mar 2014 22:15:00 +0000 (15:15 -0700)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Fri, 28 Mar 2014 03:15:32 +0000 (20:15 -0700)
This allows debugging to be toggled without dirtying the tree.

Makefile
Makefile.config.example

index e61fb63a998c83404c7809c5d7c3929cf3bedcaf..acef07d683791bff050e346c98ebefd16985f36c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -97,7 +97,11 @@ LIBRARIES := cudart cublas curand \
 PYTHON_LIBRARIES := boost_python python2.7
 WARNINGS := -Wall
 
-COMMON_FLAGS := -DNDEBUG -O2
+ifdef DEBUG
+       COMMON_FLAGS := -DDEBUG -g -O0
+else
+       COMMON_FLAGS := -DNDEBUG -O2
+endif
 
 # MKL switch (default = non-MKL)
 USE_MKL ?= 0
index 95656dd0ad1f7789e108655ad63ca6eb009d866e..e747d2a76ad653efbe1e4a516b8b3c7e8f9ea629 100644 (file)
@@ -45,3 +45,6 @@ LIBRARY_DIRS := $(PYTHON_LIB) /usr/lib /usr/local/lib
 
 BUILD_DIR := build
 DISTRIBUTE_DIR := distribute
+
+# uncomment for debugging
+#DEBUG := 1