Commits

Leonardo de Moura  committed dfaa03b

Cleaned maxsat example

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>

  • Participants
  • Parent commits 659fe1e

Comments (0)

Files changed (13)

File maxsat/README-external.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. 
+WARNING: this example still uses the old Z3 (version 3.x) C API. 
+The current version is backward compatible. 
 
 This directory contains scripts to build the MaxSAT application using
 Microsoft C compiler, or gcc.
 
-1) Using Microsoft C compiler
+1) Using Microsoft C compiler (with binary release)
 
-Use 'build.cmd' to build the MaxSAT application using Microsoft C
-compiler.
+Use 'build.cmd' to build the MaxSAT application using Microsoft C compiler.
 
 Remark: The Microsoft C compiler (cl) must be in your path,
 or you can use the Visual Studio Command Prompt.
 The script 'exec.cmd' adds the bin directory to the path. So, 
 maxsat.exe can find z3.dll.
 
-
-2) Using gcc
-
-Use 'build.sh' to build the MaxSAT application using gcc. 
-The script 'exec.sh' adds the bin directory to the path. So, 
-maxsat.exe can find z3.dll.
-
-Remark: the scripts 'build.sh' and 'exec.sh' assumes you are in a
-Cygwin or Mingw shell.

File maxsat/README-linux.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. 
-
-This directory contains scripts to build the MaxSAT application using gcc.
-
-Use 'build.sh' to build the MaxSAT application using gcc. 
-The script 'exec.sh' adds the lib directory to the path. So, 
-maxsat can find libz3.so.
-

File maxsat/README-osx.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. 
-
-This directory contains scripts to build the MaxSAT application using gcc.
-
-Use 'build.sh' to build the MaxSAT application using gcc. 
-The script 'exec.sh' adds the lib directory to the path. So, 
-maxsat can find libz3.dylib.
-

File maxsat/README.txt

+WARNING: this example still uses the old Z3 (version 3.x) C API. 
+The current version is backward compatible. 
+
+This directory contains scripts to build the MaxSAT application using
+Microsoft C compiler, or gcc.
+
+1) Using Visual Studio (with Z3 source code release)
+
+Use the maxsat.vcxproj project file.
+
+2) Using gcc (on Linux or OSX)
+
+Use 'build.sh' to build the MaxSAT application using gcc. 
+
+You must install Z3 before running this example.
+To install Z3, execute the following command in the Z3 root directory.
+
+  sudo make install
+
+Use 'build.sh' to build the test application using gcc. 
+It generates the executable 'maxsat'.

File maxsat/build-external-linux.sh

-gcc -fopenmp -o maxsat maxsat.c -I ../../include -L ../../lib -lz3

File maxsat/build-external-osx.sh

-gcc -fopenmp -o maxsat maxsat.c -I ../../include -L ../../lib -lz3 

File maxsat/build-external.sh

-gcc -o maxsat.exe -I ../../include ../../bin/z3.dll maxsat.c

File maxsat/build-static-linux.sh

-# Note: Z3 was built using C++, so libz3.a has C++ dependencies. 
-#       You can use gcc to link the program, but you need tell it 
-#       to link the C++ libraries
-g++ -fopenmp -static -I../../include -L../../lib maxsat.c -lz3 -o maxsat

File maxsat/build-static-osx.sh

-# Note: Z3 was built using C++, so libz3.a has C++ dependencies. 
-#       You can use gcc to link the program, but you need tell it 
-#       to link the C++ libraries
-g++ -fopenmp  -I../../include maxsat.c ../../lib/libz3.a -o maxsat

File maxsat/build.sh

+if gcc -fopenmp -o maxsat maxsat.c -lz3; then
+    echo "maxsat example was successfully compiled."
+    echo "To run example, execute:"
+    echo "  ./maxsat ex.smt"
+else
+    echo "You must install Z3 before compiling this example."
+    echo "To install Z3, execute the following command in the Z3 root directory."
+    echo "   sudo make install"
+fi

File maxsat/exec-external-linux.sh

-export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH
-./maxsat $1

File maxsat/exec-external-osx.sh

-export DYLD_LIBRARY_PATH=../../lib:$DYLD_LIBRARY_PATH
-./maxsat $1

File maxsat/exec-external.sh

-export PATH=../../bin:$PATH
-./maxsat.exe $1