Numerix: Big integer library for Caml-Ocaml
-------------------------------------------

                                         M. Quercia, August 25, 2001

1. Compilation
--------------

First run the [configure] script:

with the bash shell

  ./configure 2>&1 | tee conflog

with the csh shell

  ./configure |& tee conflog

This  script checks which  parts of  Numerix can  be compiled  on your
computer and creates a [Makefile] file and a [numconf] file suited for
your   configuration.     See   below   for    options   accepted   by
[configure]. Then do :

with the bash shell

  make lib 2>&1 | tee liblog
  make examples 2>&1 | tee exlog

with the csh shell

  make lib |& tee liblog
  make examples |& tee exlog

This compiles the libraries for C, Camllight and Ocaml or only some of
them depending  on the  choosen options as  well as  the corresponding
examples. There should be neither warning nor error, if there are some
then check  the settings in the  [numconf] file and let  me know.  For
information, the [numconf] files and the results of the compilation on
my computer (Pentium  with Linux) and on the  one at pauillac (Digital
alpha with  Sun-OS) can  be found in  the logs/pentium  and logs/alpha
directories. After modifying the [numconf] file you need to recreate a
suitable [Makefile] file. Just do:

  make -f numconf makerules

To check that the examples work do:

  make test 2>&1 | tee testlog

or
  make test |& tee testlog

and compare with  the logs/pentium/testlog or logs/alpha/testlog file.
The numerical results should be identical.

If everything works then you can install the libraries with:

  make install

This copies in $(INSTALL_LIB) the libraries, in $(INSTALL_INCLUDE) the
header files  and in $(INSTALL_BIN)  the binaries.  If you  change the
value  of $(INSTALL_LIB)  then  you have  to  recompile the  toplevels
lib/ocaml/ocamlnumx and  lib/camllight/camlnumx before installation as
the value of $(INSTALL_DIR) is hardcoded into those programs. Just do:

  rm lib/ocaml/ocamlnumx
  make lib/ocaml/ocamlnumx

and the analogue for camlnumx.

2. Use
------

A  complete   documentation  in  English  is  available   in  the  doc
subdirectory, file numerix-eng.ps.


3. Configure options
-------------------

The [configure] script accepts the following options:

--prefix=<dir>

Set the common root for installation directories:
INSTALL_LIB     = <dir>/lib,
INSTALL_BIN     = <dir>/bin,
INSTALL_INCLUDE = <dir>/include.
The default prefix is $HOME.

--libdir=<dir>, --bindir=<dir>, --includedir=<dir>

Set  one  of INSTALL_LIB,  INSTALL_BIN  and INSTALL_INCLUDE  directory
regardless of the others.

--enable-c, --disable-c

Select or unselect the C interface. The default is to select it.

--enable-caml, --disable-caml

Select or unselect  the Camllight interface. The default  is to select
it if Camllight was found in  the computer.  If you have Camllight and
[configure] cannot  find it then  edit the [numconf]  file and fill-in
the variables that  [configure]  could  not  determine  (CAML_VERSION,
CAML_LIBDIR, CAML, CAMLLIBR and CAMLMKTOP).

--enable-ocaml, --disable-ocaml

Select or unselect the Ocaml interface. The default is to select it if
Ocaml was  found in the computer.   If you have  Ocaml and [configure]
cannot find it then edit the [numconf] file  and fill-in the variables
that  [configure] could  not  determine (OCAML_VERSION,  OCAML_LIBDIR,
OCAML, OCAMLOPT and OCAMLMKTOP).

--enable-pascal, --disable-pascal

Select or unselect  the Pascal interface. The default  is to select it
if ppc386 was found in the computer.  If you want the Pascal interface
then you need the C one too.

--enable-clong, --disable-clong

Select or unselect the Clong module. The default is to select it.

--enable-dlong,- -disable-dlong

Select or  unselect the Dlong module.  The default is to  select it if
the C  compiler supports the  double precision integer  datatype (long
long) and if  this datatype length is twice the length  of a long. You
can force  the selection of the  Dlong module despite  a negative test
with [configure], but  in such a case the  compiled module will likely
be useless.

--enable-slong, --disable-slong

Select or  unselect the Slong module.  The default is to  select it if
the processor  is an  Intel x86  one and if  the C  compiler correctly
supports  the double precision  integer datatype.   You can  force the
selection  of   the  Slong  module   despite  a  negative   test  with
[configure], but  in such  a case the  compiled module will  likely be
useless.

--enable-gmp, --disable-gmp

Select or unselect the Gmp module.  The default is to select it if the
gmp library was found in the computer.  You can force the selection of
this module  if gmp is actually  present despite a  negative test with
[configure]. In such a case, add the necessary directives -Ixxx, -Lxxx
-ccopt xxx to the GCC, CAML, CAMLMKTOP, OCAML, OCAMLOPT and OCAMLMKTOP
variables in the [numconf] file created by [configure].

--enable-caml_bignum, --disable-caml_bignum
--enable-ocaml_bignum, --disable-ocaml_bignum

Select or unselect the Big  module independently for Camllight and for
Ocaml.  The default  is  to  select it  if  the corresponding  libnums
library was found in the computer. You can force the selection of this
module despite a  negative test with [configure]. In  such a case, add
the necessary  directives to the CAML, CAMLMKTOP,  OCAML, OCAMLOPT and
OCAMLMKTOP variables in the [numconf] file created by [configure].

--disable-lang

Unselect   all  the   languages  not   explicitely  selected   with  a
--enable-xxx option.

--DISABLE-modules

Unselect all the modules  not explicitely selected with a --enable-xxx
option.

--disable-all

Unselect all the module/language combinations not explicitely selected
with a --enable-xxx option.


                                M. Quercia (michel.quercia@prepas.org)
