XenAPI client libraries for ocaml: Difference between revisions

From Xen
Jump to navigationJump to search
(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…")
 
Line 28: Line 28:
== Add the xen-specific package repository ==
== Add the xen-specific package repository ==
<nowiki>
<nowiki>
opam remote add xen git://github.com/xen-org/opam-repo-dev
opam remote -add xen-org git://github.com/xen-org/opam-repo-dev
</nowiki>
</nowiki>



Revision as of 13:16, 30 October 2012

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-org 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";;