From 287d66d601d6499aa63d1873fe85137cabc05817 Mon Sep 17 00:00:00 2001 From: joaomhmpereira Date: Thu, 4 Apr 2024 16:10:17 +0100 Subject: [PATCH] link libraries statically --- api/dune | 15 +++++++++------ cvc5.opam | 4 ++-- dune | 35 ++++++++++++++++++++++++++++------- dune-project | 4 ++-- vendor/dune | 16 ---------------- 5 files changed, 41 insertions(+), 33 deletions(-) delete mode 100644 vendor/dune diff --git a/api/dune b/api/dune index ccf8d43..ac9ad0d 100644 --- a/api/dune +++ b/api/dune @@ -12,9 +12,12 @@ (flags :standard -std=c++17 -I/opt/homebrew/include) (include_dirs ../vendor/cvc5/include)) - (foreign_archives - ../vendor/cvc5 - ../vendor/cadical - ../vendor/picpoly - ../vendor/picpolyxx) - (c_library_flags :standard -std=c++17 -L/opt/homebrew/lib -lgmp)) \ No newline at end of file + (c_library_flags + :standard -std=c++17 + -L/opt/homebrew/lib + -lgmp + -lcvc5 + -lcadical + -lpicpoly + -lpicpolyxx + -L%{project_root}/_build/default/)) \ No newline at end of file diff --git a/cvc5.opam b/cvc5.opam index 1fb6b2d..47b7689 100644 --- a/cvc5.opam +++ b/cvc5.opam @@ -2,8 +2,8 @@ opam-version: "2.0" synopsis: "OCaml bindings for the CVC5 SMT solver" description: "OCaml bindings for the CVC5 SMT solver" -maintainer: ["João Pereira "] -authors: ["João Pereira "] +maintainer: ["João Pereira "] +authors: ["João Pereira "] homepage: "https://github.com/formalsec/ocaml-cvc5" bug-reports: "https://github.com/formalsec/ocaml-cvc5/issues" depends: [ diff --git a/dune b/dune index 4feff3f..454ba1b 100644 --- a/dune +++ b/dune @@ -1,3 +1,21 @@ +(rule + (deps + (source_tree vendor)) + (targets libpicpolyxx.a libpicpoly.a libcadical.a libcvc5.a) + (action + (no-infer + (progn + (chdir vendor + (chdir cvc5 + (progn + ; (run pipx install -r contrib/requirements_build.txt) + (run ./configure.sh --auto-download --static) + (run make -C build -j 4)))) + (copy vendor/cvc5/build/src/libcvc5.a libcvc5.a) + (copy vendor/cvc5/build/deps/lib/libcadical.a libcadical.a) + (copy vendor/cvc5/build/deps/lib/libpicpoly.a libpicpoly.a) + (copy vendor/cvc5/build/deps/lib/libpicpolyxx.a libpicpolyxx.a))))) + (library (public_name cvc5) (name cvc5) @@ -10,12 +28,15 @@ vendor/cvc5/include vendor/cvc5/src vendor/cvc5/src/lib)) - (foreign_archives - vendor/cadical - vendor/cvc5 - vendor/picpoly - vendor/picpolyxx) - (c_library_flags :standard -std=c++17 -L/opt/homebrew/lib -lgmp)) + (c_library_flags + :standard -std=c++17 + -L/opt/homebrew/lib + -lgmp + -lcvc5 + -lcadical + -lpicpoly + -lpicpolyxx + -L%{project_root}/_build/default/)) (rule (deps ./api/cvc5_enums.exe) @@ -28,4 +49,4 @@ (executable (name toy) (libraries cvc5) - (modules toy)) + (modules toy)) \ No newline at end of file diff --git a/dune-project b/dune-project index 353ce83..07572bb 100644 --- a/dune-project +++ b/dune-project @@ -7,9 +7,9 @@ (source (github formalsec/ocaml-cvc5)) -(authors "João Pereira ") +(authors "João Pereira ") -(maintainers "João Pereira ") +(maintainers "João Pereira ") (package (name cvc5) diff --git a/vendor/dune b/vendor/dune deleted file mode 100644 index dcc8666..0000000 --- a/vendor/dune +++ /dev/null @@ -1,16 +0,0 @@ -(data_only_dirs cvc5) - -(rule - (deps - (source_tree cvc5)) - (targets libcvc5.a libcadical.a libpicpoly.a libpicpolyxx.a) - (action - (chdir cvc5 - (progn - ; (run pipx install -r contrib/requirements_build.txt) - (run ./configure.sh --auto-download --static) - (run make -C build -j 4) - (bash "cp build/src/libcvc5.a ../libcvc5.a") - (bash "cp build/deps/lib/libcadical.a ../libcadical.a") - (bash "cp build/deps/lib/libpicpoly.a ../libpicpoly.a") - (bash "cp build/deps/lib/libpicpolyxx.a ../libpicpolyxx.a")))))