无法将 libsvm 与 OCaml 一起使用

Unable to use libsvm with OCaml

我尝试在 OCaml 项目中使用 libsvm :

open Lacaml.D
open Libsvm

但是,当我尝试 运行 我的 makefile 时遇到了这个奇怪的错误:

ocamlfind: Error from package `threads': Missing -thread or -vmthread switch

我的 makefile 是:

ocamlfind ocamlopt -o prog -linkpkg -package lacaml -package libsvm Example1.ml

我确保所有包都存在(使用 depext):

# Installed packages for system:
base-bigarray             base  Bigarray library distributed with the OCaml compiler
base-bytes                base  Bytes library distributed with the OCaml compiler
base-ocamlbuild           base  OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads              base  Threads library distributed with the OCaml compiler
base-unix                 base  Unix library distributed with the OCaml compiler
[...]
lacaml                   8.1.1  OCaml-bindings to BLAS and LAPACK.
lbfgs                    0.8.8  Minimization of multidimensional functions on bounded or unbounded domains.
libsvm                   0.9.3  LIBSVM bindings for OCaml

您必须通过为其提供选项 -thread 或 -vmthread 来指示 ocamlfind select 线程库 - 请参阅 ocamlfind