英文:
Ocamlfind cannot find package 'zmq'
问题
我试图编译Ocaml工具作为Quantum Package 2的一部分。错误提示如下:
[2/3] Compiling OCaml tools
make: Entering directory '/home/parallels/qp2/ocaml'
ocamlbuild -j 0 -cflags "-g" -lflags "-g" -ocamlopt "opt -O3 -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100" qptypes_generator.byte -use-ocamlfind
Finished, 0 targets (0 cached) in 00:00:00.
+ ocamlfind ocamldep -package zarith,zmq,str,sexplib,ppx_sexp_conv,ppx_deriving,getopt -modules qptypes_generator.ml > qptypes_generator.ml.depends
ocamlfind: Package `zmq' not found
Command exited with code 2.
所以我使用了 ocamlfind list
来查看我是否安装了zmq。最初我没有安装,所以我使用了 opam install zmq
,但之后zmq仍然不在列表中,并且错误仍然存在。
所以我从这里克隆了git并手动安装。这个过程有点奇怪(makefile中没有包含任何目录),但之后zmq出现在ocamlfind列表中。然而,在编译时,它仍然提示我原始的错误。
我猜我需要告诉ocamlfind zmq包的位置,但我完全不知道应该怎么做。
英文:
I was trying to compile Ocaml tools as part of the Quantum Package 2. The error prompts me
[2/3] Compiling OCaml tools
make: Entering directory '/home/parallels/qp2/ocaml'
ocamlbuild -j 0 -cflags "-g" -lflags "-g" -ocamlopt "opt -O3 -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100" qptypes_generator.byte -use-ocamlfind
Finished, 0 targets (0 cached) in 00:00:00.
+ ocamlfind ocamldep -package zarith,zmq,str,sexplib,ppx_sexp_conv,ppx_deriving,getopt -modules qptypes_generator.ml > qptypes_generator.ml.depends
ocamlfind: Package `zmq' not found
Command exited with code 2.
So I used ocamlfind list
to see whether I had installed zmq. Initially I hadn't so I used opam install zmq
, but after that zmq was still not on the list, and the error persisted.
So I git cloned from here and did a manual install. The process was fishy (makefile didn't contain any directories) but after which zmq appeared in the ocamlfind list. Yet in compilation it still prompted me with the original error.
I am guessing I need to sort of tell ocamlfind where zmq package is but that is exactly of what I have no idea.
答案1
得分: 1
这似乎是安装了多个 ocamlfind 的问题。您应该检查路径中的 ocamlfind
是哪个,使用以下命令检查:
which ocamlfind
如果该命令不返回您的 QP_Root
中的路径,则您可能希望:
- 首先,使用
eval $(path_to_local_opam env)
初始化您的环境 - 其次,使用
opam install ocamlfind
安装 ocamlfind。 - 第三,检查
zmq
是否在opam
和ocamlfind
中可见。
英文:
That sounds like an issue with multiple ocamlfind installed. You should check which ocamlfind
is in path with
which ocamlfind
if the command doesn't return a path in your QP_Root
, you probably want to:
- First, initialize your environment with
eval $(path_to_local_opam env)
- Second, install ocamlfind with
opam install ocamlfind
. - Third, check that
zmq
is visible with bothopam
andocamlfind
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论