comparison doc/manual.tex @ 555:0b2cf25a5eba

Installation
author Adam Chlipala <adamc@hcoop.net>
date Tue, 09 Dec 2008 11:40:51 -0500
parents 193fe8836419
children 5703a2ad5221
comparison
equal deleted inserted replaced
554:193fe8836419 555:0b2cf25a5eba
41 41
42 The official web site for Ur is: 42 The official web site for Ur is:
43 \begin{center} 43 \begin{center}
44 \url{http://www.impredicative.com/ur/} 44 \url{http://www.impredicative.com/ur/}
45 \end{center} 45 \end{center}
46
47
48 \section{Installation}
49
50 If you are lucky, then the following standard command sequence will suffice for installation, in a directory to which you have unpacked the latest distribution tarball.
51
52 \begin{verbatim}
53 ./configure
54 make
55 sudo make install
56 \end{verbatim}
57
58 Some other packages must be installed for the above to work. At a minimum, you need a standard UNIX shell, with standard UNIX tools like sed and GCC in your execution path; and MLton, the whole-program optimizing compiler for Standard ML. To build programs that access SQL databases, you also need libpq, the PostgreSQL client library. As of this writing, in the ``testing'' version of Debian Linux, this command will install the more uncommon of these dependencies:
59
60 \begin{verbatim}
61 apt-get install mlton libpq-dev
62 \end{verbatim}
63
64 It is also possible to access the modules of the Ur/Web compiler interactively, within Standard ML of New Jersey. To install the prerequisites in Debian testing:
65
66 \begin{verbatim}
67 apt-get install smlnj libsmlnj-smlnj ml-yacc ml-lpt
68 \end{verbatim}
69
70 To begin an interactive session with the Ur compiler modules, run \texttt{make smlnj}, and then, from within an \texttt{sml} session, run \texttt{CM.make "src/urweb.cm";}. The \texttt{Compiler} module is the main entry point.
71
72 To run an SQL-backed application, you will probably want to install the PostgreSQL server. Version 8.3 or higher is required.
73
74 \begin{verbatim}
75 apt-get install postgresql-8.3
76 \end{verbatim}
77
78 To use the Emacs mode, you must have a modern Emacs installed. We assume that you already know how to do this, if you're in the business of looking for an Emacs mode. The demo generation facility of the compiler will also call out to Emacs to syntax-highlight code, and that process depends on the \texttt{htmlize} module, which can be installed in Debian testing via:
79
80 \begin{verbatim}
81 apt-get install emacs-goodies-el
82 \end{verbatim}
83
84 Even with the right packages installed, configuration and building might fail to work. After you run \texttt{./configure}, you will see the values of some named environment variables printed. You may need to adjust these values to get proper installation for your system. To change a value, store your preferred alternative in the corresponding UNIX environment variable, before running \texttt{./configure}. For instance, here is how to change the list of extra arguments that the Ur/Web compiler will pass to GCC on every invocation.
85
86 \begin{verbatim}
87 GCCARGS=-fnested-functions ./configure
88 \end{verbatim}
89
90 Some OSX users have reported needing to use this particular GCCARGS value.
91
92 The Emacs mode can be set to autoload by adding the following to your \texttt{.emacs} file.
93
94 \begin{verbatim}
95 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/urweb-mode")
96 (load "urweb-mode-startup")
97 \end{verbatim}
98
99 Change the path in the first line if you chose a different Emacs installation path during configuration.
100
46 101
47 \section{Ur Syntax} 102 \section{Ur Syntax}
48 103
49 In this section, we describe the syntax of Ur, deferring to a later section discussion of most of the syntax specific to SQL and XML. The sole exceptions are the declaration forms for tables, sequences, and cookies. 104 In this section, we describe the syntax of Ur, deferring to a later section discussion of most of the syntax specific to SQL and XML. The sole exceptions are the declaration forms for tables, sequences, and cookies.
50 105