
==== Dependencies ====

Dose3 needs ocaml >= 3.11.2
On debian, dose3 **does not compile** on debian lenny.

required libraries ( DEBIAN / RPM ) :
 - libextlib-ocaml-dev / ocaml-extlib-devel
 - libre-ocaml-dev / ??
 - cppo ( needed for conditional compilation )

additional libraries (enable compilation with --with-<library>) :
 - libzip-ocaml-dev / ?
 - libbz2-ocaml-dev / ?
 - libocamlgraph-ocaml-dev / ?
 - libounit-ocaml-dev / ocaml-ounit-devel
 - librpm-dev / librpm-devel
 - libexpat-ocaml-dev (for --with-xml)
 - libbenchmark-ocaml-dev (for --with-benchmark)

To use rpm support, dose3 needs librpm > 4.6
To use ocamlgraph support, dose3 needs libocamlgraph-ocaml-dev >= 1.8.5

opam users need the following packages to compile dose with the default
options :

- opam install cppo extlib camlbz2 camlzip ocamlgraph extlib ounit re cudf

OR 

- opam install cppo extlib re cudf

to compile the core dose library.

To compile from git :
aclocal -I m4
autoconf
./configure
make

--with-rpm4
--with-rpm5
--with-xml
--with-ocamlgraph
--with-parmap
--with-zip
--with-bz2
--with-oUnit
--with-curl
--with-experimental (not working at the moment?)

libcudf is included in the source tree of dose3 available by git but
not in the dose3 release tarball. By default dose3 uses the system
wide version of libcudf. To use the version of libcudf in the source
tree you can specify --without-libcudf as configure option. If using
an independently installed version of libcudf you'll need version >=
0.7.


Example:
./configure --with-ocamlgraph --with-zip --with-bz2 

Compiling applications
----------------------
In order to compile the a selection of applications do "make". To
compile specific application

$ocamlbuild -use-ocamlfind applications/$app.native
$ocamlbuild -use-ocamlfind experimental/$app.native

Some application might benefit from a fine-tune of the ocaml garbage collector.
You migth try to set the following values before running your application:
OCAMLRUNPARAM=s=4M,i=32M,o=150

Compiling experimental applications
-----------------------------------
From the dose top level directory, for instance to compile outdated.ml:

$ocamlbuild -use-ocamlfind experimental/outdated.native

Building the documentation
--------------------------
"make doc" builds the documentation. For this it is necessary to have
configured with option --with-ocamlgraph. You also need to have
installed "graphviz".

Install
-------

./configure --prefix=/path/to/ 
make
make install

by default dose is installed in /usr/local/{lib,bin} 


Ocaml interpreter
----------------------------------

$ocaml
        Objective Caml version 3.12.1

Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

/usr/lib/ocaml/extlib: added to search path
/usr/lib/ocaml/extlib/extLib.cma: loaded
# #require "dose3";;
/usr/lib/ocaml/str.cma: loaded
/usr/lib/ocaml/pcre: added to search path
/usr/lib/ocaml/pcre/pcre.cma: loaded
/usr/local/lib/ocaml/3.12.1/cudf: added to search path
/usr/local/lib/ocaml/3.12.1/cudf/cudf.cma: loaded
/usr/lib/ocaml/ocamlgraph: added to search path
/usr/lib/ocaml/ocamlgraph/graph.cma: loaded
/usr/lib/ocaml/unix.cma: loaded
/usr/lib/ocaml/zip: added to search path
/usr/lib/ocaml/zip/zip.cma: loaded
/usr/lib/ocaml/bz2: added to search path
/usr/lib/ocaml/bz2/bz2.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3: added to search path
/usr/local/lib/ocaml/3.12.1/dose3/common.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/algo.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/debian.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/eclipse.cma: loaded
# #require "dose3.boilerplate";;
/usr/local/lib/ocaml/3.12.1/dose3/rpm.cma: loaded
/usr/local/lib/ocaml/3.12.1/dose3/boilerplate.cma: loaded
#


How to create a tarball for distribution
----------------------------------------
edit configure.ac: put new version number in macro AC_INIT
aclocal -I m4
autoconf
make
make dist

How to run the tests
--------------------
The test script of the applications needs:
python
python-yaml

./configure --without-libcudf --with-ocamlgraph --with-zip --with-oUnit --with-bz2 --with-rpm4
make
make test
make testlib

To run only the unit tests : make testlib


