1

I am completely new to OCaml, however, I have been given a finished project, which includes the use of the z3 SAT solver, to test and gather data from. I installed everything through Opam however I am getting the below error. I am working on Ubuntu 18.04.

That is I installed Opam, and OCaml 4.08.0 as it's switch and the packages z3, Zarith, and Menhir. I am to setup all packages through Oasis (_oasis file being provided with the project). I also followed this as the developer warned me that there may be some issues with binding OCaml to z3. When presented with this error I tried to reinstall the switch as suggested here, however to no avail.

These are the steps which I'm taking to compile the project:

    $ oasis setup -setup-update dynamic
    $ make

However this results in the below error:

    collect2: error: ld returned 1 exit status
    File "caml_startup", line 1:
    Error: Error during linking
    Command exited with code 2.
    Compilation unsuccessful after building 57 targets (0 cached) in 00:00:16.
    E: Failure("Command ''/home/john/.opam/4.08.0/bin/ocamlbuild' src/utils/utils.cma src/utils/utils.cmxa src/utils/utils.a src/utils/utils.cmxs src/parsing/parsing.cma src/parsing/parsing.cmxa src/parsing/parsing.a src/parsing/parsing.cmxs src/definitions/definitions.cma src/definitions/definitions.cmxa src/definitions/definitions.a src/definitions/definitions.cmxs src/definitions/symbolic-controllability/symcontrollability.cma src/definitions/symbolic-controllability/symcontrollability.cmxa src/definitions/symbolic-controllability/symcontrollability.a src/definitions/symbolic-controllability/symcontrollability.cmxs src/main.native -use-menhir -yaccflag --infer -tag debug' terminated with error code 10")
    Makefile:7: recipe for target 'build' failed
    make: *** [build] Error 1

_oasis file _log file

John
  • 71
  • 1
  • 1
  • 10
  • 1
    Most likely this is because the z3 opam package is broken, see https://stackoverflow.com/questions/56839246/installing-ocaml-api-for-z3-using-opam You can just add `CClLib: -lstdc++` to your library/executable in `_oasis`. Though there are tons of other possibilities, where it can fail, so if it doesn't help then, please, provide your `_oasis` and `_build/_log` files. – ivg Jul 23 '19 at 12:25
  • Unfortunately this failed as predicted I hence added a link to the _oasis and _log files – John Jul 23 '19 at 18:10
  • The links are under restricted access, it is better to either put them here or a public gist. You can anonymize them if you don't want your personal information to leak. – ivg Jul 23 '19 at 18:18
  • sorry forgot to adjust the share settings – John Jul 23 '19 at 18:57
  • thanks a lot worked brilliantly – John Jul 24 '19 at 06:51
  • 1
    future referencees kindly note that the command to be added to _oasis file should be CCLib: -lstdc++ – John Jul 24 '19 at 10:58

0 Answers0