| 1 |
abate |
370 |
Installation Notes for CDuce |
| 2 |
|
|
============================ |
| 3 |
abate |
104 |
|
| 4 |
abate |
370 |
CDuce is written in the OCaml programming language. It has been |
| 5 |
abate |
406 |
successfully compiled under Intel Linux, SunOS 5.7, Windows XP |
| 6 |
abate |
404 |
and FreeBSD 4.7. |
| 7 |
abate |
104 |
|
| 8 |
abate |
406 |
(See INSTALL.WIN32 for installation under Windows) |
| 9 |
|
|
|
| 10 |
abate |
370 |
------------------------------------------------------------------------------ |
| 11 |
|
|
Prerequisites |
| 12 |
|
|
------------------------------------------------------------------------------ |
| 13 |
abate |
104 |
|
| 14 |
abate |
370 |
Before compiling CDuce, you need to install recent releases of the |
| 15 |
|
|
following packages: |
| 16 |
abate |
298 |
|
| 17 |
abate |
370 |
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 |
abate |
446 |
http://sourceforge.net/projects/ocamlnet |
| 27 |
abate |
370 |
pxp |
| 28 |
|
|
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html |
| 29 |
abate |
323 |
|
| 30 |
|
|
|
| 31 |
abate |
370 |
Important notes: |
| 32 |
abate |
323 |
|
| 33 |
abate |
390 |
- 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 |
abate |
370 |
- wlex: you only need to build and install the runtime support library |
| 37 |
|
|
(not the wlex tool itself): |
| 38 |
abate |
104 |
|
| 39 |
abate |
370 |
make runtime.all & make install_runtime |
| 40 |
abate |
298 |
|
| 41 |
abate |
370 |
- pcre-ocaml: you may also need to install the PCRE library |
| 42 |
|
|
from http://www.pcre.org/ |
| 43 |
abate |
298 |
|
| 44 |
abate |
370 |
./configure --prefix=<prefix directory> --disable-shared |
| 45 |
abate |
298 |
|
| 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 |
abate |
104 |
cd lib |
| 53 |
|
|
cp ../META . |
| 54 |
|
|
ocamlfind install pcre META *.a *.cma *.cmxa *.cmi *.mli |
| 55 |
|
|
|
| 56 |
abate |
370 |
- PXP: |
| 57 |
|
|
CDuce requires a development version >= 1.1.93. |
| 58 |
abate |
104 |
|
| 59 |
abate |
532 |
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 |
abate |
104 |
|
| 63 |
abate |
402 |
Efficiency issues: |
| 64 |
abate |
399 |
|
| 65 |
|
|
- OCamlnet: if you plan to load XML file with encodings other than |
| 66 |
abate |
402 |
UTF-8, it is advised to use the CVS version of OCamlnet: |
| 67 |
abate |
399 |
http://sourceforge.net/cvs/?group_id=19774 |
| 68 |
abate |
406 |
Indeed, the netconversion module in the latest release (0.95) was |
| 69 |
abate |
399 |
very slow, and it has been rewritten since then. |
| 70 |
|
|
|
| 71 |
abate |
370 |
------------------------------------------------------------------------------ |
| 72 |
|
|
Compilation |
| 73 |
|
|
------------------------------------------------------------------------------ |
| 74 |
abate |
298 |
|
| 75 |
abate |
370 |
You need a GNU Make (or equivalent) to use the Makefile from the |
| 76 |
|
|
distribution. It defines the following goals: |
| 77 |
abate |
298 |
|
| 78 |
abate |
402 |
- make cduce |
| 79 |
abate |
370 |
compiles the CDuce command line interpreter |
| 80 |
abate |
298 |
|
| 81 |
abate |
370 |
- make dtd2cduce |
| 82 |
|
|
compiles the dtd2cduce tools (converts DTD to CDuce types) |
| 83 |
abate |
298 |
|
| 84 |
abate |
402 |
- make webiface |
| 85 |
abate |
370 |
compiles the CDuce web interface interpreter (to be used as a CGI script) |
| 86 |
abate |
362 |
|
| 87 |
abate |
370 |
- make local_website |
| 88 |
abate |
406 |
compiles in the web/www/ subdirectory the HTML files for the CDuce website |
| 89 |
|
|
(including the tutorial and manual) |
| 90 |
abate |
402 |
|
| 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 |
abate |
406 |
make cduce NATIVE=false |
| 108 |
abate |
485 |
|
| 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... |