Skip to content
This repository has been archived by the owner on Oct 6, 2019. It is now read-only.

Latest commit

 

History

History
79 lines (54 loc) · 2.83 KB

oqaml_setup.md

File metadata and controls

79 lines (54 loc) · 2.83 KB

Setting up your OCaml environment

This guide is intended to give you a general idea of how to get started with OCaml. An easy way to handle OCaml packages is Opam. Installation on MacOS and Linux distributions has many steps but is straight forward. If you have a working OCaml Environment you can skip to the OQaml setup section.

Setting up the OCaml environment

  1. Install OCaml package manager:

    • Ubuntu
    apt-get install opam
    • MacOS
    brew install opam
  2. Initialize the package manager

    opam init
  3. To interact with OQaml you will need to set up OCaml version 4.04.2. You can do this with opam as follows

    opam switch 4.04.2
  4. Repeat steps 3 to ensure your environment is set up with the right version dependencies (Don't forget to check your .bashrc)

    opam config env

There will be several ENV variables displayed. Make sure to put them into your .bashrc and source it. Run ocaml --version and confirm that is displays The OCaml toplevel, version 4.04.2. You are now all set up in the right OCaml environment. To get install OQaml we need to install some more dependencies and OCaml packages.

  1. Setting up jbuilder; an OCaml build system manager:

    opam install jbuilder

    Depending on your distribution of Linux or MacOS there might be OS dependencies missing. Opam is giving you good guidelines to check for those dependencies and help you install missing ones. E.g. for a missing conf-m4.1 dependency opam suggests to run

    opam depext conf-m4.1

    which searches and helps installing missing the OS libraries.

  2. Install utop to install a powerful OCaml REPL

    opam install utop

Installing OQaml

  1. Installing Core_extended

    opam install core_extended
  2. The current version of OQaml depends on the development version of Owl, which needs to be installed by hand. More detailed install instructions are found in its README, but here is a short list:

    1. git clone git@github.com:ryanrhymes/owl.git
    2. cd owl
    3. ensure openblas and lapacke are installed on your OS.
    4. opam install ctypes dolog eigen gsl oasis plplot atdgen. In this process there might be more OS dependencies you have to install. Simply let opam help you to figure out which OS libraries are missing with a couple of opam depext <X>.
    5. make all
    6. make install
  3. You are now ready to install OQaml. To this end move into the OQaml directory and run

    make all && make install