Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master #231

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()

if (NOT MSVC)
set(COMPILE_FLAGS -Wall -Wextra -Werror -MMD) #-Wno-deprecated
set(RELEASE_FLAGS -O3) #-Wno-deprecated
set(RELEASE_FLAGS ${COMPILE_FLAGS} -O3) #-Wno-deprecated
endif()

if (RUN_MEMORY_TEST)
Expand All @@ -104,20 +104,17 @@ endif()
add_definitions(-DRESOURCES_DIR="${RESOURCES_DIR}")

if (NOT MSVC)
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS} -g -DDEBUG_ON)
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS} -g)
set(CXXTEST_FLAGS ${DEBUG_FLAGS} -Wno-ignored-qualifiers)
else()
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS} /DDEBUG_ON)
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS})
add_definitions(-DNOMINMAX) # remove min max macros
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CXXTEST_FLAGS ${CXXTEST_FLAGS} -Wno-terminate)
endif()

if (NOT MSVC)
set(RELEASE_FLAGS ${COMPILE_FLAGS} -O3)
endif()


# Boost
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ To enable multiprocess build change the last command to:
```
cmake --build . -j PROC_NUM
```
To compile in debug mode (default is release)
```
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake --build .
```

The compiled binary will be in the *build* directory, named _Marabou_

To run tests we use [ctest](https://cmake.org/cmake/help/v3.15/manual/ctest.1.html).
Expand Down
7 changes: 3 additions & 4 deletions src/common/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

#include <cstdlib>

// #define DEBUG_ON

#ifdef DEBUG_ON
#ifndef NDEBUG
# define DEBUG(x) x
#else
# define DEBUG(x)
#endif

#ifdef DEBUG_ON
#ifndef NDEBUG
# define ASSERTM(x, y, ...) \
{ \
if ( !( x ) ) \
Expand All @@ -39,7 +38,7 @@
# define ASSERTM(x, y, ...)
#endif

#ifdef DEBUG_ON
#ifndef NDEBUG
# define ASSERT(x) \
{ \
if ( !( x ) ) \
Expand Down