[英]How to build a Xen unikernel of Mirage OS
I read this document( http://openmirage.org/wiki/hello-world ) and tried to build a xen unikernel as follows: 我阅读本文档( http://openmirage.org/wiki/hello-world )并尝试构建一个xen unikernel,如下所示:
mirage configure --xen
make depend
make
But failed at compilation: 但编译失败:
ocamlbuild -classic-display -use-ocamlfind -pkgs lwt.syntax,mirage-console.xen,mirage-types.lwt -tags "syntax(camlp4o),annot,bin_annot,strict_sequence,principal" -tag-line "<static*.*>: -syntax(camlp4o)" -cflag -g -lflags -g,-linkpkg,-dontlink,unix main.native.o
ocamlfind ocamldep -package mirage-types.lwt -package mirage-console.xen -package lwt.syntax -syntax camlp4o -modules main.ml > main.ml.depends
ocamlfind ocamlc -c -g -annot -bin-annot -principal -strict-sequence -package mirage-types.lwt -package mirage-console.xen -package lwt.syntax -syntax camlp4o -o main.cmo main.ml
ocamlfind ocamlopt -c -g -annot -bin-annot -principal -strict-sequence -package mirage-types.lwt -package mirage-console.xen -package lwt.syntax -syntax camlp4o -o main.cmx main.ml
pkg-config --print-errors --exists mirage-xen
Package mirage-xen was not found in the pkg-config search path.
Perhaps you should add the directory containing `mirage-xen.pc'
to the PKG_CONFIG_PATH environment variable No package 'mirage-xen' found make: *** [build] Error 1 到PKG_CONFIG_PATH环境变量没有发现包'mirage-xen'成为:*** [build]错误1
I installed mirage-xen by opam install mirage-xen
successfully. 我成功地通过
opam install mirage-xen
。 But in my .opam directory, there are no mirage-xen.pc
. 但是在我的.opam目录中,没有
mirage-xen.pc
。
They should appear in your OPAM prefix. 它们应出现在您的OPAM前缀中。 I get:
我明白了:
$ ls $(opam config var prefix)/lib/pkgconfig
gmp.pc mirage-xen-ocaml-bindings.pc mirage-xen-posix.pc
libminios-xen.pc mirage-xen-ocaml.pc openlibm.pc
mirage-xen-minios.pc mirage-xen.pc
(you may have fewer; mirage-xen.pc
is the important one) (你可能会少一些;
mirage-xen.pc
是重要的一个)
Assuming they're there, check the project's Makefile is setting PKG_CONFIG_PATH
correctly. 假设它们在那里,检查项目的Makefile是否正确设置
PKG_CONFIG_PATH
。
Chances are that your version of mirage-xen
is out of date. 您的
mirage-xen
版本可能已过时。 You can update it via OPAM by: 您可以通过OPAM更新它:
opam update -u
opam info mirage-xen
Make sure that you have mirage-xen
version 2.1.1 or greater (the latest as of this comment is 2.1.3). 确保你有
mirage-xen
版本2.1.1或更高版本(此评论的最新版本是2.1.3)。
If you don't pick up the upgrade, then you may have a local Git checkout of the central package database. 如果您没有接受升级,那么您可能有一个中央包数据库的本地Git签出。 Confirm this by looking at the output of:
通过查看输出来确认:
opam remote
The output of this should tell you where your local git
checkout is, and so navigate there and refresh from git://github.com/ocaml/opam-repository
and then run opam update -u
. 这个输出应该告诉你本地
git
checkout的位置,然后在那里导航并从git://github.com/ocaml/opam-repository
刷新,然后运行opam update -u
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.