Installing OCaml for 3110

You need to have a working installation of OPAM, the OCaml Package Manager, version 1.2.2. You have a choice: you can install OPAM natively on your own operating system, or you can download a Unix virtual machine (VM) that we provide in which OPAM is already installed.

Regardless of which you choose, once you get an installation working keep it working throughout the semester by being cautious about any updates you apply to your system. Don't perform any major OS upgrades just before an assignment is due, for example.

VM installation

WARNING: Do not use a VM from an old edition of CS 3110. Only the Spring 2018 VM will be supported this semester.

Native installation: OS/X

If you previously installed one of them and later upgraded your OS X version be especially careful: these package managers don't survive such upgrades easily. Make sure your package manager is in working order and fully up-to-date before proceeding. With MacPorts, that means running sudo port selfupdate followed by sudo port upgrade outdated. If there are any errors, you need to resolve them before proceeding. Often the easiest way to do that is to uninstall the package manager then reinstall it from scratch.

Native installation: Linux

Semi-native installation: Windows

Dual-boot installation: Windows and Linux

If your hardware is not powerful enough to run the VM inside Windows without significant lag, you could consider dual-booting Windows and Linux. (We recommend Ubuntu 16.04, because that's what the VM is based on, but you could choose another Linux distribution.) There are many guides you could find online for how to do that, but this is getting into territory that we are unable to support. You should certainly make a backup of your entire Windows system before attempting to get dual-booting working, just in case something goes wrong. If you do get it working, you can follow the instructions above for a native installation on Linux.

OPAM configuration

You do not need to follow these instructions if you are using the VM. We have already done them for you.

Atom configuration

You do not need to follow these instructions if you are using the VM. We have already done them for you.

The Atom editor offers excellent integration with OCaml, including syntax highlighting, auto-completion, and auto-indentation. After installing OPAM (including the packages above, particularly merlin and ocp-indent), and after installing Atom, you'll need to install some packages inside Atom itself.

Need help?

The course staff is happy to help you out with any trouble you might have. It is far easier to diagnose problems in person, so we ask that you come to office hours rather than post on Piazza.