                        Installing IMITATOR
                        ===================

Note: In case of problem, please read this INSTALL file carefully before reporting a bug.

The installation of IMITATOR II is very simple (see end of this file).
However, the installation of the other libraries (especially PPL), although not difficult, will take more time.


************************************************************
INSTALL OCAML
************************************************************
(the version used to develop PolyOp is 3.11.2)

	./configure -prefix /usr

	make world

	make bootstrap

	make opt

	make opt.opt

	sudo make install

OCaml should be installed in:
        binaries.................. /usr/bin        
        standard library.......... /usr/lib/ocaml  
        manual pages.............. /usr/man (with extension .1)



************************************************************
INSTALL Extlib
*************************************************************
Create directory, e.g., "toto".

ocaml install.ml
	-> both
	-> toto/
	-> 

Copy
	toto/*
to 
	/usr/lib/ocaml/extlib/

Add /usr/lib/ocaml/extlib/ to the path:
	export PATH=$PATH:/usr/lib/ocaml/extlib/


************************************************************
INSTALL g++
************************************************************
Using the package manager


************************************************************
INSTALL m4
************************************************************
Using the package manager


************************************************************
INSTALL GMP
************************************************************
(
	Message during the PPL installation
	*** MEMORY EXHAUSTION MAY RESULT IN ABRUPT TERMINATION.
	*** This is OK, if you do not plan to use the bounded memory capabilities
	*** offered by the PPL.  Otherwise, if you are using GCC or the Intel C/C++
	*** compiler, please make sure you use a version of GMP compiled with the
	*** `-fexceptions' compiler option.
	*** To build such a version, you can configure GMP as follows:
	*** CPPFLAGS=-fexceptions ./configure --enable-cxx --prefix=/usr

	« When compiling the GMP library, do not forget to enable the C++ interface:
	add --enable-cxx to the configuration options. »
)

	CPPFLAGS=-fexceptions ./configure --enable-cxx --prefix=/usr

	make
	make check		<= VERY IMPORTANT!!

	sudo make install

Libraries have been installed in:                                                 
	/usr/lib

(
	If you ever happen to want to link against installed libraries
	in a given directory, LIBDIR, you must either use libtool, and
	specify the full pathname of the library, or use the `-LLIBDIR'
	flag during linking and do at least one of the following:      
	   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable  
	     during execution                                          
	   - add LIBDIR to the `LD_RUN_PATH' environment variable      
	     during linking                                            
	   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag              
	   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

	See any operating system documentation about shared libraries for
	more information, such as the ld(1) and ld.so(8) manual pages.   
)


************************************************************
INSTALL MPFR
************************************************************
	./configure --prefix=/usr --with-gmp-lib=/usr/lib --with-gmp-include=/usr/include
	
     make

To check the built library (runs the test files), type:
     make check

To install it (default "/usr/local" | see "--prefix" option), type:
	sudo make install

Libraries have been installed in:                                                 
	/usr/lib

************************************************************
INSTALL MLGMP
************************************************************
http://www-verimag.imag.fr/~monniaux/programmes.html.en

Edit make file :
- GMP_INCLUDES= -I=/usr/include
- GMP_LIBDIR=/usr/lib


	make

*** LOOKS LIKE ONE NEEDS TO MODIFY THE SOURCE CODE ***

In mlgmp_fr.c :
- comment lines 363-374
- comment lines 388-399

In gmp.ml :
- comment line 488
- comment lines 492-493

In gmp.mli :
- comment lignes 340-342


	sudo make install

	(make clean)

installed in
	/usr/lib/ocaml/gmp



************************************************************
INSTALL PPL
************************************************************

	./configure --prefix=/usr --with-libgmp-prefix=/usr --with-libgmpxx-prefix=/usr --with-mlgmp=/usr/lib/ocaml/gmp

Adding option "--disable-shared" may allow static compiling (?)

	make

	make check (optional and very very long, several hours at least)
OR (to check linking with ocaml)
	cd interfaces
	make check

	sudo make install


************************************************************
(finally) INSTALL IMITATOR II
************************************************************
1. Extract the files from the archive to an installation directory,
   say <IMITATOR_install_dir>.

2. Open the Makefile and update:
	* EXTLIB_PATH : path to Ocaml ExtLib
	* OCAML_PPL_PATH : path to the PPL Ocaml interface files
	* OCAML_GMP_PATH : path to the GMP Ocaml interface files
	* CLIB_PATH : path to the required native C libs, including:
	  libpwl, libgmpxx, libgmp, libppl
If you followed the installation instruction in this file, the values should be all already defined correctly.

If you installed the required libraries in directories that are not
searched by default by the compiler and/or linking tools, then, like
with other libraries, you may need to set up some environment
variables such as C_INCLUDE_PATH (to find headers), LIBRARY_PATH (to
find libraries); this list is not exhaustive and some environment
variables may be specific to your system.

3. Type "make all".

IMITATOR II will be installed in the installation directory <IMITATOR_install_dir>/bin.
You may wish copy it to your default binary directory by typing, e.g.:
"sudo cp <IMITATOR_install_dir>/bin/IMITATOR /usr/bin/".


