| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
|---|
| 2 | <HTML> |
|---|
| 3 | <HEAD> |
|---|
| 4 | <TITLE>Xapian: Installation</TITLE> |
|---|
| 5 | </HEAD> |
|---|
| 6 | <BODY BGCOLOR="white" TEXT="black"> |
|---|
| 7 | |
|---|
| 8 | <h1>Installing Xapian</h1> |
|---|
| 9 | |
|---|
| 10 | <h2>Introduction</h2> |
|---|
| 11 | |
|---|
| 12 | <p> |
|---|
| 13 | This document is intended to give a quick guide to how to install Xapian. |
|---|
| 14 | You can find more detailed instructions in the <code>INSTALL</code> file |
|---|
| 15 | which is in top level directory of each source tree. |
|---|
| 16 | </p> |
|---|
| 17 | |
|---|
| 18 | <p> |
|---|
| 19 | Xapian can be built on UNIX systems (including MacOS X), and also Microsoft |
|---|
| 20 | Windows systems using GCC with mingw or cygwin, or MSVC. |
|---|
| 21 | </p> |
|---|
| 22 | |
|---|
| 23 | <h2>Packaged binary versions</h2> |
|---|
| 24 | |
|---|
| 25 | <p> |
|---|
| 26 | Pre-built Xapian packages are available for a number of platforms, including |
|---|
| 27 | most of the popular Linux distributions and BSD variants, and also Cygwin and |
|---|
| 28 | MSVC. If you are using such a platform, you'll probably find it easiest to use |
|---|
| 29 | pre-built packages - it saves having to compile by hand and you'll generally |
|---|
| 30 | get updates automatically. |
|---|
| 31 | </p> |
|---|
| 32 | |
|---|
| 33 | <p> |
|---|
| 34 | There are some links on our |
|---|
| 35 | <a href="http://xapian.org/download.php">download page</a> but it's likely |
|---|
| 36 | that Xapian packages are available for platforms we aren't aware of. Feel |
|---|
| 37 | free to let us know and we'll add a link. |
|---|
| 38 | </p> |
|---|
| 39 | |
|---|
| 40 | <p> |
|---|
| 41 | In some cases, the version packaged may be rather old, in which case you can |
|---|
| 42 | either request the packager to update, or build from source. If you find we're |
|---|
| 43 | linking to a package which isn't being updated, please let us know so we can |
|---|
| 44 | remove the link. |
|---|
| 45 | </p> |
|---|
| 46 | |
|---|
| 47 | <h2>Installing from Source</h2> |
|---|
| 48 | |
|---|
| 49 | <h3>Download</h3> |
|---|
| 50 | |
|---|
| 51 | <p> |
|---|
| 52 | The first step is to obtain a copy of the software from the |
|---|
| 53 | <a href="http://xapian.org/download.php">Xapian download page</a>. |
|---|
| 54 | </p> |
|---|
| 55 | |
|---|
| 56 | <h3>Unpacking</h3> |
|---|
| 57 | |
|---|
| 58 | <p> |
|---|
| 59 | Use the usual tools to unpack the archives. For example, on a Linux system: |
|---|
| 60 | </p> |
|---|
| 61 | <blockquote><code> |
|---|
| 62 | tar zxvf xapian-core-<i><versionnumber></i>.tar.gz<br> |
|---|
| 63 | tar zxvf xapian-omega-<i><versionnumber></i>.tar.gz |
|---|
| 64 | tar zxvf xapian-bindings-<i><versionnumber></i>.tar.gz |
|---|
| 65 | </code></blockquote> |
|---|
| 66 | <p> |
|---|
| 67 | These commands should unpack the archives into separate subdirectories |
|---|
| 68 | (<code>xapian-core-<i><versionnumber></i></code>, |
|---|
| 69 | <code>xapian-omega-<i><versionnumber></i></code> and |
|---|
| 70 | <code>xapian-bindings-<i><versionnumber></i></code> and |
|---|
| 71 | ). |
|---|
| 72 | </p> |
|---|
| 73 | |
|---|
| 74 | <h3>Configuring and building the Xapian library</h3> |
|---|
| 75 | |
|---|
| 76 | <p> |
|---|
| 77 | For full details of the different options available when configuring and |
|---|
| 78 | building, read the file "INSTALL" in the top level directory of your newly |
|---|
| 79 | unpacked source tree. But in many cases, the following quick summary is |
|---|
| 80 | all you need to know. |
|---|
| 81 | </p> |
|---|
| 82 | |
|---|
| 83 | <p> |
|---|
| 84 | Building for MSVC is currently handled using a separately maintained set of |
|---|
| 85 | makefiles - you can find a link to these on the |
|---|
| 86 | <a href="http://xapian.org/download.php">Xapian download page</a>. |
|---|
| 87 | </p> |
|---|
| 88 | |
|---|
| 89 | <p> |
|---|
| 90 | Each directory contains a <code>configure</code> script which checks various |
|---|
| 91 | features of your system. Assuming this runs successfully, you can then run |
|---|
| 92 | <code>make</code> to build the software, and <code>make install</code> to |
|---|
| 93 | actually install it. By default, the software installs under |
|---|
| 94 | <code>/usr/local</code>, but you can change this by passing |
|---|
| 95 | <code>--prefix=<i>/path/to/install</i></code> to <code>configure</code>. |
|---|
| 96 | So for example, you might use the following series of commands to build and |
|---|
| 97 | install xapian-core under <code>/opt</code>: |
|---|
| 98 | </p> |
|---|
| 99 | |
|---|
| 100 | <blockquote><code> |
|---|
| 101 | cd xapian-core-<i><version></i><br> |
|---|
| 102 | ./configure --prefix=/opt<br> |
|---|
| 103 | make<br> |
|---|
| 104 | sudo make install |
|---|
| 105 | </code></blockquote> |
|---|
| 106 | |
|---|
| 107 | <p> |
|---|
| 108 | If you don't have root access to install Xapian, you can specify a prefix |
|---|
| 109 | in your home directory, for example: |
|---|
| 110 | </p> |
|---|
| 111 | |
|---|
| 112 | <blockquote><code> |
|---|
| 113 | ./configure --prefix=/home/jenny/xapian-install |
|---|
| 114 | </code></blockquote> |
|---|
| 115 | |
|---|
| 116 | <h3>Configuring and building Omega</h3> |
|---|
| 117 | |
|---|
| 118 | <p> |
|---|
| 119 | Omega can be built in almost exactly the same way as the core library. |
|---|
| 120 | Omega's <code>configure</code> script will try to locate your Xapian |
|---|
| 121 | installation by looking for the <code>xapian-config</code> script, which |
|---|
| 122 | is installed as <code><i><prefix></i>/bin/xapian-config</code>. |
|---|
| 123 | If <code><i><prefix></i>/bin/xapian-config</code> isn't on your |
|---|
| 124 | <code>PATH</code>, or you have multiple installations of Xapian (perhaps a |
|---|
| 125 | debug and non-debug build, or two different versions), you can specify |
|---|
| 126 | a <code>xapian-config</code> to use by passing <code>XAPIAN_CONFIG</code> |
|---|
| 127 | on the configure command line, as shown below: |
|---|
| 128 | </p> |
|---|
| 129 | |
|---|
| 130 | <blockquote><code> |
|---|
| 131 | cd xapian-omega-<i><version></i><br> |
|---|
| 132 | ./configure --prefix=/opt XAPIAN_CONFIG=/opt/bin/xapian-config<br> |
|---|
| 133 | make<br> |
|---|
| 134 | sudo make install |
|---|
| 135 | </code></blockquote> |
|---|
| 136 | |
|---|
| 137 | <p> |
|---|
| 138 | Note that we use GNU libtool, which will set the runtime library search path if |
|---|
| 139 | your Xapian installation isn't in the dynamic linker search path, so there's |
|---|
| 140 | no need to mess around with setting <code>LD_LIBRARY_PATH</code>. |
|---|
| 141 | </p> |
|---|
| 142 | |
|---|
| 143 | <h3>Configuring and building Xapian-bindings</h3> |
|---|
| 144 | |
|---|
| 145 | <p> |
|---|
| 146 | Xapian-bindings is built much like Omega. One thing to be aware of is that |
|---|
| 147 | by default we install the built bindings where they need to go to work without |
|---|
| 148 | further intervention, so they may get installed under <code>/usr</code> even |
|---|
| 149 | if the prefix is elsewhere. See the <code>INSTALL</code> file for |
|---|
| 150 | xapian-bindings for details of how you can override this, and what steps |
|---|
| 151 | you'll need to take to run scripts which use the bindings if you do. |
|---|
| 152 | </p> |
|---|
| 153 | |
|---|
| 154 | <h3>Building from SVN</h3> |
|---|
| 155 | |
|---|
| 156 | If you wish to help develop Xapian, read |
|---|
| 157 | <A HREF="http://xapian.org/bleeding.php">how to build from the Xapian |
|---|
| 158 | subversion repository</A>. |
|---|
| 159 | |
|---|
| 160 | <!-- FOOTER $Author$ $Date$ $Id$ --> |
|---|
| 161 | </BODY> |
|---|
| 162 | </HTML> |
|---|