Ocaml for the impatient adam bard and his magical blog. Ocaml was initially developed in the context of automated theorem proving, and has an outsize presence in static analysis and formal methods software. It occupies a delightful sweet spot between highlevel expressiveness and good performance. The supported build systems are 32bit and 64bit x86 linux. Ive heard that opam package manager doesnt work on windows, neither the core library and the utop interactive shell. Sous windows, les solutions suivantes sont disponibles pour installer ocaml. Until thats ready, we recommend using a virtual machine running debian linux on your local machine, or docker for windows. Sep 27, 2017 developing on windows with wsl2 subsystem for linux, vs code, docker, and the terminal duration. Further information and download links can be found on the release page. Anyone here knows how to install opam on windows not using wsl.
In this video, we start our ocaml video series by setting up ocaml and visual studio code for windows. Installation and configuration of ocaml for windows 10. Ocaml is a statically typed functional programming language. The easy way as of this post, when you come across these two instructions please use the following. Ocaml installation on windows native ocaml tutorial. Installation and configuration of ocaml for windows 10 umd. One of the greatest strengths of ocaml is its powerful static type system. Microsoft calls it the windows subsystem for linux wsl.
The installer has been tested on windows xp, windows 7, windows 8. We design, create and implement custom adhoc software for our clients in stateoftheart languages ocaml, rust. Or even better, provide a binary installer as for linux. Some additional features have been added to ocaml for better support of windows, such as autodetection of msvc and support for msvc 9. In this case, follow the instruction to install ocaml on ubuntu. It is the only windows port to include a debugger, the only one supported by godi, and the only one with full findlib support. Managing your ocaml installation can be as simple as. Instructions on how to install opam itself are available on the opam website. The ocaml toolchain includes an interactive toplevel interpreter, a bytecode compiler, an optimizing native code compiler, a reversible debugger, and a package manager opam. Installing ocaml for 3110 cornell computer science. Under windows, the following direct solutions are available to use ocaml. The official website for opam for ocaml is now hosted at opam.
However, the installer wont allow you to set custom options. Ocaml for windows opam repositorymingw provides an opam repository for windows and an experimental build of opam for windows. Opam is the package manager for the ocaml programming language, the language in which coq is implemented. Note that windows is not currently supported by the examples in real world ocaml or by opam, although it is being worked on. Heres a very detail description and instruction ocaml on windows. It is selfcontained and runs natively on windows, which means you can generate ocaml applications with it without installing cygwin or windows sdk. Or, perhaps, overdocumented since ocaml attracts people who are interested in rigorous correctness, what documentation exists tends to be rigorous and correct, and also tedious. Ocaml is great and amazing programming language, however i would like to know if it is viable the development of ocaml apps in windows. An indepth look at ocamls new bestfit garbage collector. Some additional features have been added to ocaml for better support. Aug 27, 2007 the cygwin port is the closest to the unix environment in which ocaml is most at home. In order to install ocaml and its package manager opam. But be aware that opam and vs code wont be configured for that user.
Alternatively, specify the path to the c toolchain explicitly. Most of the work is packaging, most of opams unix specific stuff will just work out of the box. Now, open the cygwin terminal from the shortcut in your windows desktop and do the followings. How do i upgrade the system compiler of opam after installing a new version of ocaml. Now youll have to add ocaml installation path in windows path, to make it available anywhere. It contains both ocaml compilers and opam packet manager. The instructions to do that initialization can be found below under opam configuration and vs code configuration. Have you run the sanity checks from the instructions on the wiki.
On linux or osx, we recommend you use the opam package manager. This repository contains an uptodate windows toolchain featuring ocaml 4. Ocaml package manager opam is a sourcebased package manager for ocaml. I am using windows specifically wsl so i follow the ubuntu instructions. Jan 30, 2017 aptget install time libffidev opam instrall core ctypes ctypesforeign dolog bitstring. Opam has been designed in the first place for ocaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a gitfriendly development workflow. Opam 2 is the recommended version, and is assumed below. Ocaml for windows opamrepositorymingw provides an opam repository for windows and an experimental build of opam for windows. Use bash on windows and install ocaml as on ubuntu. There is a ppa available that contains the current stable version of opam. Supporting cygwin and mingw type toolchains is a dead end. Most of the work is packaging, most of opam s unix specific stuff will just work out of the box. The license allows you to distribute applications compiled with ocpwin for commercial purpose, as long as you do not distribute the ocaml compiler itself.
Opam should automatically detect that a new version of ocaml has been installed on your system and it will propose you to update. Developing on windows with wsl2 subsystem for linux, vs code, docker, and the terminal duration. Ocpwin is a selfcontained binary distribution of ocaml for windows. Ocaml and opam are installed and configured but they are not ready to use. If something went wrong, you can use opam switch reinstall system to recompile you system compiler switch with the new compiler. Now check your compiler version by running opam switch show. The installer will first create a customized cygwin environment and then set up opam and ocaml inside this environment. If you already have ocaml and an existing project you can skip this step. Start a terminal by choosing the 2nd icon down from the top in the launcher on the lefthand side of the desktop. Ocaml is not very compatible for installation on a windows computer but is made simple with bash on ubuntu on windows, a brand new windows 10 feature that enables direct use of linux commandline tools. First step is to install the ocaml compiler itself. I was able to run ocaml and opam in windows 10 using windows subsystem for linux wsl without any problem. Cygwin is used as a development environment, because it packages mingw needed for ocamlopt to work properly, as needed for ocamlopt and other unix tools required by ocamlbuild and others. If you need support for other platforms or versions, please open an issue.
Generally, you should just reproduce the same installation steps as for the original installation. Ocaml for windows provides an experimental opam repository and opam build for windows. To do this, youll need to search for environnement variables settings, and go into environnement variables tab. Aug 28, 2017 ocaml is a rad language with some regrettably underdocumented parts.