XenAPI client libraries for ocaml: Difference between revisions
Lars.kurth (talk | contribs) |
|||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
== Install the ocaml package manager "opam" == |
== Install the ocaml package manager "opam" == |
||
The version of the package manager and the package repositories in the |
The version of the package manager and the package repositories in the xapi-project fork on github are the most recent versions that have passed the xen-specific build tests. |
||
<nowiki> |
<nowiki> |
||
git clone git://github.com/ |
git clone git://github.com/xapi-project/opam |
||
(cd opam; ./configure && make && sudo make install) |
(cd opam; ./configure && make && sudo make install) |
||
</nowiki> |
</nowiki> |
||
Line 22: | Line 22: | ||
<nowiki> |
<nowiki> |
||
opam init git://github.com/ |
opam init git://github.com/xapi-project/opam-repository |
||
</nowiki> |
</nowiki> |
||
Line 28: | Line 28: | ||
== Add the xen-specific package repository == |
== Add the xen-specific package repository == |
||
<nowiki> |
<nowiki> |
||
opam remote -add |
opam remote -add xapi-project git://github.com/xapi-project/opam-repo-dev |
||
</nowiki> |
</nowiki> |
||
Latest revision as of 15:00, 20 June 2013
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 xapi-project fork on github are the most recent versions that have passed the xen-specific build tests.
git clone git://github.com/xapi-project/opam (cd opam; ./configure && make && sudo make install)
Initialise from the standard set of base packages
opam init git://github.com/xapi-project/opam-repository
Add the xen-specific package repository
opam remote -add xapi-project git://github.com/xapi-project/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";;