Software
Setup

OCaml

We will use opam, OCaml's package manager, to install OCaml as well as various libraries and tools.

These guides from ocaml.org provide tutorial walk throughs for installing OCaml:

Here is what we have found to work this quarter:


  1. Install opam

Windows

Linux, MacOS, and Windows Subsystem for Linux (WSL) [WSL install instructions]

  • Follow the instructions on opam's official installation page.
    Note: For MacOS, you need to have xcode command line developer tools installed, you can install them using:
    $ xcode-select --install

For WSL, you need to disable sandboxing:

$ opam init --disable-sandboxing --reinit


  1. Use opam to install dune, utop, etc.

Once opam is installed, install dune and utop by running:

$ opam install dune utop

If you use VS Code (see more below), you will also want ocaml-lsp-server:

$ opam install ocaml-lsp-server

Learn more about managing your opam installation from the opam usage guide.


Alternatively, instead of installing everything on your system, you can choose to use attu (remote CSE Linux cluster, available to CSE students only), which has an OCaml installation. From a terminal, run ssh <CSENetID>@attu.cs.washington.edu and use your CSE login as the password. VS Code also has SSH support (instructions below). However, the OCaml version installed by default on attu is outdated, which will be an issue on some assignments. Follow these instructions to install an up-to-date version of OCaml in your attu home directory.

Visual Studio Code

Install VS Code

The VS Code website provides installers for Windows, Linux, and MacOS.

Note: if you installed OCaml via WSL on Windows, follow the instructions here to develop in WSL using VS Code. This will let you edit files in WSL using VS Code and use the terminal in WSL to use your OCaml installation.

Install Extensions

VS Code provides many extensions to better support developing programs in various languages.

First read the instructions on how to install an extension.

Then install the OCaml Platform extension by OCaml Labs.

If you chose to use attu, install the Remote-SSH extension to develop on attu within VS Code.


UW CSE VM

The UW CSE Virtual Machine is a CentOS Linux set up to approximate the set up on Allen School lab computers.

Roughly speaking, it will let you run a fresh, full-fledged Linux machine as if it was just another application.

If you are struggling to set up software on your personal computer, you may have better luck by: