[irstlm] 51/126: fixing to assert flag and trace level
Giulio Paci
giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
giuliopaci-guest pushed a commit to annotated tag adaptiveLM.v0.1
in repository irstlm.
commit c59fd3450de489716263306bac31a6595f155d67
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date: Wed Aug 19 11:43:00 2015 +0200
fixing to assert flag and trace level
---
CMakeLists.txt | 1 +
README.md | 10 ++++++++++
src/CMakeLists.txt | 14 +++++++++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9e9790..aedaf2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ SET(CMAKE_C_COMPILER "gcc" )
SET(CMAKE_CXX_COMPILER "g++" )
OPTION(CXX0 "Enable/Disable std=c++0" ON)
+OPTION(ASSERT "Enable/Disable MY_ASSERT_FLAG" ON)
MATH(EXPR IRSTLM_INT_VERSION "(${IRSTLM_VERSION_MAJOR} * 10000) + (${IRSTLM_VERSION_MINOR} * 100) + (${IRSTLM_VERSION_PATCH} * 1)" )
diff --git a/README.md b/README.md
index 1333321..507c048 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,11 @@ To check whether g++ complier does support '-std=c++0x', please run the followin
If it returns 0, g++ complier does support '-std=c++0x'; otherwise, it does not, and hence please use '--disable-cxx0'
+To enable/disable assert for debugging purpose, please add parameter '--enable-assert' (default) or '--disable-assert'
+
+To modify debugging level, please add parameter '--with-tracelevel=<val>' (default is 0)
+
+
step 2:
- make
@@ -51,6 +56,11 @@ $> echo | g++ -E -x c++ -std=c++0x -dM - >& /dev/null ; echo $?
If it returns 0, g++ complier does support '-std=c++0x'; otherwise, it does not, and hence please use '-DCXX0:BOOL=OFF'
+To enable/disable assert for debugging purpose, please add parameter '-DASSERT:BOOL=ON' (default) or '-DASSERT:BOOL=OFF'
+
+To modify debugging level, please add parameter '-DTRACE_LEVEL=<val>' (default is 0)
+
+
step 2:
- make
step 3:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 36c3926..eddfd2e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,7 +6,11 @@ ADD_DEFINITIONS("-D_LARGE_FILES")
ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
ADD_DEFINITIONS("-DMYCODESIZE=3")
ADD_DEFINITIONS("-DDEBUG")
-ADD_DEFINITIONS("-DTRACE_LEVEL=1")
+#ADD_DEFINITIONS("-DTRACE_LEVEL=1")
+
+if (TRACE_LEVEL)
+ ADD_DEFINITIONS("-DTRACE_LEVEL=${TRACE_LEVEL}")
+endif()
if (CXX0)
MESSAGE( STATUS "HAVE_CXX0=true; hence, variable HAVE_CXX0 is set" )
@@ -18,6 +22,14 @@ else()
ADD_DEFINITIONS("-UHAVE_CXX0")
endif()
+if (ASSERT)
+ MESSAGE( STATUS "HAVE_ASSERT=true; hence, variable MY_ASSERT_FLAG is set" )
+ ADD_DEFINITIONS("-DMY_ASSERT_FLAG")
+else()
+ MESSAGE( STATUS "HAVE_ASSERT=false; hence, variable MY_ASSERT_FLAG is unset" )
+ ADD_DEFINITIONS("-UMY_ASSERT_FLAG")
+endif()
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ${STD_FLAG} -isystem/usr/include -W -Wall -ffor-scope")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/irstlm.git
More information about the debian-science-commits
mailing list