<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Xapian: Installation</TITLE> </HEAD> <BODY BGCOLOR="white" TEXT="black"> <h1>Installing Xapian</h1> <h2>Introduction</h2> <p> This document is intended to give a quick guide to how to install Xapian. You can find more detailed instructions in the <code>INSTALL</code> file which is in top level directory of each source tree. </p> <p> Xapian can be built on UNIX systems (including MacOS X), and also Microsoft Windows systems using GCC with mingw or cygwin, or MSVC. </p> <h2>Packaged binary versions</h2> <p> Pre-built Xapian packages are available for a number of platforms, including most of the popular Linux distributions and BSD variants, and also Cygwin and MSVC. If you are using such a platform, you'll probably find it easiest to use pre-built packages - it saves having to compile by hand and you'll generally get updates automatically. </p> <p> There are some links on our <a href="http://xapian.org/download">download page</a> but it's likely that Xapian packages are available for platforms we aren't aware of. Feel free to let us know and we'll add a link. </p> <p> In some cases, the version packaged may be rather old, in which case you can either request the packager to update, or build from source. If you find we're linking to a package which isn't being updated, please let us know so we can remove the link. </p> <h2>Installing from Source</h2> <h3>Download</h3> <p> The first step is to obtain a copy of the software from the <a href="http://xapian.org/download">Xapian download page</a>. </p> <h3>Unpacking</h3> <p> Use the usual tools to unpack the archives. For example, on a Linux system: </p> <blockquote><code> tar zxvf xapian-core-<i><versionnumber></i>.tar.gz<br> tar zxvf xapian-omega-<i><versionnumber></i>.tar.gz tar zxvf xapian-bindings-<i><versionnumber></i>.tar.gz </code></blockquote> <p> These commands should unpack the archives into separate subdirectories (<code>xapian-core-<i><versionnumber></i></code>, <code>xapian-omega-<i><versionnumber></i></code> and <code>xapian-bindings-<i><versionnumber></i></code> and ). </p> <h3>Configuring and building the Xapian library</h3> <p> For full details of the different options available when configuring and building, read the file "INSTALL" in the top level directory of your newly unpacked source tree. But in many cases, the following quick summary is all you need to know. </p> <p> Building for MSVC is currently handled using a separately maintained set of makefiles - you can find a link to these on the <a href="http://xapian.org/download">Xapian download page</a>. </p> <p> Each directory contains a <code>configure</code> script which checks various features of your system. Assuming this runs successfully, you can then run <code>make</code> to build the software, and <code>make install</code> to actually install it. By default, the software installs under <code>/usr/local</code>, but you can change this by passing <code>--prefix=<i>/path/to/install</i></code> to <code>configure</code>. So for example, you might use the following series of commands to build and install xapian-core under <code>/opt</code>: </p> <blockquote><code> cd xapian-core-<i><version></i><br> ./configure --prefix=/opt<br> make<br> sudo make install </code></blockquote> <p> If you don't have root access to install Xapian, you can specify a prefix in your home directory, for example: </p> <blockquote><code> ./configure --prefix=/home/jenny/xapian-install </code></blockquote> <h3>Configuring and building Omega</h3> <p> Omega can be built in almost exactly the same way as the core library. Omega's <code>configure</code> script will try to locate your Xapian installation by looking for the <code>xapian-config</code> script, which is installed as <code><i><prefix></i>/bin/xapian-config</code>. If <code><i><prefix></i>/bin/xapian-config</code> isn't on your <code>PATH</code>, or you have multiple installations of Xapian (perhaps a debug and non-debug build, or two different versions), you can specify a <code>xapian-config</code> to use by passing <code>XAPIAN_CONFIG</code> on the configure command line, as shown below: </p> <blockquote><code> cd xapian-omega-<i><version></i><br> ./configure --prefix=/opt XAPIAN_CONFIG=/opt/bin/xapian-config<br> make<br> sudo make install </code></blockquote> <p> Note that we use GNU libtool, which will set the runtime library search path if your Xapian installation isn't in the dynamic linker search path, so there's no need to mess around with setting <code>LD_LIBRARY_PATH</code>. </p> <h3>Configuring and building Xapian-bindings</h3> <p> Xapian-bindings is built much like Omega. One thing to be aware of is that by default we install the built bindings where they need to go to work without further intervention, so they may get installed under <code>/usr</code> even if the prefix is elsewhere. See the <code>INSTALL</code> file for xapian-bindings for details of how you can override this, and what steps you'll need to take to run scripts which use the bindings if you do. </p> <h3>Building from SVN</h3> If you wish to help develop Xapian, read <A HREF="http://xapian.org/bleeding">how to build from the Xapian subversion repository</A>. <!-- FOOTER $Author: olly $ $Date: 2009-08-26 14:20:44 +0100 (Wed, 26 Aug 2009) $ $Id: install.html 13393 2009-08-26 13:20:44Z olly $ --> </BODY> </HTML>