next up previous contents
Next: Command-Line Compiler Up: The Ur/Web Manual Previous: Introduction   Contents


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.

sudo make install

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 (or an alternate C compiler) in your execution path; MLton, the whole-program optimizing compiler for Standard ML; and the development files for the OpenSSL C library. As of this writing, in the ``testing'' version of Debian Linux, this command will install the more uncommon of these dependencies:

apt-get install mlton libssl-dev

Note that, like the Ur/Web compiler, MLton is a whole-program optimizing compiler, so it frequently requires much more memory than old-fashioned compilers do. Expect building Ur/Web with MLton to require not much less than a gigabyte of RAM. If a mlton invocation ends suspiciously, the most likely explanation is that it has exhausted available memory.

To build programs that access SQL databases, you also need one of these client libraries for supported backends.

apt-get install libpq-dev libmysqlclient-dev libsqlite3-dev

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:

apt-get install smlnj libsmlnj-smlnj ml-yacc ml-lpt

To begin an interactive session with the Ur compiler modules, run make smlnj, and then, from within an sml session, run CM.make "src/";. The Compiler module is the main entry point, and you can find its signature in src/compiler.sig.

To run an SQL-backed application with a backend besides SQLite, you will probably want to install one of these servers.

apt-get install postgresql mysql-server

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 htmlize module, which can be installed in Debian testing via:

apt-get install emacs-goodies-el

If you don't want to install the Emacs mode, run ./configure with the argument -without-emacs.

Even with the right packages installed, configuration and building might fail to work. After you run ./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 ./configure. For instance, here is how to change the list of extra arguments that the Ur/Web compiler will pass to the C compiler and linker on every invocation. Some older GCC versions need this setting to mask a bug in function inlining.

CCARGS=-fno-inline ./configure

Since the author is still getting a handle on the GNU Autotools that provide the build system, you may need to do some further work to get started, especially in environments with significant differences from Linux (where most testing is done). The variables PGHEADER, MSHEADER, and SQHEADER may be used to set the proper C header files to include for the development libraries of PostgreSQL, MySQL, and SQLite, respectively. To get libpq to link, one OS X user reported setting CCARGS="-I/opt/local/include -L/opt/local/lib/postgresql84", after creating a symbolic link with ln -s /opt/local/include/postgresql84 /opt/local/include/postgresql.

The Emacs mode can be set to autoload by adding the following to your .emacs file.

(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/urweb-mode")
(load "urweb-mode-startup")

Change the path in the first line if you chose a different Emacs installation path during configuration.

next up previous contents
Next: Command-Line Compiler Up: The Ur/Web Manual Previous: Introduction   Contents