OCaml Compile Error: /usr/bin/ld: cannot find -lstr

ToO*_*sIK 11 linux ubuntu ocaml nltk

I am trying to compile the source code of MEGAM Ocaml library on an Ubuntu 64 machine.

I have OCaml installed (v 3.12.1), using sudo apt-get install ocaml.

I am having an issue when running the "make" command in the terminal on the unzipped source code, with OCaml returning the error:

/user/bin/ld: cannot find -lstr
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

The makefile is producing the following two commands:

 ocamldep *.ml > .depend
Run Code Online (Sandbox Code Playgroud)

No error when run

ocamlc -g -custom -o megam str.cma -cclib -lstr bigarray.cma -cclib -lbigarray unix.cma -cclib -lunix -I /usr/lib/ocaml/caml fastdot_c.c fastdot.cmo intHashtbl.cmo arry.cmo util.cmo data.cmo bitvec.cmo cg.cmo wsemlm.cmo bfgs.cmo pa.cmo perceptron.cmo radapt.cmo kernelmap.cmo abffs.cmo main.cmo

Throws the error above when run.

我已经尝试从编译命令中删除-lstr,它停止抛出该特定错误但开始抛出另一个错误(Reference to undefined global 'Bigarray'),这使得我可能都是我在OCaml安装期间遗漏的东西,某种PATH或参考我需要设置.

任何帮助都非常感激,即使它只是在黑暗中拍摄,因为我真的很难想出任何东西!

jro*_*uie 15

这里给出的指令允许我编译没有错误.归结为:

locate libcamlstr
Run Code Online (Sandbox Code Playgroud)

这告诉我libcamlstr可以在/usr/lib/ocaml(YMMV)找到,所以我这样做:

cd /usr/lib/ocaml
sudo ln -s libcamlstr.a libstr.a
Run Code Online (Sandbox Code Playgroud)

然后我就可以编译项目了:

cd /usr/local/src/cil
make clean && ./configure && make
Run Code Online (Sandbox Code Playgroud)