Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed compilation of ocaml target #7

Open
monniaux opened this issue Mar 29, 2017 · 6 comments
Open

failed compilation of ocaml target #7

monniaux opened this issue Mar 29, 2017 · 6 comments

Comments

@monniaux
Copy link

monniaux commented Mar 29, 2017

Make in ocaml_interface fails due to path to libraries not being correctly set.
ocamlopt.opt -g -I /home/monniaux/.opam/4.04.0/lib/gmp -I /home/monniaux/.opam/4.04.0/lib/apron -o mlexample.opt bigarray.cmxa gmp.cmxa apron.cmxa elina_poly.cmxa mlexample.ml
/usr/bin/ld: cannot find -lelina_poly_caml
/usr/bin/ld: cannot find -loptpoly
/usr/bin/ld: cannot find -lcamlidl
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
Makefile:87: recipe for target 'mlexample.opt' failed

@smagill
Copy link

smagill commented Apr 17, 2017

I'm seeing the same thing.

@GgnDpSngh
Copy link
Contributor

Hi all,

Specify the location of the libraries in the CAML_LD_LIBRARY_PATH variable in ocaml_interface/Makefile (updated). Let me know if it works.

Cheers,
Gagan

@Isweet
Copy link

Isweet commented Jun 7, 2017

I'm still having trouble with this. It seems that CAML_LD_LIBRARY_PATH was replaced with LD_LIBRARY_PATH, and this variable in master is set to:

export LD_LIBRARY_PATH=.:../elina_poly:

which is where liboptpoly.so lives. However, I'm still getting the following error:

/usr/bin/ld: cannot find -loptpoly

(I am also still getting /usr/bin/ld: cannot find -lelina_poly_caml, but I haven't updated LD_LIBRARY_PATH appropriately for this library).

@GgnDpSngh
Copy link
Contributor

Hi Ian,

Did you try setting the LD_LIBRARY_PATH before calling make? Can you specify the compiler version and the operating system on your machine?

Cheers,
Gagan

@Isweet
Copy link

Isweet commented Jun 8, 2017

The LD_LIBRARY_PATH is already set to include the directory in which liboptpoly.so resides. So I expect that even without modifying this variable, I should not get the error that I mentioned above.

That being said, I did try to modify this variable to also include the location of the libelina_poly_caml library, and still got the same errors.

I am using Debian 3.16.43-2, with gcc version 4.9.2.

Thanks,

Ian

@skcho
Copy link
Contributor

skcho commented Jul 18, 2018

Hello,

I sent a pull request #31 , in which liboptpoly.so and the other shared objects are compiled with the rpath option, so they can be found at runtime, after the installation. I hope this help.

I think the easiest way is to install using opam. (From the above command, I assumed you installed Apron and the other dependencies using opam.)

$ opam pin add elina .
$ cd ocaml_interface
$ ocamlopt.opt -g -I `ocamlfind query gmp` -I `ocamlfind query apron` -I `ocamlfind query elina` -o mlexample.opt bigarray.cmxa gmp.cmxa apron.cmxa elina_poly.cmxa mlexample.ml
$ ./mlexample.opt

or you may be able to install Elina to your own directory (e.g. ~/install in this example):

$ ./configure -use-opam -use-apron --prefix ~/install --apron-prefix `opam config var share`/apron
$ make
$ make install
$ cd ocaml_interface
$ ocamlopt.opt -g -I `ocamlfind query gmp` -I `ocamlfind query apron` -I ~/install/lib -o mlexample.opt bigarray.cmxa gmp.cmxa apron.cmxa elina_poly.cmxa mlexample.ml
$ ./mlexample.opt

I tested this on Debian GNU/Linux 9 (stretch) and gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516.

Sincerely,
Sungkeun

GgnDpSngh pushed a commit that referenced this issue Jun 13, 2021
Merge with current at eth-sri
EvitanRelta pushed a commit to Grena-verifier/ELINA that referenced this issue Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants