From c0c0d117e57fdc7c311d46a90e4f53ac95b01b9d Mon Sep 17 00:00:00 2001 From: Thomas Bauereiss Date: Sun, 17 May 2020 12:52:11 +0100 Subject: [PATCH] Switch to statically linked Z3 This avoids a run-time dependency on libz3.so, which tends to require fiddling with LD_LIBRARY_PATH. Need to pass the flags "-cclib -lstdc++" at compile time, though, as dune for some reason doesn't pick those up from the z3 package manifest (see https://stackoverflow.com/a/56853556). --- bin/dune | 2 ++ dune-project | 2 +- libASL/dune | 2 +- tests/dune | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/dune b/bin/dune index fce1c671..c059cf6d 100644 --- a/bin/dune +++ b/bin/dune @@ -3,6 +3,7 @@ (public_name asli) (modes exe) (modules asli) + (flags (-cclib -lstdc++)) (libraries libASL linenoise pprint)) (executable @@ -10,4 +11,5 @@ (modes exe) ; (public_name test_asl_lexer) (modules testlexer) + (flags (-cclib -lstdc++)) (libraries libASL)) diff --git a/dune-project b/dune-project index 424131c6..f71b03b1 100644 --- a/dune-project +++ b/dune-project @@ -21,7 +21,7 @@ "linenoise" "pprint" "zarith" - ("z3" (<= "4.7.1")) + ("z3" (>= "4.8.4")) ("alcotest" :with-test) ) ) diff --git a/libASL/dune b/libASL/dune index 705cb712..7cfc8d84 100644 --- a/libASL/dune +++ b/libASL/dune @@ -17,7 +17,7 @@ (name libASL) (public_name asli.libASL) (flags - (:standard -w -27)) + (:standard -w -27 -cclib -lstdc++)) (modules asl_ast asl_parser asl_parser_pp asl_utils asl_visitor cpu elf eval lexer lexersupport loadASL primops tcheck utils value visitor) (libraries pprint zarith z3)) diff --git a/tests/dune b/tests/dune index ac6a0ff6..1c01889f 100644 --- a/tests/dune +++ b/tests/dune @@ -1,3 +1,4 @@ (test (name test_asl) (modes exe) + (flags (-cclib -lstdc++)) (libraries alcotest libASL))