Skip to content

Commit

Permalink
Merge pull request #2 from NeuralNetworkVerification/master
Browse files Browse the repository at this point in the history
Merge from master
  • Loading branch information
guykatzz authored Apr 1, 2020
2 parents f3fc8db + 38d97ab commit 0294146
Show file tree
Hide file tree
Showing 22 changed files with 2,155 additions and 43 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project(Marabou)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(BUILD_STATIC_MARABOU "Build static Marabou binary" OFF)
option(BUILD_PYTHON "Build Python" ON)
option(FORCE_PYTHON_BUILD "Build python even if there is only python32" OFF)
option(RUN_UNIT_TEST "run unit tests on build" ON)
Expand Down Expand Up @@ -107,7 +108,7 @@ if (NOT MSVC)
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS} -g)
set(CXXTEST_FLAGS ${DEBUG_FLAGS} -Wno-ignored-qualifiers)
else()
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS})
set(DEBUG_FLAGS ${COMPILE_FLAGS} ${MEMORY_FLAGS})
add_definitions(-DNOMINMAX) # remove min max macros
endif()

Expand Down Expand Up @@ -156,8 +157,13 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
list(APPEND LIBS Threads::Threads)

# build a static library
target_link_libraries(${MARABOU_LIB} ${LIBS})
if (BUILD_STATIC_MARABOU)
# build a static library
target_link_libraries(${MARABOU_LIB} ${LIBS} -static)
else()
target_link_libraries(${MARABOU_LIB} ${LIBS})
endif()

target_include_directories(${MARABOU_LIB} PRIVATE ${LIBS_INCLUDES})
target_compile_options(${MARABOU_LIB} PRIVATE ${RELEASE_FLAGS})

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ cd path/to/marabou/repo/folder
mkdir build
cd build
cmake ..
```
For configuring to build a static Marabou binary, use the following flag
```
cmake .. -DBUILD_STATIC_MARABOU=ON
```
To build, run the following:
```
cmake --build .
```
To enable multiprocess build change the last command to:
Expand Down
1 change: 1 addition & 0 deletions src/configuration/GlobalConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const double GlobalConfiguration::PSE_GAMMA_ERROR_THRESHOLD = 0.001;
const double GlobalConfiguration::PSE_GAMMA_UPDATE_TOLERANCE = 0.000000001;

const double GlobalConfiguration::RELU_CONSTRAINT_COMPARISON_TOLERANCE = 0.001;
const double GlobalConfiguration::ABS_CONSTRAINT_COMPARISON_TOLERANCE = 0.001;

const bool GlobalConfiguration::ONLY_AUX_INITIAL_BASIS = false;

Expand Down
5 changes: 4 additions & 1 deletion src/configuration/GlobalConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ class GlobalConfiguration
// PSE's Gamma function's update tolerance
static const double PSE_GAMMA_UPDATE_TOLERANCE;

// The tolerance for checking whether f = Relu( b ), to determine a ReLU's statisfaction
// The tolerance for checking whether f = Relu( b )
static const double RELU_CONSTRAINT_COMPARISON_TOLERANCE;

// The tolerance for checking whether f = Abs( b )
static const double ABS_CONSTRAINT_COMPARISON_TOLERANCE;

// Should the initial basis be comprised only of auxiliary (row) variables?
static const bool ONLY_AUX_INITIAL_BASIS;

Expand Down
Loading

0 comments on commit 0294146

Please sign in to comment.