Opam / findlib警告“......有多个定义”

时间:2014-04-07 09:23:33

标签: ocaml opam ocamlfind

我在我的主目录中有一个本地安装的opam,以及一个ocaml编译器和几个库的(fedora)软件包安装。

在任何项目中运行ocamlbuild命令都会发出很多警告:

findlib: [WARNING] Package dynlink has multiple definitions in /home/choeger/.opam/system/lib/dynlink/META, /usr/lib64/ocaml/dynlink/META
findlib: [WARNING] Package bigarray has multiple definitions in /home/choeger/.opam/system/lib/bigarray/META, /usr/lib64/ocaml/bigarray/META
findlib: [WARNING] Package unix has multiple definitions in /home/choeger/.opam/system/lib/unix/META, /usr/lib64/ocaml/unix/META
findlib: [WARNING] Package camlp4 has multiple definitions in /home/choeger/.opam/system/lib/camlp4/META, /usr/lib64/ocaml/camlp4/META
findlib: [WARNING] Package threads has multiple definitions in /home/choeger/.opam/system/lib/threads/META, /usr/lib64/ocaml/threads/META

我对opam的理解是支持不同位置的多个安装,但这些警告会混乱任何编译输出。

有没有办法告诉findlib我知道这些其他安装并且不打印这些无用的警告?

编辑:因为我被问到我的ocamlfind输出:

choeger@daishi ~ % ocamlfind printconf
    Effective configuration:
    Configuration file:
        /home/choeger/.opam/system/lib/findlib.conf
    Search path:
        /home/choeger/.opam/system/lib
        /usr/lib64/ocaml
    Packages will be installed in/removed from:
        /home/choeger/.opam/system/lib
    META files will be installed in/removed from:
        the corresponding package directories
    The standard library is assumed to reside in:
        /usr/lib64/ocaml
    The ld.conf file can be found here:
        /usr/lib64/ocaml/ld.conf

1 个答案:

答案 0 :(得分:1)

我刚刚找到问题的解决方案:

 sudo yum remove ocaml-findlib

显然,这个软件包附带了所有那些双重定义的ocaml库。我仍然认为opam应该能够处理这种情况(IMO更具体的包管理器应该始终对更多非特定安装是明智的),但是opam还没有被fedora打包,所以应该期待这样的事情。至少烦人的警告消失了。