OCamlbuild无法编译抱怨的Netsys实现,但未提供该实现 [英] OCamlbuild fails to compile complaining implementation of Netsys is not provided when it is

查看:81
本文介绍了OCamlbuild无法编译抱怨的Netsys实现,但未提供该实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试编译使用 xmlrpc-light库编写的XML-RPC服务器在带有ocamlbuild的OCaml中,但我得到了:

I'm trying to compile an XML-RPC server written using the xmlrpc-light library in OCaml with ocamlbuild but I get:

$ ocamlbuild server.native
Finished, 0 targets (0 cached) in 00:00:00.
+ ocamlfind ocamlopt -linkpkg -package xmlrpc-light -package unix -package threads -package netsys -thread server.cmx -o server.native
File "_none_", line 1, characters 0-1:
Error: No implementations provided for the following modules:
         Netsys referenced from /usr/lib/ocaml/equeue/equeue.cmxa(Uq_engines)
Command exited with code 2.
Compilation unsuccessful after building 4 targets (3 cached) in 00:00:00.

请注意,我有一个myocamlbuild.ml文件,例如此文件和一个包含一行的_tags文件:

Note that I have a myocamlbuild.ml file like this one and a _tags file containing a single line:

<server.ml> or <server.native>: pkg_unix,pkg_netsys,pkg_xmlrpc-light,pkg_threads

在其他情况下(例如,对于同一客户端/服务器应用程序的client.native),该插件对我来说效果很好,但对于server.native而言,它却不是.该投诉表明该库Netsys对编译器不可用.但是我们得到

This plugin has worked fine for me in other cases (for client.native of the same client/server application, for example) but not for server.native. The complaint suggests that the library Netsys is not available to the compiler. But we get

$ ocamlfind query netsys
/usr/lib/ocaml/netsys

表示netsys已安装在/usr/lib/ocaml/netsys中.检查该目录可以得到:

meaning that netsys is installed in /usr/lib/ocaml/netsys. Inspecting that directory gives me:

$ ls /usr/lib/ocaml/netsys
META  libnetsys.a  netsys.a  netsys.cma  netsys.cmi  netsys.cmxa  netsys.mli

$ ocamlfind list | grep netsys
netsys              (version: 2.2.9)

因此,确实有一个名为netsys的库已安装,它确实具有准备使用的cmxa文件,但是由于某些奇怪的原因,ocamlbuild抱怨说没有为Netsys模块提供实现. ocamlbuild可以读取/usr/lib/ocaml/equeue/equeue.cmxa的事实应该足以得出结论,就查找库而言,关于环境($ PATH等)的一切都应该没问题.

So, there is indeed a library called netsys installed, it does have a cmxa file ready to be used, but for some strange reason, ocamlbuild complaints that there is no implementation provided for the module Netsys. The fact that ocamlbuild could read /usr/lib/ocaml/equeue/equeue.cmxa should be enough to conclude that everything should be fine regarding environment ($PATH, etc.) in terms of finding libraries.

这一切都在Debian 6.0中,而我的OCaml版本是3.11.2.

This is all in Debian 6.0 and my OCaml's version is 3.11.2.

浏览后,我发现了 svn提交消息(server.ml和client.ml的代码-in-an-xml-rpc-light-server-in-ocaml>其他问题).如果我从server.ml中删除Mutex东西,仍然会发生错误.但是,如果我另外从_tags文件中删除pkg_threads,则所有内容都会编译.因此,我的结论是,我不能直接将线程库与xmlrpc-light一起使用,这很奇怪.

After some browsing, I found an svn commit message (repository diff) which suggests that it may have to do with the number of threads used. And, in fact, I'm using a Mutex somewhere in my code (check the code of server.ml and client.ml in this other question). If I remove the Mutex stuff from my server.ml the error still happens. But if I additionally remove the pkg_threads from the _tags file then everything compiles. So, my conclusion is that I can't directly use the threads library with xmlrpc-light, which is weird.

推荐答案

IMHO排队META错误.将netsys添加到依赖项可以解决您的问题:

IMHO equeue META is wrong. Adding netsys to dependencies fixes your issue :

sed -i 's/threads/netsys,threads/' /usr/lib/ocaml/equeue/META

这篇关于OCamlbuild无法编译抱怨的Netsys实现,但未提供该实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆