2 <!-- ============= Installation ============================== -->
4 <chapter id="sec_install">
5 <title>Installation</title>
7 <sect1 id="inst_from_src">
8 <title>Installing from sources</title>
10 <para>Currently, the only intended way to install &appname; is starting
11 from its source code. </para>
13 <sect2 id="get_source_code">
14 <title>Getting the source code</title>
16 <para>You can get the &appname; source code in two ways:
19 <listitem> <para> go to the <ulink type="http"
20 url="http://matita.cs.unibo.it/download.shtml">download
21 page</ulink> and get the <ulink type="http"
22 url="http://matita.cs.unibo.it/sources/matita-latest.tar.gz"
23 >latest released source tarball</ulink>;</para> </listitem>
25 <listitem> <para> get the development sources from <ulink type="http"
26 url="http://helm.cs.unibo.it/websvn/listing.php?repname=helm&path=%2F&sc=0">our
27 SVN repository</ulink>. You will need the
28 <application>components/</application> and
29 <application>matita/</application> directories from the
30 <filename>trunk/helm/software/</filename> directory, plus the
31 <filename>configure</filename> and <filename>Makefile*</filename>
32 stuff from the same directory. </para>
34 <para>In this case you will need to run
35 <command>autoconf</command> before proceding with the building
36 instructions below.</para> </listitem>
43 <sect2 id="build_requirements">
44 <title>Requirements</title>
46 <para>In order to build &appname; from sources you will need some
47 tools and libraries. They are listed below.
50 <title>Note for Debian (and derivatives) users</title>
52 <para>If you are running a
54 url="http://www.debian.org">Debian GNU/Linux</ulink>
56 or any of its derivative like <ulink type="http"
57 url="http://ubuntu.com">Ubuntu</ulink>,
58 you can use APT to install all the required tools and
59 libraries since they are all part of the Debian archive.
62 apt-get install ocaml ocaml-findlib libgdome2-ocaml-dev liblablgtk2-ocaml-dev liblablgtkmathview-ocaml-dev liblablgtksourceview-ocaml-dev libsqlite3-ocaml-dev libocamlnet-ocaml-dev libzip-ocaml-dev libhttp-ocaml-dev ocaml-ulex08 libexpat-ocaml-dev libmysql-ocaml-dev camlp5
65 An official debian package is going to be added to the
72 <title>Required tools and libraries</title>
76 <application> <ulink type="http"
77 url="http://caml.inria.fr">OCaml</ulink> </application>
80 <para> the Objective Caml compiler, version 3.09 or above </para>
86 <application> <ulink type="http"
87 url="http://www.ocaml-programming.de/packages/">Findlib</ulink>
91 <para> OCaml package manager, version 1.1.1 or above</para>
97 <application> <ulink type="http"
98 url="http://www.xs4all.nl/~mmzeeman/ocaml/">OCaml
99 Expat</ulink> </application>
102 <para>OCaml bindings for the <application><ulink type="http"
103 url="http://expat.sourceforge.net/">expat</ulink>
104 library</application> </para>
110 <application> <ulink type="http"
111 url="http://gmetadom.sourceforge.net/">GMetaDOM</ulink>
115 <para>OCaml bindings for the <application><ulink type="http"
116 url="http://gdome2.cs.unibo.it/">Gdome 2</ulink>
117 library</application></para>
123 <application> <ulink type="http"
124 url="http://www.bononia.it/~zack/ocaml-http.en.html">OCaml
125 HTTP</ulink> </application>
128 <para> OCaml library to write HTTP daemons (and clients) </para>
134 <application> <ulink type="http"
135 url="http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgtk.html">LablGTK</ulink>
139 <para> OCaml bindings for the <application> <ulink type="http"
140 url="http://www.gtk.org"> GTK+</ulink> library
141 </application>, version 2.6.0 or above </para>
147 <application> <ulink type="http"
148 url="http://helm.cs.unibo.it/mml-widget/">GtkMathView</ulink>
152 <application> <ulink type="http"
153 url="http://helm.cs.unibo.it/mml-widget/">LablGtkMathView</ulink>
157 <para> GTK+ widget to render <ulink type="http"
158 url="http://www.w3.org/Math/">MathML</ulink> documents and its
159 OCaml bindings </para>
165 <application> <ulink type="http"
166 url="http://gtksourceview.sourceforge.net/">GtkSourceView</ulink>
170 <application> <ulink type="http"
171 url="http://helm.cs.unibo.it/software/lablgtksourceview/">LablGtkSourceView</ulink>
175 <para> extension for the GTK+ text widget (adding the typical
176 features of source code editors) and its OCaml bindings </para>
181 <term> &MYSQL; </term>
183 <application> <ulink type="http"
184 url="http://raevnos.pennmush.org/code/ocaml-mysql/">OCaml
185 MySQL</ulink> </application>
188 <para> SQL database and OCaml bindings for its client-side library
190 <para> The SQL database itself is not strictly needed to run
191 &appname;, but the client libraries are.</para>
196 <term> &Sqlite; </term>
200 url="http://ocaml.info/home/ocaml_sources.html">
202 </ulink> </application>
205 <para> Sqlite database and OCaml bindings
212 <application> <ulink type="http"
213 url="http://ocamlnet.sourceforge.net/">Ocamlnet</ulink>
217 <para> collection of OCaml libraries to deal with
218 application-level Internet protocols and conventions </para>
224 <application> <ulink type="http"
225 url="http://www.cduce.org/download.html">ulex</ulink>
229 <para> Unicode lexer generator for OCaml </para>
235 <application> <ulink type="http"
236 url="http://cristal.inria.fr/~xleroy/software.html">CamlZip</ulink>
240 <para> OCaml library to access <filename>.gz</filename> files
245 </variablelist> </para>
249 <sect2 id="database_setup">
250 <title>Database setup</title>
252 <para> To fully exploit &appname; indexing and search capabilities you
253 will need a working &MYSQL; database. Detalied instructions on how to do
254 it can be found in the <ulink type="http"
255 url="http://dev.mysql.com/doc/">MySQL documentation</ulink>. Here you
256 can find a quick howto. </para>
258 <para> In order to create a database you need administrator permissions on
259 your MySQL installation, usually the root account has them. Once you
260 have the permissions, a new database can be created executing
261 <userinput>mysqladmin create matita</userinput>
262 (<emphasis>matita</emphasis> is the default database name, you can
263 change it using the <parameter>db.user</parameter> key of the
264 configuration file). </para>
266 <para> Then you need to grant the necessary access permissions to the
267 database user of &appname;, typing <userinput>echo "grant all privileges
268 on matita.* to helm;" | mysql matita</userinput> should do the trick
269 (<emphasis>helm</emphasis> is the default user name used by &appname; to
270 access the database, you can change it using the
271 <parameter>db.user</parameter> key of the configuration file).
275 <para> This way you create a database named <emphasis>matita</emphasis>
276 on which anyone claiming to be the <emphasis>helm</emphasis> user can
277 do everything (like adding dummy data or destroying the contained
278 one). It is strongly suggested to apply more fine grained permissions,
279 how to do it is out of the scope of this manual.</para>
284 <sect2 id="build_instructions">
285 <title>Compiling and installing</title>
287 <para> Once you get the source code the installations steps should be
288 quite familiar.</para>
290 <para> First of all you need to configure the build process executing
291 <userinput>./configure</userinput>. This will check that all needed
292 tools and library are installed and prepare the sources for compilation
293 and installation. </para>
295 <para> Quite a few (optional) arguments may be passed to the
296 <application>configure</application> command line to change build time
297 parameters. They are listed below, together with their
298 default values: </para>
301 <title> <application>configure</application> command line
306 <userinput>--with-runtime-dir=<replaceable>dir</replaceable></userinput>
310 (<emphasis>Default:</emphasis>
311 <filename>/usr/local/matita</filename>) Runtime base directory
312 where all &appname; stuff (executables, configuration files,
313 standard library, ...) will be installed
320 <userinput>--with-dbhost=<replaceable>host</replaceable></userinput>
324 (<emphasis>Default:</emphasis> localhost) Default SQL server
325 hostname. Will be used while building the standard library
326 during the installation and to create the default &appname;
327 configuration. May be changed later in configuration file.
334 <userinput>--enable-debug</userinput>
338 (<emphasis>Default:</emphasis> disabled) Enable debugging code.
339 Not for the casual user.
345 <para> Then you will manage the build and install process using
346 <application><ulink type="http"
347 url="http://www.gnu.org/software/make/">make</ulink></application>
348 as usual. Below are reported the targets you have to invoke in sequence
349 to build and install:
353 <title><application>make</application> targets</title>
356 <term><userinput>world</userinput></term>
358 <para>builds components needed by &appname; and &appname; itself
359 (in bytecode or native code depending
360 on the availability of the OCaml native code compiler) </para>
365 <term><userinput>install</userinput></term>
367 <para>installs &appname; related tools, standard library and the
368 needed runtime stuff in the proper places on the filesystem.
370 <para>As a part of the installation process the &appname;
371 standard library will be compiled, thus testing that the just
372 built <application>matitac</application> compiler works
374 <para>For this step you will need a working SQL database (for
375 indexing the standard library while you are compiling it). See
376 <ulink type="http" url="#database_setup">Database setup</ulink>
377 for instructions on how to set it up.
388 <sect1 id="matita.conf.xml">
389 <title>Configuring Matita</title>
391 The file <emphasis>matita.conf.xml</emphasis>...
394 <figure><title>Configuring the Databases</title>
397 <imagedata fileref="figures/database.png" format="PNG" srccredit="Enrico Tassi"/>
399 <textobject><phrase>How to configure the databases.</phrase></textobject>