Commit 11654b8a authored by Pietro Abate's avatar Pietro Abate

[r2002-10-10 09:11:23 by cvscast] Empty log message

Original author: cvscast
Date: 2002-10-10 09:11:23+00:00
parent 3e3d3a2a
Main developer:
Alain Frisch
Research project leaders, documentation:
Alain Frisch
Giuseppe Castagna
Véronique Benzaken
Code contribution:
Cédric Miachon (author and maintainer of the CQL subset)
Julien Demouth (original implementation of the OCaml/CDuce interface)
Stefano Zacchiroli (original implementation of the XML Schema support)
This diff is collapsed.
Installation Notes for CDuce
============================
CDuce is written in the OCaml programming language. It has been
successfully compiled under Intel Linux, Mac OSX, SunOS 5.7, FreeBSD 4.7.
and Windows XP.
(See INSTALL.WIN32 for installation under Windows)
------------------------------------------------------------------------------
Prerequisites
------------------------------------------------------------------------------
An easy way to get a system ready to compile CDuce is to use
the GODI distribution:
http://www.ocaml-programming.de/godi/
It includes all the mandatory and optional packages listed below,
and also the special modules needed to build the OCaml/CDuce interface.
Mandatory packages:
-------------------
Before compiling CDuce, you need to install recent releases of the
following packages:
ocaml >= 3.10
http://caml.inria.fr/ocaml/distrib.html
findlib >= 1.0.3
http://www.ocaml-programming.de/packages
ulex >= 1.0
http://www.cduce.org/download
pcre-ocaml >= 5.03
http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
ocamlnet >= 0.98
http://www.ocaml-programming.de/packages
Additional optional packages:
-----------------------------
* You'll probably want to build CDuce with an XML parser. You will need one of:
pxp >= 1.1.95
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
ocaml-expat >= 0.9.1
http://home.wanadoo.nl/maas/ocaml/
* CDuce can use one the the ocurl and netclient library to fetch external
URLs. You will need one of:
ocurl >= 0.15
http://sourceforge.net/projects/ocurl/
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.
Important notes:
----------------
- pcre-ocaml: you may also need to install the PCRE library
from http://www.pcre.org/ (use version >=4.4)
[red-hat users: pcre (rawhide) packages may not work with the
latest pcre-ocaml versions, use tarballs]
In this case, configure it with the --enable-utf8 option.
>= 5.03 recommended but previous versions may work
- PXP:
It is enough to build support for UTF8 and ISO-8859-1 ocamllex-lexers:
./configure -without-wlex -without-wlex-compat -lexlist utf8,iso88591
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 ocamllex (to choose wlex,
do ./configure --with-pxp_wlex or set PXP_WLEX=true in Makefile.conf).
- ocurl:
you may also need to install libcurl (http://curl.haxx.se/libcurl/)
- ocaml-expat:
you may also need to install libexpat (http://expat.sourceforge.net/)
------------------------------------------------------------------------------
Compilation
------------------------------------------------------------------------------
There is a configure script. It will check for the presence of
mandatory packages, and detect automatically optional ones. It will
also set installation directories. Running the script produces a
Makefile.conf file. You can get usage information about the script
with: ./configure --help
Alternatively, it is also possible to copy Makefile.conf.template to
Makefile.conf and modify it by hand.
The usual command line for configuring and building CDuce:
./configure && make all && make install
To see all the configuration options:
./configure --help
You need a GNU Make (or equivalent). The Makefile defines the following goals:
- make help
print a summary of what follows
- make all
build binaries and libraries (does not build dtd2cduce)
- make cduce
compiles the CDuce command line interpreter
- make dtd2cduce
compiles the dtd2cduce tools (converts DTD to CDuce types).
The PXP package must be available to build dtd2cduce.
If you cannot build dtd2cduce locally, you can use on online
version available at this URL:
http://www.cduce.org/dtd2cduce.html
- make doc
compiles in the subdirectory web/doc the HTML documentation for CDuce
- make all
- make install
installs binaries into $(BINDIR), manpages into $(MANDIR)/man1,
and registers the cduce_lib library with findlib.
- make clean
back to the starting point
- make uninstall
removes installed files
------------------------------------------------------------------------------
Building the CDuce/OCaml interface
------------------------------------------------------------------------------
If you want to build the OCaml/CDuce interface, you need a copy
of the OCaml source tree matching your current OCaml version.
You must pass the location of this tree to the configure script:
./configure --mliface=$HOME/ocaml-3.09
------------------------------------------------------------------------------
Note on XML parsers
------------------------------------------------------------------------------
When CDuce is built with support for both expat and PXP, it uses by default
expat to parse XML files. You can still use PXP by adding "--no expat" to
the CDuce command line.
- error messages:
The error messages provided by expat when parsing ill-formed XML documents
are less informative than those given by PXP.
- efficiency:
* expat is more efficient than PXP, and produces smaller executables.
* for PXP, ocamllex lexers are more efficient than wlex lexers.
ftp://ftp.leo.org/pub/altlinux/Sisyphus/files/i586/RPMS/findlib-0.8-alt2s.i586.rpm
ftp://ftp.leo.org/pub/altlinux/Sisyphus/files/i586/RPMS/pxp-1.1.93-alt2s.i586.rpm
ftp://ftp.leo.org/pub/altlinux/Sisyphus/files/i586/RPMS/pcre-ocaml-4.28.3-alt3s.i586.rpm
<box title="Rpm packages" link="rpm">
<p>
In order to install the cduce rpm packages you will need to install
the following packages
<pre>
ocaml >= 3.06
findlib >= 0.8
pcre-ocaml>= 4.22
ocamlnet >= 0.96
pxp >= 1.1.93
expat >= 1.95.6 (just for the expat package)
<pre>
</p>
<p> All these packages can be found in the Altlinux distribution: for Asia
<a href="ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/files/i586/RPMS/">i586</a>,
<a href="ftp://ftp.altlinux.ru/pub/distributions/ALTLinux/Sisyphus/files/SRPMS">src</a>; European mirror <a href="ftp://ftp.leo.org/pub/altlinux/Sisyphus/files/i586/RPMS/">i586</a>, <a href="ftp://ftp.leo.org/pub/altlinux/Sisyphus/files/SRPMS/">src</a>
<p>
<p>N.B. rpm will check that you installed all these packages. If you have them installed but not via rpm then install CDuce by <code>rpm -Uvh --nodeps cduce-X.X.X-X.rpm</code>
<p>
Installation Notes for Windows NT/2000/XP
=========================================
CDuce can be executed on Microsoft Windows by using the
RedHat/Cygnus environment Cygwin freely available at
http://www.cygwin.com/
The executable needs the cygwin1.dll that is distributed
under GPL license. This is not compatible with the CDuce license.
For this reason we do not provide binaries but give here detailed
instructions about how to compile CDuce sources under Cygwin/Windows.
------------------------------------------------------------------------------
Prerequisites
------------------------------------------------------------------------------
Before compiling CDuce on Windows, you need to install recent
releases of the following packages:
cygwin
http://www.cygwin.com
ocaml
http://caml.inria.fr/ocaml/distrib.html
findlib
http://www.ocaml-programming.de/packages
wlex
http://www.eleves.ens.fr/home/frisch/soft.html#wlex
pcre-ocaml
http://www.ai.univie.ac.at/~markus/home/ocaml_sources.html
ocamlnet
http://sourceforge.net/projects/ocamlnet
pxp
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
Installation notes (you are advised to follow this order):
1) Download and execute cygwin setup.exe.
- Choose Internet installation
- Choose a root directory whose path has no blanks in it
- Choose as Local Package Directory <your root>/usr/src (optional)
- Choose the mirror closest to you
- When asked to select the packages to install add to the default
choices the following packages:
Devel/
autoconf*
automake*
binutils
gcc*
make
patchutils
Lib/
libpcre
pcre **both binaries and sources**
you may also find useful to install the following packages
Editors/
emacs or vim (no trolls)
Net/
openssh
ncftp
Devel/
cvs
Utils/
diff
patch
then proceed with installation
2) Download (we suggest in /usr/src) and install Ocaml
[For the impatients: ./configure && make world.opt && make install]
3) Download (guess where) and install findlib
a plain ./configure && make all && make opt && make install
should work
4) Download and install ulex
5) Download and install pcre-ocaml.
6) Download and install ocamlnet
7) PXP:
CDuce requires a development version >= 1.1.93.
Now you can compile CDuce sources as indicated in the INSTALL file
namely
------------------------------------------------------------------------------
Compilation, installation
------------------------------------------------------------------------------
See the INSTALL file.
The package CDuce is released under the terms of an MIT-like license.
Copyright 2005 by Alain Frisch and contributors.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
version="%VER%"
requires="%REQ%"
description="Runtime support for CDuce"
archive(byte)="+camlp4/camlp4lib.cma cduce_lib.cma"
archive(native)="+camlp4/camlp4lib.cmxa cduce_lib.cmxa"
include Makefile.distrib
# For development
pull: tools/pull.$(EXTENSION)
$(LINK) -o $@ $^
PREPRO = camlp4o -I `ocamlfind query ulex` pa_ulex.cma pr_o.cmo $(SYNTAX) -sep "\n"
profile: misc/q_symbol.cmo
rm -Rf prepro
mkdir prepro
for i in $(DIRS); do \
mkdir prepro/$$i; \
for j in $$i/*.ml $$i/*.mli; do \
if [ -f "$$j" ]; then \
echo $$j; \
$(PREPRO) $$j -o prepro/$$j; \
fi; \
done; \
done
cp Makefile.distrib Makefile Makefile.conf prepro/
(cd prepro; \
touch depend; \
$(MAKE) compute_depend PROFILE=true SYNTAX_PARSER= ; \
$(MAKE) cduce PROFILE=true SYNTAX_PARSER= NATIVE=false)
# Site-specific installation
charme_build:
rsh charme ". .env; cd IMPLEM/CDUCE; $(MAKE) webiface webpages"
scp CHANGES INSTALL INSTALL.WIN32 web/www/*.html web/cduce.css cduce@iris:public_html/
scp webiface cduce@iris:cgi-bin/cduce
install_web_distant:
$(MAKE) webpages
rsync -acvz CHANGES INSTALL INSTALL.WIN32 web/www/*.html web/demo.js web/cduce.css cduce@trefle.ens.fr:public_html/
SCRIPT =
INCLUDES_DEB = $(INCLUDES) $(shell ocamlfind query -i-format -recursive $(PACKAGES))
DEBUGGER = ocamldebug
debug:
ledit $(DEBUGGER) $(INCLUDES_DEB) ./cduce $(SCRIPT)
# Packaging
DISTRIB = $(DIRS) cduce.spec tools depend INSTALL INSTALL.WIN32 CHANGES \
LICENSE README AUTHORS Makefile.conf.template configure configure.ml doc \
META.in cduce_mktop VERSION PLIST.godi
DISTRIB_DOC = doc.xml memento.xml tutorial.xml manual.xml tutorial manual \
xhtml.cd xhtml-categ.cd xhtml-strict.cd site.cd siteTypes.cd
PACKAGE = cduce-$(VERSION)
.PHONY: package
package: clean
rm -Rf $(PACKAGE)
mkdir $(PACKAGE)
cp -R $(DISTRIB) $(PACKAGE)/
cp Makefile.distrib $(PACKAGE)/Makefile
mkdir -p $(PACKAGE)/web/img
(cd web; cp -R $(DISTRIB_DOC) ../$(PACKAGE)/web; \
cd img; cp left.gif right.gif ../../$(PACKAGE)/web/img)
(cd $(PACKAGE); \
rm -f types/IDEAS; \
for F in $(DEPEND); do headache -h ../header $$F; done)
tar czf $(PACKAGE).tar.gz --exclude CVS --exclude ".#*" $(PACKAGE)
rm -Rf $(PACKAGE)
upload:
scp $(PACKAGE).tar.gz cduce@di.ens.fr:public_html/download
#cvs_snapshot:
# $(MAKE) package VERSION=cvs`date +%Y%m%d`
MSTONE=3
cvs_snapshot:
(cd /tmp; \
rm -Rf cduce; \
cvs -z3 -d ":pserver:anonymous@cvs.cduce.org:/cvsroot" co cduce; \
tar czf cduce-cvs$(MSTONE).tar.gz cduce; \
rm -Rf cduce; \
scp cduce-cvs$(MSTONE).tar.gz cduce@iris.ens.fr:public_html/download; \
rm -f cduce-cvs$(MSTONE).tar.gz)
OCAML_STDLIBDIR := $(shell ocamlc -where)
.PHONY: .ocamlinit
.ocamlinit:
echo '(* AUTOMATICALLY GENERATED by Makefile: DO NOT EDIT! *)' > $@
echo '#load "$(OCAML_STDLIBDIR)/pcre/pcre.cma";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/unix.cma";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/netstring/netstring.cma";;' >> $@
# echo '#load "$(OCAML_STDLIBDIR)/netstring/netstring_top.cmo";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/pxp-engine/pxp_engine.cma";;' >> $@
# echo '#load "$(OCAML_STDLIBDIR)/pxp-engine/pxp_top.cmo";;' *)' >> $@
echo '#load "$(OCAML_STDLIBDIR)/pxp-lex-iso88591/pxp_lex_iso88591.cma";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/pxp-lex-iso88591/pxp_lex_link_iso88591.cmo";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/ulex/ulexing.cma";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/nums.cma";;' >> $@
# echo '#load "$(OCAML_STDLIBDIR)/num_top.cma";;' >> $@
echo '#load "$(OCAML_STDLIBDIR)/cgi/cgi.cma";;' >> $@
for o in $(VALIDATE_OBJECTS); do echo "prerr_endline \"Loading $$o ...\";;" >> $@; echo "#load \"$$o\";;" >> $@; done
for d in $(DIRS); do echo "#directory \"$$d\";;" >> $@; done
for p in pcre netstring pxp-engine ulex cgi; do echo "#directory \"`$(OCAMLFIND) query $$p`\";;" >> $@; done
echo "prerr_endline \"All done!\"" >> $@
echo '(* vim: set ft=ocaml: *)' >> $@
CVS_DISTRIB = web CHANGES LICENSE README AUTHORS cduce dtd2cduce
CVS_DOC = doc/cdo2ml.1 doc/cduce.1 doc/cduce_mktop.1 doc/cduce_validate.1 doc/dtd2cduce.1 doc/fomanual/tutorial.pdf doc/fomanual/manual.pdf
cvs_snapshot_bin: clean
if [[ `uname` != Linux ]]; then echo "Not a Linux box!"; exit 2; fi
$(MAKE) cduce dtd2cduce NATIVE=true EXTRA_LINK_OPTS="-ccopt -static" VERSION=cvs`date +%Y%m%d`
rm -Rf cduce-cvs
mkdir cduce-cvs
mkdir cduce-cvs/doc
cp -R $(CVS_DISTRIB) cduce-cvs
cp $(CVS_DOC) cduce-cvs/doc
cp Makefile.binary cduce-cvs/Makefile
tar czf cduce-cvs-linux-static.tar.gz --exclude CVS cduce-cvs
rm -Rf cduce-cvs
scp cduce-cvs-linux-static.tar.gz cduce@di.ens.fr:public_html/download
.PHONY: test
test:
$(MAKE) -C tests test
# Web site
driver/examples.ml: cduce web/xhtml.cdo web/examples/build.cd web/examples/examples.xml
(cd web/examples; ../../cduce build.cd -I .. --arg examples.xml)
web_fetch_tralala:
wget -O web/tralala_documents_lille.inc http://www.grappa.univ-lille3.fr/bibtex/tralalamachine.php
webpages: cduce web/site.cdo
(cd web; ../cduce --run site.cdo --arg site.xml)
website: webpages webiface evaluator
install_web: website
cp web/www/*.html web/demo.js web/cduce.css $(HTML_DIR)/
cp CHANGES INSTALL INSTALL.WIN32 $(HTML_DIR)/
cp webiface $(CGI_DIR)/cduce
cp evaluator $(CGI_DIR)/demo_evaluator
if test ! -d "$(HTML_DIR)/img" ; then \
mkdir $(HTML_DIR)/img; \
fi;
cp web/img/*.* $(HTML_DIR)/img
WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
EVALUATOR = $(OBJECTS) driver/evaluator.cmo
webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
@echo "Build $@"
$(HIDE)$(LINK) -verbose $(INCLUDES) -o $@ $^ $(EXTRA_OPTS_WEBIFACE)