问题标签 [ocamlfind]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
333 浏览

ocaml - 使用 ocamlfind 的 OCaml 编译错误

这是代码:

这里是_tags

这是编译命令:

这是编译错误:

但是,当我使用这个时:

然后代码就可以编译成功了...

0 投票
1 回答
169 浏览

ocaml - 为什么有些标准的 ocaml 库是 opam 包而有些不是?

base-unix在 OCaml opam 存储库中看到了这个包。它被描述为“随 OCaml 编译器分发的 Unix 库”。也与 OCaml 编译器一起分发的其他一些库没有自己的包。例如,图书馆没有base-str包这样的东西。str

为什么会有这样的差异?据我所知,在使用 or 编译时,它们都需要在命令行上指定为包或ocamlfindocamlbuild

0 投票
2 回答
1681 浏览

ocaml - 安装核心库

我是ocaml的新手。我正在尝试使用 OPAM 1.1.1 安装 core 和 utop 但是我得到以下信息:

会不会是 OPAM 安装不正确?请问有什么建议可以解决这个问题吗?

0 投票
1 回答
629 浏览

ocaml - 使用 ocamlbuild 构建库,使用 ocamlfind 安装它 - 最佳实践是什么?

我正在通过一个列出包含该库的模块的文件ocamlbuild来编译 OCaml库。mylib.mllib之后我想使用ocamlfind. 与使用 构建的二进制文件不同ocamlbuild,所有库文件都在_build目录中。是使用类似的东西安装它们的正确方法

ocamlbuild还是和之间有更好的整合ocamlfind?特别是,我注意到-install-lib-dirflagocamlbuild但找不到有关其用途的文档。

我知道oasis但现在想在 Makefile 和install目标中解决问题。所有这些都是在使用opam库管理器的上下文中,但讨论起来应该无关紧要。

0 投票
1 回答
1071 浏览

macos - OCamlfind 构建失败

当我尝试使用安装时ocamlfindopam install ocamlfind编译失败并给出以下消息:

根据过去的 Stack Overflow 答案,如果未安装 m4,此安装有时会失败,但我已安装 m4 并且在我的路径中,所以这不是问题。

0 投票
1 回答
44 浏览

ocaml - 不同make文件的程序行为差异

我有这个 OCaml 程序

然后是两个make文件,第一个是

这会产生一个 a.out ,它给出了预期的输出false true。第二个是

这会在我的机器上产生一个折叠,挂起而没有输出。两者之间的唯一区别是其中一个将其输出放在折叠中,另一个将其放在 a.out 中。我的 ocaml、ocamlc、ocamlopt 和 ocamlfind 的版本号都是 4.02.1,并opam show core说它的版本是 112.06.01。有大佬知道是什么原因造成的不一样吗?

0 投票
3 回答
359 浏览

vim - 在 vim 中使用 merlin 在 ocaml 中进行 coq 插件开发

我用 opam 安装了 Coq,并想制作一个 Coq 插件。我设法使用 编译了一些插件示例coq_makefile,但如果我可以在 vim 中使用 merlin 来获取 Coq 库的类型信息和补全,那就太好了。

有没有办法可以将 Coq 库添加到 ocamlfind?

0 投票
1 回答
230 浏览

ocaml - different results for commands "sudo ocamlfind list" and "ocamlfind list"

I have an issue here, that really drives me nuts. I never worked with OCaml, do not know anything about it or how it works.

The problem: i need to install camlidl library. I did it through opam (opam install camlidl).

As i said before, i have no idea about OCaml. ocamlfind list, did not show a package list . Searched the net - found out that running eval $'opam config eval' helps.

strangely (i do not know why) ocamlfind was able to see the package after this command execution, BUT(!) if i run sudo ocamlfind list it will show the list without this package.

Can anyone help me understand why is this happening and how to fix this? I need to compile something that requires camlidl, and it has to be done under sudo.

Thank You in advance!

Execution of ocamlfind list

Execution of sudo ocamlfind list

Execution of opam

Execution for sudo -i opam list

0 投票
3 回答
582 浏览

ocaml - oasis 选择了错误的 ocamlbuild

我尝试使用 Opam 提供的 Ocaml 版本编译 Ocaml 项目。我的 ocamlbuild、ocamlfind 和 oasis 似乎还可以:

但是当我尝试编译时,似乎调用了错误的ocamlbuild版本,甚至ocamlfind的版本是正确的,我认为它解释了为什么ocamlfind找不到sexplib库。

我试图告诉 oasis 使用哪个版本的 ocambuild 没有成功,有人知道怎么做吗?谢谢

0 投票
1 回答
604 浏览

ocaml - 在utop中用camlp5替换camlp4

我正在使用需要camlp5的 OCaml 代码;但是,顶层(我使用的是utop)会自动加载更新的、不兼容的camlp4。这些是启动消息:

即时通讯使用.ocamlinit看起来像这样:

我安装camlp5opam它,它在我发出时出现ocamlfind list;该文件camlp5.cma也位于/home/<username>/.opam/4.02.1/lib/camlp5/camlp5.cma. 但是尝试加载camlp5ocamlp5r失败Unknown directive camlp5o

我如何utop知道camlp5以及如何替换camlp4camlp5默认预处理器?

提前谢谢了!