码迷,mamicode.com
首页 > 其他好文 > 详细

编译opam报错

时间:2017-06-20 17:52:28      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:opam   google   gdrive   

0x01:打算在VPS上安装个Google的网盘,环境需要安装OPAM,在检查环境时就提示缺少not found的一些包。

#./configure
checking for OCaml findlib package unix... found
checking for OCaml findlib package extlib... not found
checking for OCaml findlib package re... not found
checking for OCaml findlib package re.str... not found
checking for OCaml findlib package re.pcre... not found
checking for OCaml findlib package re.glob... not found
checking for OCaml findlib package cmdliner... not found
checking for OCaml findlib package ocamlgraph... not found
checking for OCaml findlib package cudf... not found
checking for OCaml findlib package dose3.common... not found
checking for OCaml findlib package dose3.algo... not found
checking for OCaml findlib package jsonm... not found

0x02:心想也许直接make能过去,结果是下面一样报错了。

#make
make -C src opam-lib
make[1]: Entering directory ‘/home/roott/opam/src‘
make[1]: *** No rule to make target ‘opam-lib‘.  Stop.
make[1]: Leaving directory ‘/home/roott/opam/src‘
Makefile:26: recipe for target ‘opam-lib‘ failed
make: *** [opam-lib] Error 2


0x03:按照检查提示,用‘make lib-ext’可以自动下载。

============================================================================
Some dependencies are missing. If you are just interested in the stand-alone
‘opam‘ binary, run ‘make lib-ext‘ to download and include them.
============================================================================

0x04:经过make lib-ext后下载原来链接失效了,造成cppo-1.1.2.tar.gz解压失败。

# make lib-ext
make -C src_ext lib-ext
make[1]: Entering directory ‘/home/roott/opam/src_ext‘
[ -e  cppo-1.1.2.tar.gz ] || curl  -OL http://mjambon.com/releases/cppo/cppo-1.1.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9340  100  9340    0     0  97476      0 --:--:-- --:--:-- --:--:-- 97291
ocaml ../shell/md5check.ml cppo-1.1.2.tar.gz f1a551639c0c667ee8840d95ea5b2ab7
MD5 for cppo-1.1.2.tar.gz differ:
  expected: f1a551639c0c667ee8840d95ea5b2ab7
    actual: baeb004575d58a7b186737a3be6d5f07
mkdir -p tmp
cd tmp && tar xfz ../cppo-1.1.2.tar.gz
tar (child): ../cppo-1.1.2.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Makefile:58: recipe for target ‘cppo.stamp‘ failed
make[1]: *** [cppo.stamp] Error 2
make[1]: Leaving directory ‘/home/roott/opam/src_ext‘
Makefile:29: recipe for target ‘lib-ext‘ failed
make: *** [lib-ext] Error 2

0x05:到/home/root/opam/src_ext目录下看到文件只有45字节肯定不对。

-rwxrwxr-x 1 root root    45 Jun 20 15:15 cppo-1.1.2.tar.gz

0x06:原链接失效只能手动下载cppo-1.1.2.tar.gz,google找到一个github上的一个链接

# wget https://github.com/mjambon/cppo/archive/v1.1.2.tar.gz

0x07:解压cppo将里面文件覆盖到opam文件夹里。我的opam放在home下

#tar -zxf v1.1.2.tar.gz
#mv -f cppo-1.1.2/ ~/opam/

0x08:覆盖完再次‘make’,成功。

make
[15:35:12]echo ‘let cppo_version = "1.1.2"‘ > cppo_version.ml
[15:35:12]ocamlyacc cppo_parser.mly
[15:35:12]ocamllex cppo_lexer.mll
[15:35:12]368 states, 13139 transitions, table size 54764 bytes
[15:35:12]3729 additional bytes used for bindings
[15:35:12]ocamlopt -o cppo -dtypes unix.cmxa str.cmxa cppo_version.ml cppo_types.ml cppo_parser.mli cppo_parser.ml cppo_lexer.ml cppo_command.ml cppo_eval.ml cppo_main.ml
[15:35:14]cd ocamlbuild_plugin && ocamlbuild -use-ocamlfind ocamlbuild_cppo.cma ocamlbuild_cppo.cmxa ocamlbuild_cppo.a ocamlbuild_cppo.cmxs
[15:35:15]Finished, 8 targets (0 cached) in 00:00:00.
[15:35:31]roott@LosAngeles:~/opam$ sudo make install
[15:35:37][sudo] password for roott: 
[15:35:38]install -m 0755 cppo /usr/local/bin || [15:35:38]        install -m 0755 cppo.exe /usr/local/bin
[15:35:38]ocamlfind install -patch-version 1.1.2 "cppo_ocamlbuild" [15:35:38]        META ocamlbuild_plugin/_build/ocamlbuild_cppo.cmi ocamlbuild_plugin/_build/ocamlbuild_cppo.cma ocamlbuild_plugin/_build/ocamlbuild_cppo.cmxa ocamlbuild_plugin/_build/ocamlbuild_cppo.a ocamlbuild_plugin/_build/ocamlbuild_cppo.cmxs
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmxs
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.a
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmxa
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cma
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/ocamlbuild_cppo.cmi
[15:35:38]Installed /usr/local/lib/ocaml/4.02.3/cppo_ocamlbuild/META

0x09:在下面就是安装。

#sudo make install





编译opam报错

标签:opam   google   gdrive   

原文地址:http://wutou.blog.51cto.com/615096/1940250

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!