| 1 |
Installation notes |
Installation Notes for CDuce |
| 2 |
================== |
============================ |
| 3 |
|
|
| 4 |
- ocaml 3.06 |
CDuce is written in the OCaml programming language. It has been |
| 5 |
(http://caml.inria.fr/ocaml/distrib.html) |
successfully compiled under Intel Linux, Mac OSX, SunOS 5.7, FreeBSD 4.7. |
| 6 |
|
and Windows XP. |
| 7 |
|
(See INSTALL.WIN32 for installation under Windows) |
| 8 |
|
|
| 9 |
- ocamlfind |
------------------------------------------------------------------------------ |
| 10 |
(http://www.ocaml-programming.de/packages/findlib-0.8.1.tar.gz) |
Prerequisites |
| 11 |
Usually it suffices to do: |
------------------------------------------------------------------------------ |
| 12 |
|
|
| 13 |
./configure && make all && make opt && make install |
Before compiling CDuce, you need to install recent releases of the |
| 14 |
|
following packages: |
| 15 |
|
|
| 16 |
|
ocaml => 3.07 |
| 17 |
|
http://caml.inria.fr/ocaml/distrib.html |
| 18 |
|
findlib |
| 19 |
|
http://www.ocaml-programming.de/packages |
| 20 |
|
ulex |
| 21 |
|
http://www.cduce.org/download |
| 22 |
|
pcre-ocaml |
| 23 |
|
http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html |
| 24 |
|
ocamlnet |
| 25 |
|
http://sourceforge.net/projects/ocamlnet |
| 26 |
|
pxp => 1.9.93 |
| 27 |
|
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html |
| 28 |
|
|
| 29 |
- wlex |
Important notes: |
|
(http://www.eleves.ens.fr/home/frisch/soft.html) |
|
|
specify in Makefile where is the source code (of the lex library) |
|
|
of OCaml [default is $HOME/ocaml-3.06/lex]: |
|
|
OCAMLLEX_SRC = <source directory> |
|
| 30 |
|
|
| 31 |
then |
- OCaml: cduce uses recursive modules so versions of OCaml before 3.07 |
| 32 |
make wlex && make install_wlex && make runtime && \ |
will not work. Also the standard distribution has two bugs that make |
| 33 |
make runtime.opt && make install_runtime |
CDuce compilation fail. Patch OCaml source by |
| 34 |
|
|
| 35 |
it is important to do make runtime.opt otherwise |
http://caml.inria.fr/bin/caml-bugs/fixed?id=1863;page=77;user=guest |
| 36 |
the web interface does not compile. |
http://www.cduce.org/download/patch-ocaml-3.07 |
| 37 |
|
|
| 38 |
- pcre |
or (better) install OCaml cvs version |
| 39 |
(http://www.pcre.org/) |
cvs -d":pserver:anoncvs@camlcvs.inria.fr:/caml" login |
| 40 |
To install first do a simple: |
hit enter key when asked for password |
| 41 |
|
cvs -d":pserver:anoncvs@camlcvs.inria.fr:/caml" co ocaml |
| 42 |
|
|
| 43 |
./configure |
- pcre-ocaml: you may also need to install the PCRE library |
| 44 |
|
from http://www.pcre.org/ [red-hat users: 4.3 package does |
| 45 |
|
not work with the latest pcre-ocaml version, use tarballs] |
| 46 |
|
>= 5.03 recommended but previous versions may work |
| 47 |
|
|
| 48 |
For a custom configuration use options: |
- PXP: |
| 49 |
|
CDuce requires a development version >= 1.1.93. |
| 50 |
|
|
| 51 |
--prefix=<prefix directory> --disable-shared |
Note: |
| 52 |
|
It is enough to build support UTF8 and ISO-8859-1 ocamllex-lexers: |
| 53 |
|
./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591 |
| 54 |
|
|
| 55 |
then as usual make, make install |
Efficiency issues: |
| 56 |
|
|
| 57 |
|
- OCamlnet: if you plan to load XML file with encodings other than |
| 58 |
|
UTF-8, it is advised to use a recent version of OCamlnet (>= 0.96). |
| 59 |
|
Indeed, the netconversion module in the previous release (0.95) was |
| 60 |
|
very slow, and it has been rewritten since then. |
| 61 |
|
|
| 62 |
- pcre-ocaml |
------------------------------------------------------------------------------ |
| 63 |
(http://pcre-ocaml.sourceforge.net/) |
Compilation |
| 64 |
|
------------------------------------------------------------------------------ |
| 65 |
|
|
| 66 |
If pcre was installed in non standard place then in Makefile.conf: |
You need a GNU Make (or equivalent) to use the Makefile from the |
| 67 |
export STATIC = yes #this may help but first try without |
distribution. It defines the following goals: |
|
export INCDIRS := <prefix_directory>/include |
|
|
export LIBDIRS := <prefix_directory>/lib |
|
| 68 |
|
|
| 69 |
After make all && make opt: |
- make cduce |
| 70 |
cd lib |
compiles the CDuce command line interpreter |
|
cp ../META . |
|
|
ocamlfind install pcre META *.a *.cma *.cmxa *.cmi *.mli |
|
| 71 |
|
|
| 72 |
- ocamlnet |
- make dtd2cduce |
| 73 |
(http://ocamlnet.sourceforge.net/) |
compiles the dtd2cduce tools (converts DTD to CDuce types) |
|
cd in the src directory and then |
|
| 74 |
|
|
| 75 |
./configure && make all && make opt && make install |
- make webiface |
| 76 |
|
compiles the CDuce web interface interpreter (to be used as a CGI script) |
| 77 |
|
|
| 78 |
|
- make webpages |
| 79 |
|
compiles in the web/www/ subdirectory the HTML files for the CDuce website |
| 80 |
|
(including the tutorial and manual) |
| 81 |
|
|
| 82 |
- pxp (development version 1.1.93) |
- make install_web |
| 83 |
(http://www.ocaml-programming.de/programming/pxp.html) |
compiles webiface and webpages, and install everything (see Makefile.conf) |
| 84 |
|
|
| 85 |
./configure && make all && make opt && make install |
- make all |
| 86 |
|
equivalent to (make cduce dtd2cduce) |
| 87 |
|
|
| 88 |
|
- make install |
| 89 |
|
it installs |
| 90 |
|
cduce and dtd2cduce into $(PREFIX)/bin |
| 91 |
|
cduce.1 into $(PREFIX)/man/man1 |
| 92 |
|
(see PREFIX below) |
| 93 |
|
|
| 94 |
|
Makefile accepts the following options. |
| 95 |
|
|
| 96 |
WEB SITE INSTALLATION |
NATIVE=true : use the OCaml native code compiler (ocamlopt) to build CDuce |
| 97 |
==================== |
NATIVE=false : use the OCaml bytecode compiler (ocamlc) |
| 98 |
|
default: true (the native code version is much faster) |
| 99 |
|
|
| 100 |
If you want to install CDuce site, with its online demo and tutorial |
PXP_WLEX=true : use wlex for parsing UTF-8 XML files |
| 101 |
then you can study the Makefile (just do make web/files webiface.opt |
PXP_WLEX=false: use ocamllex for parsing UTF-8 XML files |
| 102 |
and install the generated files by hand). |
default: false (ocamllex is faster; wlex is more compact) |
| 103 |
|
|
| 104 |
For the Apache server you may have to change its configuration file |
EXPAT=true: build expat support (see below) |
|
httpd.conf. In particular you have to load php_mod and add to the |
|
|
directives of the directory you installed the files the following: |
|
| 105 |
|
|
| 106 |
<Directory "cduce_root"> |
PREFIX=/usr/local by default: where to install CDuce files (see |
| 107 |
Options MultiViews |
Makefile.conf) |
| 108 |
# if .php is not in mime-types then also add: |
|
| 109 |
MultiviewsMatch Any |
E.g.: |
| 110 |
</Directory> |
make cduce NATIVE=false |
| 111 |
|
|
| 112 |
|
You can also modify Makefile.conf to set values for these choices. |
| 113 |
|
|
| 114 |
|
------------------------------------------------------------------------------ |
| 115 |
|
Support for the expat parser |
| 116 |
|
------------------------------------------------------------------------------ |
| 117 |
|
|
| 118 |
|
CDuce can uses two XML parsers: PXP and expat. PXP is needed |
| 119 |
|
to build CDuce, and expat support can be additionnaly added. |
| 120 |
|
Here is how to do so. |
| 121 |
|
|
| 122 |
|
You need to install the expat C library and the OCaml wrapper. |
| 123 |
|
The wrapper can be found at: |
| 124 |
|
|
| 125 |
|
http://home.wanadoo.nl/maas/ocaml/ |
| 126 |
|
|
| 127 |
|
Once the wrapper and be installed, you can build CDuce with |
| 128 |
|
the Makefile option EXPAT=true (which can be set on make command |
| 129 |
|
line or in Makefile.conf). |
| 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, the error messages in case of |
| 137 |
|
ill-formed XML are less informative than PXP's. |