Commits

Leonardo de Moura committed 8aecd2f

cleanned test_capi example

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

Comments (0)

Files changed (16)

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)
 
 The maxsat example application is automatically built when the z3-prover.sln is processed. The following command should be used to compile z3-prover.sln in the Z3 root directory

test_capi/README-external.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. Please go to the examples/c++ for examples using the new API.  
-
-This directory contains scripts to build the test application using
-Microsoft C compiler, or gcc.
-
-1) Using Microsoft C compiler
-
-Use 'build.cmd' to build the test 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, 
-test_capi.exe can find z3.dll.
-
-
-2) Using gcc
-
-Use 'build.sh' to build the test application using gcc. 
-The script 'exec.sh' adds the bin directory to the path. So, 
-test_capi.exe can find z3.dll.
-
-Remark: the scripts 'build.sh' and 'exec.sh' assumes you are in a
-Cygwin or Mingw shell.
-

test_capi/README-linux.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. Please go to the examples/c++ for examples using the new API.  
-
-This directory contains scripts to build the test application using gcc.
-
-Use 'build.sh' to build the test application using gcc. 
-The script 'exec.sh' adds the lib directory to the path. So, 
-test_capi can find libz3.so.
-

test_capi/README-osx.txt

-WARNING: this example still uses the old Z3 (version 3.x) C API. The current version is backward compatible. Please go to the examples/c++ for examples using the new API.  
-
-This directory contains scripts to build the test application using gcc.
-
-Use 'build.sh' to build the test application using gcc. 
-The script 'exec.sh' adds the lib directory to the path. So, 
-test_capi can find libz3.dylib.
-

test_capi/README.txt

+WARNING: this example still uses the old Z3 (version 3.x) C API. 
+The current version is backward compatible. 
+
+1) Using Visual Studio (with Z3 source code release)
+
+The test_capi application is automatically built when the z3-prover.sln is processed. The following command should be used to compile z3-prover.sln in the Z3 root directory
+
+        msbuild /p:configuration=external
+
+The maxsat executable is located at
+    
+        ..\external\test_capi
+
+2) Using gcc (on Linux or OSX)
+
+Use 'build.sh' to build the test 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 'test_capi'.
+

test_capi/build-external-linux.sh

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

test_capi/build-external-osx.sh

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

test_capi/build-external.cmd

-cl /I ..\..\include ..\..\bin\z3.lib test_capi.c

test_capi/build-external.sh

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

test_capi/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 test_capi.c -lz3 -o test_capi

test_capi/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 test_capi.c ../../lib/libz3.a -o test_capi

test_capi/build.sh

+if gcc -fopenmp -o test_capi test_capi.c -lz3; then
+    echo "test_capi applicatio was successfully compiled."
+    echo "To try it, execute:"
+    echo "  ./test_capi"
+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

test_capi/exec-external-linux.sh

-export LD_LIBRARY_PATH=../../lib:$LD_LIBRARY_PATH
-./test_capi

test_capi/exec-external-osx.sh

-export DYLD_LIBRARY_PATH=../../lib:$DYLD_LIBRARY_PATH
-./test_capi

test_capi/exec-external.cmd

-@echo off
-SETLOCAL
-set PATH=..\..\bin;%PATH%
-test_capi.exe
-ENDLOCAL

test_capi/exec-external.sh

-export PATH=../../bin:$PATH
-./test_capi.exe