INSTALL 6.26 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
26
  http://www.ocaml-programming.de/packages
pxp        => 1.9.94.2
27
  http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
28
29
30

Furthermore if you want to load xml, html, and schema files remotely on the 
web (http, https, ftp, ...: e.g. load_html "http://www.cduce.org") you will 
31
also need either:
32

33
34
35
ocurl      => 0.15
  http://sourceforge.net/projects/ocurl/

36
37
38
39
40
41
42
43
or

netclient  => 0.90.1
  http://www.ocaml-programming.de/programming/netclient.html

netclient support only the http protocol. curl supports in addition https, 
ftp, and other protocols.

44

45
Important notes:
46

47
- OCaml: cduce uses recursive modules so versions of OCaml before 3.07
48
49
50
  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
51
52
53

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

55
  or (risky) install OCaml cvs version
56
     cvs -d":pserver:anoncvs@camlcvs.inria.fr:/caml" login  
57
     <hit enter key when asked for password>
58
     cvs -z3 -d":pserver:anoncvs@camlcvs.inria.fr:/caml" co ocaml
59

60
- pcre-ocaml: you may also need to install the PCRE library
61
  from http://www.pcre.org/ (use version >=4.4)
62
63
  [red-hat users: pcre (rawhide) packages may not work with the
  latest pcre-ocaml versions, use tarballs]
64
  In this case configure it with the  --enable-utf8 option.
65
  >= 5.03 recommended but previous versions may work
66

67
- PXP:
68
  CDuce requires a development version >= 1.1.94.2.
69
  Notes: It is enough to build support UTF8 and ISO-8859-1 ocamllex-lexers:
70
  ./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591
71
72
73
74
75
76
  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)

77
78
79
- ocurl: 
  you may also need to install libcurl (http://curl.haxx.se/libcurl/)
  To use it you have to set the variable CURL = true.
80

81

82
Efficiency issues:
83
84

- OCamlnet: if you plan to load XML file with encodings other than
85
86
  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
87
88
  very slow, and it has been rewritten since then.

89
90
-PXP: for better efficiency wlex is disabled by default.

91
92
93
------------------------------------------------------------------------------
Compilation
------------------------------------------------------------------------------
94

95
96
THE FAST WAY:

97
- check local settings in Makefile.conf or do "make help" [optional]
98
99
100
101
102
- make all && make install


THE WISE WAY:

103
104
You need a GNU Make (or equivalent) to use the Makefile from the
distribution. It defines the following goals:
105

106
107
108
- make help
  print a summary of what follows

109
- make cduce
110
  compiles the CDuce command line interpreter
111

112
113
- make dtd2cduce
  compiles the dtd2cduce tools (converts DTD to CDuce types)
114

115
116
117
- make validate
  compiles the schema validation tool

118
- make webiface
119
  compiles the CDuce web interface interpreter (to be used as a CGI script)
120

121
- make webpages
122
123
  compiles in the web/www/ subdirectory the HTML files for the CDuce website
  (including the tutorial and manual)
124

125
126
127
- make install_web
  compiles webiface and webpages, and install everything (see Makefile.conf)

128
- make all
129
  equivalent to (make cduce dtd2cduce validate)
130

131
- make install
132
  it installs   
133
  cduce validate and dtd2cduce into $(PREFIX)/bin
134
  cduce.1 into $(PREFIX)/man/man1
135
  (see PREFIX below)
136

137
138
139
- make clean
  back to the starting point

140
- make uninstall
141
  removes installed files
142

143
Makefile accepts at least the following options.
144
145
146
147
148
149

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
150
  need pxp built with wlex support
151
152
153
PXP_WLEX=false: use ocamllex for parsing UTF-8 XML files
  default: false (ocamllex is faster; wlex is more compact)

154
EXPAT=true: build expat support (see below)
155
  default: false
156

157
158
159
160
CURL=true: build ocurl support
  default: false

NETCLIENT=true: build netclient support
161
  default: false
162
  (note: if the support for both CURL and NETCLIENT are included, curl is used)
163

164
165
166
PREFIX=/usr/local by default: where to install CDuce files (see
 Makefile.conf)

167
E.g.:
168
  make cduce NATIVE=false PREFIX=/usr/share
169

170
171
You can also modify Makefile.conf to set values for these and more 
choices.
172
173
174
175
176

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

177
178
179
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.
180

181
182
You need to install the expat C library and the OCaml wrapper.
The wrapper can be found at:
183

184
http://home.wanadoo.nl/maas/ocaml/
185

186
187
188
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).
189
190
191
192
193
194

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
195
196
of external entities. Moreover, the error messages in case of
ill-formed XML are less informative than PXP's.