| 1 |
Installation Notes for CDuce
|
| 2 |
============================
|
| 3 |
|
| 4 |
CDuce is written in the OCaml programming language. It has been
|
| 5 |
successfully compiled under Intel Linux, SunOS 5.7, Windows XP
|
| 6 |
and FreeBSD 4.7.
|
| 7 |
|
| 8 |
(See INSTALL.WIN32 for installation under Windows)
|
| 9 |
|
| 10 |
------------------------------------------------------------------------------
|
| 11 |
Prerequisites
|
| 12 |
------------------------------------------------------------------------------
|
| 13 |
|
| 14 |
Before compiling CDuce, you need to install recent releases of the
|
| 15 |
following packages:
|
| 16 |
|
| 17 |
ocaml
|
| 18 |
http://caml.inria.fr/ocaml/distrib.html
|
| 19 |
findlib
|
| 20 |
http://www.ocaml-programming.de/packages
|
| 21 |
wlex
|
| 22 |
http://www.eleves.ens.fr/home/frisch/soft.html#wlex
|
| 23 |
pcre-ocaml
|
| 24 |
http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
|
| 25 |
ocamlnet
|
| 26 |
http://sourceforge.net/projects/ocamlnet
|
| 27 |
pxp
|
| 28 |
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
|
| 29 |
|
| 30 |
|
| 31 |
Important notes:
|
| 32 |
|
| 33 |
- the packages above must be installed in the order we used above. In
|
| 34 |
particular wlex _must_ be installed before pcre-ocaml and pxp.
|
| 35 |
|
| 36 |
- wlex: you only need to build and install the runtime support library
|
| 37 |
(not the wlex tool itself):
|
| 38 |
|
| 39 |
make runtime.all & make install_runtime
|
| 40 |
|
| 41 |
- pcre-ocaml: you may also need to install the PCRE library
|
| 42 |
from http://www.pcre.org/
|
| 43 |
|
| 44 |
./configure --prefix=<prefix directory> --disable-shared
|
| 45 |
|
| 46 |
If pcre was installed in non standard place then in Makefile.conf:
|
| 47 |
export STATIC = yes #this may help but first try without
|
| 48 |
export INCDIRS := <prefix_directory>/include
|
| 49 |
export LIBDIRS := <prefix_directory>/lib
|
| 50 |
|
| 51 |
After make all && make opt:
|
| 52 |
cd lib
|
| 53 |
cp ../META .
|
| 54 |
ocamlfind install pcre META *.a *.cma *.cmxa *.cmi *.mli
|
| 55 |
|
| 56 |
- PXP:
|
| 57 |
CDuce requires a development version >= 1.1.93.
|
| 58 |
|
| 59 |
Note:
|
| 60 |
It is enough to build support UTF8 and ISO-8859-1 ocamllex-lexers:
|
| 61 |
./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591
|
| 62 |
|
| 63 |
Efficiency issues:
|
| 64 |
|
| 65 |
- OCamlnet: if you plan to load XML file with encodings other than
|
| 66 |
UTF-8, it is advised to use the CVS version of OCamlnet:
|
| 67 |
http://sourceforge.net/cvs/?group_id=19774
|
| 68 |
Indeed, the netconversion module in the latest release (0.95) was
|
| 69 |
very slow, and it has been rewritten since then.
|
| 70 |
|
| 71 |
------------------------------------------------------------------------------
|
| 72 |
Compilation
|
| 73 |
------------------------------------------------------------------------------
|
| 74 |
|
| 75 |
You need a GNU Make (or equivalent) to use the Makefile from the
|
| 76 |
distribution. It defines the following goals:
|
| 77 |
|
| 78 |
- make cduce
|
| 79 |
compiles the CDuce command line interpreter
|
| 80 |
|
| 81 |
- make dtd2cduce
|
| 82 |
compiles the dtd2cduce tools (converts DTD to CDuce types)
|
| 83 |
|
| 84 |
- make webiface
|
| 85 |
compiles the CDuce web interface interpreter (to be used as a CGI script)
|
| 86 |
|
| 87 |
- make local_website
|
| 88 |
compiles in the web/www/ subdirectory the HTML files for the CDuce website
|
| 89 |
(including the tutorial and manual)
|
| 90 |
|
| 91 |
- make all
|
| 92 |
equivalent to (make cduce; make dtd2cduce; make local_website)
|
| 93 |
|
| 94 |
|
| 95 |
Makefile accepts the following options, which can take the values
|
| 96 |
true or false.
|
| 97 |
|
| 98 |
NATIVE=true : use the OCaml native code compiler (ocamlopt) to build CDuce
|
| 99 |
NATIVE=false : use the OCaml bytecode compiler (ocamlc)
|
| 100 |
default: true (the native code version is much faster)
|
| 101 |
|
| 102 |
PXP_WLEX=true : use wlex for parsing UTF-8 XML files
|
| 103 |
PXP_WLEX=false: use ocamllex for parsing UTF-8 XML files
|
| 104 |
default: false (ocamllex is faster; wlex is more compact)
|
| 105 |
|
| 106 |
E.g.:
|
| 107 |
make cduce NATIVE=false
|
| 108 |
|
| 109 |
You can also modify Makefile.conf to set values for these choices.
|
| 110 |
|
| 111 |
------------------------------------------------------------------------------
|
| 112 |
Support for the expat parser
|
| 113 |
------------------------------------------------------------------------------
|
| 114 |
|
| 115 |
This release includes an experimental support for the expat XML
|
| 116 |
parser, using the OCaml wrapper written by Maas-Maarten Zeeman, and
|
| 117 |
included in the expat/ subdirectory for convenience (see
|
| 118 |
expat/README).
|
| 119 |
|
| 120 |
If you have the expat C library installed, you can build
|
| 121 |
the OCaml wrapper:
|
| 122 |
|
| 123 |
cd expact
|
| 124 |
make all (* may need to modify Makefile.conf *)
|
| 125 |
make install (* may require root privileges *)
|
| 126 |
cd ..
|
| 127 |
|
| 128 |
Then set EXPAT=true in Makefile.conf, and rebuild CDuce (make clean;
|
| 129 |
make all).
|
| 130 |
|
| 131 |
The interpreter is now using expat for loading XML files.
|
| 132 |
You can still use PXP by providing the --pxp switch on the command
|
| 133 |
line.
|
| 134 |
|
| 135 |
Note: the current wrapper for expat does not support inclusion
|
| 136 |
of external entities. Moreover I encounter random segfaults...
|