Cygwin 未绑定模块llvm

Cygwin 未绑定模块llvm,cygwin,ocaml,llvm,ocamlbuild,ocamlfind,Cygwin,Ocaml,Llvm,Ocamlbuild,Ocamlfind,我一直在学习OCaml的LLVM万花筒教程。在上,我已导航到文件夹中的示例代码 OCaml万花筒\Chapter3 我在使用编译时遇到了一个问题 ocamlbuild toy.byte 在cygwin上。这是教程中给出的要编译的代码 我得到的错误是 ''ocamlc.opt -c -o codegen.cmo codegen.ml File "codegen.ml", line 5, characters 5-9: Error: Unbound module Llvm Exit code 2

我一直在学习OCaml的LLVM万花筒教程。在上,我已导航到文件夹中的示例代码

OCaml万花筒\Chapter3

我在使用编译时遇到了一个问题

ocamlbuild toy.byte
在cygwin上。这是教程中给出的要编译的代码

我得到的错误是

''ocamlc.opt -c -o codegen.cmo codegen.ml
File "codegen.ml", line 5, characters 5-9:
Error: Unbound module Llvm
Exit code 2 while executing this command:
''ocamlc.opt -c -o codegen.cmo codegen.ml
我找到了一些解决这个问题的办法。我找到的一个解决办法是使用

ocamlbuild -use-ocamlfind toy.byte -package llvm
而不是

ocamlbuild toy.byte
但是,当我尝试时,我收到了以下错误:

Failure: ocamlfind not found on path, but -no-ocamlfind not used.
为了解决这个问题,我尝试了:

opam install ocamlfind
但是已经安装了ocamlfind

我发现的另一个解决方案是:

opam install llvm
这导致:

The following actions will be performed:
  - install llvm 3.7

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[llvm: ./install.sh 3.7] Command started
[ERROR] The installation of llvm failed at "./install.sh 3.7 make
        C:\\cygwin64\\home\\setup\\.opam\\system
        C:\\cygwin64\\home\\setup\\.opam\\system\\lib".
[llvm: ocamlfind remove] Command started

#=== ERROR while installing llvm.3.7 ==========================================#
# opam-version         1.3.0~dev2 (d4f7e01216dbb44af4e7cc6539a1b0afa9be9d2c)
# os                   win32
# command              bash -c ./install.sh 3.7 make C:/cygwin64/home/setup/.opa                             m/system C:/cygwin64/home/setup/.opam/system/lib
# path                 C:\cygwin64\home\setup\.opam\system\build\llvm.3.7
# exit-code            2
# env-file             C:\cygwin64\home\setup\.opam\system\build\llvm.3.7\llvm-1                             0768-58c514.env
# stdout-file          C:\cygwin64\home\setup\.opam\system\build\llvm.3.7\llvm-1                             0768-58c514.out
# stderr-file          C:\cygwin64\home\setup\.opam\system\build\llvm.3.7\llvm-1                             0768-58c514.err
### stdout ###
# [...]
# config.status: executing bindings/ocaml/Makefile.ocaml commands
# make: Entering directory '/home/setup/.opam/system/build/llvm.3.7/build/bindin                             gs'
# llvm[0]: Constructing LLVMBuild project information.
# make[1]: Entering directory '/home/setup/.opam/system/build/llvm.3.7/build/bin                             dings/ocaml'
# make[2]: Entering directory '/home/setup/.opam/system/build/llvm.3.7/build/bin                             dings/ocaml/llvm'
# llvm[2]: Compiling llvm_ocaml.c for Release+Asserts build
# /home/setup/.opam/system/build/llvm.3.7/Makefile.rules:1536: recipe for target                              '/home/setup/.opam/system/build/llvm.3.7/build/bindings/ocaml/llvm/Release+Asse                             rts/llvm_ocaml.o' failed
# make[2]: Leaving directory '/home/setup/.opam/system/build/llvm.3.7/build/bind                             ings/ocaml/llvm'
# /home/setup/.opam/system/build/llvm.3.7/Makefile.rules:880: recipe for target                              'all' failed
# make[1]: Leaving directory '/home/setup/.opam/system/build/llvm.3.7/build/bind                             ings/ocaml'
# /home/setup/.opam/system/build/llvm.3.7/Makefile.rules:939: recipe for target                              'ocaml/.makeall' failed
# make: Leaving directory '/home/setup/.opam/system/build/llvm.3.7/build/binding                             s'
### stderr ###
# [...]
# configure: WARNING: dlopen() not found - disabling plugin support
# configure: WARNING: mmap() of a fixed address required but not supported
# configure: WARNING: mmap() of files required but not found
# configure: WARNING: --enable-bindings=ocaml specified, but OUnit 2 is not inst                             alled. Tests will not run
# + make -C bindings all SYSTEM_LLVM_CONFIG=llvm-config
# gcc.exe: error: /home/setup/.opam/system/build/llvm.3.7/bindings/ocaml/llvm/ll                             vm_ocaml.c: No such file or directory
# gcc.exe: fatal error: no input files
# compilation terminated.
# /usr/bin/rm: cannot remove '/home/setup/.opam/system/build/llvm.3.7/build/bind                             ings/ocaml/llvm/Release+Asserts/llvm_ocaml.d.tmp': No such file or directory
# make[2]: *** [/home/setup/.opam/system/build/llvm.3.7/build/bindings/ocaml/llv                             m/Release+Asserts/llvm_ocaml.o] Error 1
# make[1]: *** [all] Error 1
# make: *** [ocaml/.makeall] Error 2



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  - install llvm 3.7
No changes have been performed

=-=- llvm.3.7 troubleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext llvm.3.7' may help you find the correct installation for your
   system.
我使用的是来自的llvm版本3.8.0和OCaml版本4.02.3


我走对了吗?我需要做些什么来解决这个问题?

正如我在您的问题中所回答的,您最好的方法是不要使用Windows

OPAM现在可以在Cygwin OCaml中使用,甚至可以在MinGW OCaml中使用(使用Cygwin OPAM二进制文件),但OPAM存储库中的软件包没有在这些环境中进行测试。除非您有在Windows中开发OCaml程序的经验,否则不要使用它们

如果您坚持使用Windows,请在
C:\cygwin64\home\setup\.opam\system\build\llvm.3.7检查生成。应该有stdout和stderr日志文件来帮助理解发生了什么