尝试构建玩具项目OCaml LLVM,然后编译失败并显示以下消息:
(base) shijiex@shijie:/other/projectbase/llvm/toy$ ocamlbuild toy.byte
Finished, 0 targets (0 cached) in 00:00:00.
+ /usr/bin/ocamlc -c -o codegen.cmo codegen.ml
File "codegen.ml", line 5, characters 5-9:
Error: Unbound module Llvm
Command exited with code 2.
Compilation unsuccessful after building 10 targets (8 cached) in 00:00:00.
意识到这是llvm软件包问题,我尝试安装llvm
软件包
(base) shijiex@shijie:/other/projectbase/llvm/toy$ ocamlfind install llvm
ocamlfind: The META file is missing
对于这个META文件非常困惑。尝试安装软件包ocamfind时,是否应该手动创建* .meta文件(以及在何处)?以及如何解决这个问题?谢谢。
此处的版本:ocaml 4.02.3,Ubuntu 1604。 llvm软件包通过opam安装:
(base) shijiex@shijie:/other/projectbase/llvm/toy$ opam list
# Installed packages for 4.02.3:
.....
base-threads base Threads library distributed with the OCaml compiler
base-unix base Unix library distributed with the OCaml compiler
conf-cmake 1 Virtual package relying on cmake
conf-llvm 6.0.0 Virtual package relying on llvm library installation.
conf-m4 1 Virtual package relying on m4
conf-pkg-config 1.1 Virtual package relying on pkg-config installation.
conf-python-2-7 1.0 Virtual package relying on Python-2.7 installation.
ctypes 0.14.0 Combinators for binding to C libraries without writing any C.
depext 1.0.5 Query and install external dependencies of OPAM packages
dune 1.2.1 Fast, portable and opinionated build system
integers 0.2.2 Various signed and unsigned integer types for OCaml
jbuilder transition This is a transition package, jbuilder is now named dune. Use the dune
llvm 6.0.0 The OCaml bindings distributed with LLVM
ocamlbuild 0 Build system distributed with the OCaml compiler since OCaml 3.10.0
ocamlfind 1.8.0 A library manager for OCaml