goblint / cil

C Intermediate Language
https://goblint.github.io/cil/
Other
40 stars 16 forks source link

Unbound module CIL #127

Closed nguyenthanhvuh closed 1 year ago

nguyenthanhvuh commented 1 year ago

Hello, I have a project that uses the original CIL and I can compile file using something like

ocamlopt                        -I ../../EXTERNAL_FILES/cil/_build/src -I ../../EXTERNAL_FILES/cil/_build/src/ext -I ../../EXTERNAL_FILES/cil/_build/src/frontc -I ../../EXTERNAL_FILES/cil/_build/src/ocamlutil  -c common.ml

I have successfully built goblint-cil using dune as given in the instruction, but now I am not sure how to properly link to goblint-cil library. E.g., doing the follow gives error

ocamlopt                        -I /usr/lib/ocaml/goblint-cil/  -c common.ml
File "common.ml", line 1, characters 5-8:
1 | open Cil
         ^^^
Error: Unbound module Cil

I am probably missing something really simple here.

sim642 commented 1 year ago

Starting from version 2.0.0 we wrap our library into the GoblintCil module to reduce naming conflicts.

nguyenthanhvuh commented 1 year ago

Thanks, changing to GoblintCil works, but now at the end of my build I have this other error about Z and Big_int_Z

ocamlopt                        -I /usr/lib/ocaml/goblint-cil/  -c common.ml
ocamlopt                        -I /usr/lib/ocaml/goblint-cil/  -c instr.ml
ocamlopt                        -I /usr/lib/ocaml/goblint-cil/  -o instr.exe unix.cmxa str.cmxa nums.cmxa goblintCil.cmxa common.cmx instr.cmx
File "_none_", line 1:
Error: No implementations provided for the following modules:
         Z referenced from /usr/lib/ocaml/goblint-cil/goblintCil.cmxa(GoblintCil__Cil)
         Big_int_Z referenced from /usr/lib/ocaml/goblint-cil/goblintCil.cmxa(GoblintCil__Cilint)
sim642 commented 1 year ago

Our fork has been updated to use Zarith instead of Num, so you'll have to install and link that instead.

nguyenthanhvuh commented 1 year ago

I got it to work. Thank you for the quick replies.