INSTALL 5.3 KB
Newer Older
1
2
Installation Notes for CDuce
============================
3

4
CDuce is written in the OCaml programming language. It has been
5
6
successfully compiled under Intel Linux, Mac OSX, SunOS 5.7, FreeBSD 4.7.
and Windows XP.
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
following packages:
15

16
ocaml      => 3.07 (patchlevel 2)    
17
  http://caml.inria.fr/ocaml/distrib.html
18
findlib    => 0.8 
19
  http://www.ocaml-programming.de/packages
20
ulex       => 0.3
21
  http://www.cduce.org/download
22
pcre-ocaml => 5.03
23
  http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
24
ocamlnet   => 0.94 
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
Important notes:
30

31
- OCaml: cduce uses recursive modules so versions of OCaml before 3.07
32
33
34
  will not work. Also early standard distribution of 3.07 had two bugs
  that made CDuce compilation fail. Use patchlevel 2 distribution or patch
  OCaml source by
35
36
37

      http://caml.inria.fr/bin/caml-bugs/fixed?id=1863;page=77;user=guest
      http://www.cduce.org/download/patch-ocaml-3.07
38

39
  or (risky) install OCaml cvs version
40
     cvs -d":pserver:anoncvs@camlcvs.inria.fr:/caml" login  
41
     <hit enter key when asked for password>
42
     cvs -z3 -d":pserver:anoncvs@camlcvs.inria.fr:/caml" co ocaml
43

44
- pcre-ocaml: you may also need to install the PCRE library
45
  from http://www.pcre.org/ (use version >=4.4)
46
47
  [red-hat users: pcre (rawhide) packages may not work with the
  latest pcre-ocaml versions, use tarballs]
48
  In this case configure it with the  --enable-utf8 option.
49
  >= 5.03 recommended but previous versions may work
50

51
52
- PXP:
  CDuce requires a development version >= 1.1.93.
53
  Notes: It is enough to build support UTF8 and ISO-8859-1 ocamllex-lexers:
54
  ./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591
55
56
57
58
59
60
  You can also build pxp with wlex support (more compact code). This
  can be done by installing wlex runtime support library  *before* pxp
    http://www.eleves.ens.fr/home/frisch/soft.html#wlex
  and build pxp -with-wlex*. When building CDuce you still have the
  choice whether to use wlex or camllex (see PXP_WLEX option below)

61

62
Efficiency issues:
63
64

- OCamlnet: if you plan to load XML file with encodings other than
65
66
  UTF-8, it is advised to use a recent version of OCamlnet (>= 0.96).
  Indeed, the netconversion module in the previous release (0.95) was
67
68
  very slow, and it has been rewritten since then.

69
70
71
------------------------------------------------------------------------------
Compilation
------------------------------------------------------------------------------
72

73
74
THE FAST WAY:

75
- check local settings in Makefile.conf [optional]
76
77
78
79
80
- make all && make install


THE WISE WAY:

81
82
You need a GNU Make (or equivalent) to use the Makefile from the
distribution. It defines the following goals:
83

84
- make cduce
85
  compiles the CDuce command line interpreter
86

87
88
- make dtd2cduce
  compiles the dtd2cduce tools (converts DTD to CDuce types)
89

90
- make webiface
91
  compiles the CDuce web interface interpreter (to be used as a CGI script)
92

93
- make webpages
94
95
  compiles in the web/www/ subdirectory the HTML files for the CDuce website
  (including the tutorial and manual)
96

97
98
99
- make install_web
  compiles webiface and webpages, and install everything (see Makefile.conf)

100
- make all
101
  equivalent to (make cduce dtd2cduce)
102

103
- make install
104
105
106
  it installs   
  cduce and dtd2cduce into $(PREFIX)/bin
  cduce.1 into $(PREFIX)/man/man1
107
  (see PREFIX below)
108

109
110
111
- make clean
  back to the starting point

112
113
114
- make uninstall
  removes installe files

115
Makefile accepts the following options.
116
117
118
119
120
121

NATIVE=true   : use the OCaml native code compiler (ocamlopt) to build CDuce
NATIVE=false  : use the OCaml bytecode compiler (ocamlc)
  default: true  (the native code version is much faster)

PXP_WLEX=true : use wlex for parsing UTF-8 XML files
122
  need pxp built with wlex support
123
124
125
PXP_WLEX=false: use ocamllex for parsing UTF-8 XML files
  default: false (ocamllex is faster; wlex is more compact)

126
127
EXPAT=true: build expat support (see below)

128
129
130
PREFIX=/usr/local by default: where to install CDuce files (see
 Makefile.conf)

131
E.g.:
132
  make cduce NATIVE=false PREFIX=/usr/share
133
134
135
136
137
138
139

You can also modify Makefile.conf to set values for these choices.

------------------------------------------------------------------------------
Support for the expat parser
------------------------------------------------------------------------------

140
141
142
CDuce can uses two XML parsers: PXP and expat. PXP is needed
to build CDuce, and expat support can be additionnaly added.
Here is how to do so.
143

144
145
You need to install the expat C library and the OCaml wrapper.
The wrapper can be found at:
146

147
http://home.wanadoo.nl/maas/ocaml/
148

149
150
151
Once the wrapper and be installed, you can build CDuce with
the Makefile option EXPAT=true (which can be set on make command
line or in Makefile.conf).
152
153
154
155
156
157

The interpreter is now using expat for loading XML files.
You can still use PXP by providing the --pxp switch on the command
line.

Note: the current wrapper for expat does not support inclusion
158
159
of external entities. Moreover, the error messages in case of
ill-formed XML are less informative than PXP's.