XenAPI client libraries for ocaml

From Xen
Revision as of 13:08, 28 September 2012 by Dave.scott (talk | contribs) (Created page with "This page describes how to install the XenAPI client libraries for ocaml, and how to use them with tab-completion in a toplevel REPL. This is currently a draft. == Before you s…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page describes how to install the XenAPI client libraries for ocaml, and how to use them with tab-completion in a toplevel REPL.

This is currently a draft.

Before you start

Use your distro's package manager to install an ocaml version >= 3.12.1

sudo apt-get install ocaml

Install the ocaml package manager "opam"

The version of the package manager and the package repositories in the xen-org fork on github are the most recent versions that have passed the xen-specific build tests.

git clone git://github.com/xen-org/opam
(cd opam; ./configure && make && sudo make install)

Initialise from the standard set of base packages

opam init git://github.com/xen-org/opam-repository


Add the xen-specific package repository

opam remote add xen git://github.com/xen-org/opam-repo-dev

Switch to a clean setup of the 3.12.1 compiler

opam switch 3.12.1

Run the following command in your terminal and add this to your .profile to make sure your ocaml environment variables are setup:

eval `opam config -env`

Install packages

opam --yes install xen-api-client utop

Try the XenAPI

Run "utop" in a terminal -- this should give you an ocaml toplevel with tab-completion. Type the following: (try hitting "tab" a lot)

#require "xen-api-client.lwt";;