OPAM failed to install CIL because computer cannot find package Ocamlfind
After I installed opam, I init an opam
opam init
Then install cil using
opam install cil
Terminal just told me that cil failed to be installed. But one directory was created under
~/.opam/system/build/cil1.7.3
So I go to the following directory
/Users/kaidiwang/.opam/system/build/cil.1.7.3
to execute
./configure
The terminal told me that I didn’t install ocamlfind. So I tried to install it using
opam install ocamlfind
and terminal told me I had installed it. But the response from the following command is none.
which ocamlfind
So I guess the computer cannot find it while opam knows where it is. With the following code, I got all path related to opam:
eval $(opam config env) or eval 'opam config env'
and the response is:
CAML_LD_LIBRARY_PATH="/Users/kaidiwang/.opam/system/lib/stublibs:/usr/local/lib/ocaml/stublibs"; export CAML_LD_LIBRARY_PATH;
OPAMUTF8MSGS="1"; export OPAMUTF8MSGS;
MANPATH=":/Users/kaidiwang/.opam/system/man"; export MANPATH;
PERL5LIB="/Users/kaidiwang/.opam/system/lib/perl5:"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/Users/kaidiwang/.opam/system/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="/Users/kaidiwang/.opam/system/bin:/anaconda2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS"; export PATH;
And I found ocamlfind in this directory
/Users/kaidiwang/.opam/system/bin
To help computer to find ocamlfind, I copy ocamlfind into the following directory
/usr/local/bin
Then I execute the following command
./configure
under
/Users/kaidiwang/.opam/system/build/cil.1.7.3
The final result is
CIL configuration:
(optional) cl.exe found: HAS_MSVC no
gcc to use CC gcc
default compiler DEFAULT_COMPILER _GNUCC
CIL version CIL_VERSION 1.7.3
CIL features CIL_FEATURES
Extra source directories EXTRASRCDIRS