首页 > 解决方案 > Ocaml Manual installation vs Graphical installation

问题描述

i'm a CS student and was recently told to install Ocaml and I used the graphical installer to do so (as opposed to the manual method my professor advised me of) - he said that when coming to test the coursework it is marked by gitlab and that doing things differently may cause the test to not run properly. As far as I can tell ocaml is working as it should be.

Is there an issue with installing Ocaml using the graphical installer rather then manually? Thank you!

https://fdopen.github.io/opam-repository-mingw/installation/

标签: installationocaml

解决方案


正如您所指的网页中所说,“安装程序不允许您设置自定义选项:代理配置,选择要安装的初始 OCaml 版本等。” 此外,由于它创建了一个全新的 Cygwin 环境,您将无法将 OCaml 添加到您之前拥有的 Cygwin 环境中。

如果您以前没有使用 Cygwin,并且您可以使用图形安装程序附带的默认选项,尤其是 OCaml 版本,那么您最好使用这个安装程序。如果你想要一个特定版本的 OCaml,或者你想在现有的 Cygwin 环境中安装它,你应该使用手动方法。


也就是说,如果你使用的是 Windows 10,而不是 Cygwin,你最好在WSL中安装 OCaml 和朋友,这是嵌入在 Windows 中的 Linux 子系统。如果您尚未使用 WSL,则必须先启用并安装它。然后,只需按照在 Linux Ubuntu 上安装东西的过程即可。

Cygwin 和 WSL 有什么区别?

  • Cygwin 尽其所能在 Windows 上模拟 POSIX API,并要求针对其自己的 DLL 专门编译程序(有时,它们的源代码需要稍微修补)。

  • 相比之下,WSL 提供了一个真正的 Linux 内核,可以运行本机 Linux 程序。您可以访问完整的 Linux 世界,包括 Ubuntu 软件包存储库。这更简单,更不容易出现问题。

如果我想要直接的 Windows 支持,而不需要嵌套类 Unix 环境怎么办?

OCaml 对 Windows 的支持有些不稳定。OCaml 官方发行版可以从源代码构建以获取本机 Windows 程序,但不授予 OCaml 生态系统中的任何其他工具或库对 Windows 的支持。大多数社区都在使用类 Unix 环境。


推荐阅读