【问题标题】:ocaml batteries compiling:ERROR: Leftover OCaml compilation files:ocaml 电池编译:错误:剩余的 OCaml 编译文件:
【发布时间】:2012-11-22 08:49:35
【问题描述】:
Build mode: shared
ocamlbuild -no-links syntax.otarget byte.otarget src/batteries_help.cmo META shared.otarget
Finished, 0 targets (0 cached) in 00:00:00.
SANITIZE: a total of 3 files that should probably not be in your source tree
  has been found. A script shell file
  "/home/fanzhihang/batteries-1.4.1/_build/sanitize.sh" is being created.
  Check this script and run it to remove unwanted files or use other options
  (such as defining hygiene exceptions or using the -no-hygiene option).
Warning: Leftover OCaml type annotation files:
  File pa_estring_top.annot in libs/estring has suffix .annot
IMPORTANT: I cannot work with leftover compiled files.
ERROR: Leftover OCaml compilation files:
  File pa_estring_top.cmo in libs/estring has suffix .cmo
  File pa_estring_top.cmi in libs/estring has suffix .cmi
Exiting due to hygiene violations.
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:02.
make: *** [all] Error 1

电池的这个编译错误真的让我很困惑。我应该如何修复错误?

【问题讨论】:

    标签: ocaml ocaml-batteries


    【解决方案1】:

    你知道OPAM吗?

    $ opam install batteries
    

    它将自动安装所有依赖项。

    [编辑] 如何安装opam:

    $ git clone https://github.com/OCamlPro/opam
    $ ./configure # (or ./configure --prefix=$HOME if you want to install under your $HOME)
    $ make
    $ make install
    $ opam init
    $ eval `opam config -env`
    

    【讨论】:

    • 如果我通过它安装电池,我可以修复安装路径吗?我没有root权限。
    • 安装的 OPAM 遵循这里的教程:opam.ocamlpro.com/doc/Quick_Install.html[link]./opam64:/lib64/libc.so.6: 版本GLIBC_2.7' not found (required by ./opam64)code`
    • 你不需要是root。尝试从源代码here 编译 opam,然后重试opam install batteries。我将为 opam 安装部分编辑我的帖子。
    • 你绝对应该使用./configure --prefix=$HOME
    • opam init 无法下载opam.ocamlpro.com/urls.txt,请检查您的连接设置。 'opam init' 失败 code 我应该如何检查我的连接设置?
    【解决方案2】:

    你可以执行脚本:

    /home/fanzhihang/batteries-1.4.1/_build/sanitize.sh
    

    这将删除 OCamlbuild 认为不应该在此处的文件(即 .annot、.cmo 和错误所涉及的 .cmi)。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多