| 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, Mac OSX, SunOS 5.7, FreeBSD 4.7.
|
| 6 |
and Windows XP.
|
| 7 |
(See INSTALL.WIN32 for installation under Windows)
|
| 8 |
|
| 9 |
------------------------------------------------------------------------------
|
| 10 |
Prerequisites
|
| 11 |
------------------------------------------------------------------------------
|
| 12 |
|
| 13 |
An easy way to get a system ready to compile CDuce is to use
|
| 14 |
the GODI distribution:
|
| 15 |
|
| 16 |
http://www.ocaml-programming.de/godi/
|
| 17 |
|
| 18 |
It includes all the mandatory and optional packages listed below,
|
| 19 |
and also the special modules needed to build the OCaml/CDuce interface.
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
Mandatory packages:
|
| 24 |
-------------------
|
| 25 |
|
| 26 |
Before compiling CDuce, you need to install recent releases of the
|
| 27 |
following packages:
|
| 28 |
|
| 29 |
ocaml >= 3.10
|
| 30 |
http://caml.inria.fr/ocaml/distrib.html
|
| 31 |
findlib >= 1.0.3
|
| 32 |
http://www.ocaml-programming.de/packages
|
| 33 |
ulex >= 1.0
|
| 34 |
http://www.cduce.org/download.html
|
| 35 |
pcre-ocaml >= 5.13.0
|
| 36 |
http://ocaml.info/home/ocaml_sources.html#toc16
|
| 37 |
ocamlnet >= 0.98
|
| 38 |
http://www.ocaml-programming.de/packages
|
| 39 |
|
| 40 |
Additional optional packages:
|
| 41 |
-----------------------------
|
| 42 |
|
| 43 |
* You'll probably want to build CDuce with an XML parser. You will need one of:
|
| 44 |
|
| 45 |
pxp >= 1.1.95
|
| 46 |
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
|
| 47 |
ocaml-expat >= 0.9.1
|
| 48 |
http://home.wanadoo.nl/maas/ocaml/
|
| 49 |
|
| 50 |
|
| 51 |
* CDuce can use one the the ocurl and netclient library to fetch external
|
| 52 |
URLs. You will need one of:
|
| 53 |
|
| 54 |
ocurl >= 0.15
|
| 55 |
http://sourceforge.net/projects/ocurl/
|
| 56 |
|
| 57 |
netclient >= 0.90.1
|
| 58 |
http://www.ocaml-programming.de/programming/netclient.html
|
| 59 |
|
| 60 |
netclient support only the http protocol.
|
| 61 |
curl supports in addition https, ftp, and other protocols.
|
| 62 |
|
| 63 |
|
| 64 |
Important notes:
|
| 65 |
----------------
|
| 66 |
|
| 67 |
- pcre-ocaml: you may also need to install the PCRE library
|
| 68 |
from http://www.pcre.org/ (use version >=4.4)
|
| 69 |
[red-hat users: pcre (rawhide) packages may not work with the
|
| 70 |
latest pcre-ocaml versions, use tarballs]
|
| 71 |
In this case, configure it with the --enable-utf8 option.
|
| 72 |
>= 5.03 recommended but previous versions may work
|
| 73 |
|
| 74 |
- PXP:
|
| 75 |
It is enough to build support for UTF8 and ISO-8859-1 ocamllex-lexers:
|
| 76 |
|
| 77 |
./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591
|
| 78 |
|
| 79 |
You can also build pxp with wlex support (more compact code). This
|
| 80 |
can be done by installing wlex runtime support library *before* pxp
|
| 81 |
http://www.eleves.ens.fr/home/frisch/soft.html#wlex
|
| 82 |
and build pxp -with-wlex*. When building CDuce you still have the
|
| 83 |
choice whether to use wlex or ocamllex (to choose wlex,
|
| 84 |
do ./configure --with-pxp_wlex or set PXP_WLEX=true in Makefile.conf).
|
| 85 |
|
| 86 |
- ocurl:
|
| 87 |
you may also need to install libcurl (http://curl.haxx.se/libcurl/)
|
| 88 |
|
| 89 |
- ocaml-expat:
|
| 90 |
you may also need to install libexpat (http://expat.sourceforge.net/)
|
| 91 |
|
| 92 |
|
| 93 |
------------------------------------------------------------------------------
|
| 94 |
Compilation
|
| 95 |
------------------------------------------------------------------------------
|
| 96 |
|
| 97 |
There is a configure script. It will check for the presence of
|
| 98 |
mandatory packages, and detect automatically optional ones. It will
|
| 99 |
also set installation directories. Running the script produces a
|
| 100 |
Makefile.conf file. You can get usage information about the script
|
| 101 |
with: ./configure --help
|
| 102 |
|
| 103 |
Alternatively, it is also possible to copy Makefile.conf.template to
|
| 104 |
Makefile.conf and modify it by hand.
|
| 105 |
|
| 106 |
|
| 107 |
The usual command line for configuring and building CDuce:
|
| 108 |
|
| 109 |
./configure && make all && make install
|
| 110 |
|
| 111 |
To see all the configuration options:
|
| 112 |
|
| 113 |
./configure --help
|
| 114 |
|
| 115 |
You need a GNU Make (or equivalent). The Makefile defines the following goals:
|
| 116 |
|
| 117 |
- make help
|
| 118 |
print a summary of what follows
|
| 119 |
|
| 120 |
- make all
|
| 121 |
build binaries and libraries (does not build dtd2cduce)
|
| 122 |
|
| 123 |
- make cduce
|
| 124 |
compiles the CDuce command line interpreter
|
| 125 |
|
| 126 |
- make dtd2cduce
|
| 127 |
compiles the dtd2cduce tools (converts DTD to CDuce types).
|
| 128 |
The PXP package must be available to build dtd2cduce.
|
| 129 |
If you cannot build dtd2cduce locally, you can use on online
|
| 130 |
version available at this URL:
|
| 131 |
http://www.cduce.org/dtd2cduce.html
|
| 132 |
|
| 133 |
- make doc
|
| 134 |
compiles in the subdirectory web/doc the HTML documentation for CDuce
|
| 135 |
|
| 136 |
- make all
|
| 137 |
|
| 138 |
- make install
|
| 139 |
installs binaries into $(BINDIR), manpages into $(MANDIR)/man1,
|
| 140 |
and registers the cduce_lib library with findlib.
|
| 141 |
|
| 142 |
- make clean
|
| 143 |
back to the starting point
|
| 144 |
|
| 145 |
- make uninstall
|
| 146 |
removes installed files
|
| 147 |
|
| 148 |
------------------------------------------------------------------------------
|
| 149 |
Building the CDuce/OCaml interface
|
| 150 |
------------------------------------------------------------------------------
|
| 151 |
|
| 152 |
If you want to build the OCaml/CDuce interface, you need a copy
|
| 153 |
of the OCaml source tree matching your current OCaml version.
|
| 154 |
You must pass the location of this tree to the configure script:
|
| 155 |
|
| 156 |
./configure --mliface=$HOME/ocaml-3.09
|
| 157 |
|
| 158 |
------------------------------------------------------------------------------
|
| 159 |
Note on XML parsers
|
| 160 |
------------------------------------------------------------------------------
|
| 161 |
|
| 162 |
When CDuce is built with support for both expat and PXP, it uses by default
|
| 163 |
expat to parse XML files. You can still use PXP by adding "--no expat" to
|
| 164 |
the CDuce command line.
|
| 165 |
|
| 166 |
- error messages:
|
| 167 |
The error messages provided by expat when parsing ill-formed XML documents
|
| 168 |
are less informative than those given by PXP.
|
| 169 |
|
| 170 |
- efficiency:
|
| 171 |
* expat is more efficient than PXP, and produces smaller executables.
|
| 172 |
* for PXP, ocamllex lexers are more efficient than wlex lexers.
|
| 173 |
|