| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
:orphan: |
| 4 |
|
| 5 |
.. warning:: |
| 6 |
Building with GNU Autotools is deprecated, you should build with CMake: :doc:`/install/cmake` |
| 7 |
|
| 8 |
Others |
| 9 |
====== |
| 10 |
|
| 11 |
This section describes how to install Groonga from source on UNIX like |
| 12 |
environment. |
| 13 |
|
| 14 |
To get more detail about installing Groonga from source on the |
| 15 |
specific environment, find the document for the specific environment |
| 16 |
from :doc:`/install`. |
| 17 |
|
| 18 |
Dependencies |
| 19 |
------------ |
| 20 |
|
| 21 |
Groonga doesn't require any special libraries but requires some tools |
| 22 |
for build. |
| 23 |
|
| 24 |
Tools |
| 25 |
^^^^^ |
| 26 |
|
| 27 |
Here are required tools: |
| 28 |
|
| 29 |
* ``wget``, ``curl`` or Web browser for downloading source archive |
| 30 |
* ``tar`` and ``gzip`` for extracting source archive |
| 31 |
* shell |
| 32 |
(many shells such as ``dash``, ``bash`` and ``zsh`` will work) |
| 33 |
* C compiler and C++ compiler |
| 34 |
(``gcc`` and ``g++`` are supported but other compilers may work) |
| 35 |
* ``make`` (GNU make is supported but other make like BSD make will work) |
| 36 |
|
| 37 |
You must get them ready. |
| 38 |
|
| 39 |
You can use `CMake <http://www.cmake.org/>`_ instead of shell but this |
| 40 |
document doesn't describe about building with CMake. |
| 41 |
|
| 42 |
Here are optional tools: |
| 43 |
|
| 44 |
* `pkg-config |
| 45 |
<http://www.freedesktop.org/wiki/Software/pkg-config>`_ for |
| 46 |
detecting libraries |
| 47 |
* `sudo <http://www.gratisoft.us/sudo/>`_ for installing built |
| 48 |
Groonga |
| 49 |
|
| 50 |
You must get them ready if you want to use optional libraries. |
| 51 |
|
| 52 |
Libraries |
| 53 |
^^^^^^^^^ |
| 54 |
|
| 55 |
All libraries are optional. Here are optional libraries: |
| 56 |
|
| 57 |
* `MeCab <https://taku910.github.io/mecab/>`_ for tokenizing full-text |
| 58 |
search target document by morphological analysis |
| 59 |
* `KyTea <http://www.phontron.com/kytea/>`_ for tokenizing full-text |
| 60 |
search target document by morphological analysis |
| 61 |
* `ZeroMQ <http://www.zeromq.org/>`_ for :doc:`/reference/suggest` |
| 62 |
* `libevent <http://libevent.org/>`_ for :doc:`/reference/suggest` |
| 63 |
* `MessagePack <http://msgpack.org/>`_ for supporting MessagePack |
| 64 |
output and :doc:`/reference/suggest` |
| 65 |
* `libedit <http://www.thrysoee.dk/editline/>`_ for command line |
| 66 |
editing in :doc:`/reference/executables/groonga` |
| 67 |
* `zlib <http://zlib.net/>`_ for compressing column value |
| 68 |
* `LZ4 <https://lz4.github.io/lz4/>`_ for compressing |
| 69 |
column value |
| 70 |
* `Zstandard <https://facebook.github.io/zstd/>`_ for compressing |
| 71 |
column value |
| 72 |
|
| 73 |
If you want to use those all or some libraries, you need to install |
| 74 |
them before installing Groonga. |
| 75 |
|
| 76 |
Build from source |
| 77 |
----------------- |
| 78 |
|
| 79 |
Groonga uses GNU build system. So the following is the simplest build |
| 80 |
steps:: |
| 81 |
|
| 82 |
% wget https://packages.groonga.org/source/groonga/groonga-latest.tar.gz |
| 83 |
% tar xvf groonga-latest.tar.gz |
| 84 |
% cd groonga-* |
| 85 |
% ./configure |
| 86 |
% make |
| 87 |
% sudo make install |
| 88 |
|
| 89 |
After the above steps, :doc:`/reference/executables/groonga` is found in |
| 90 |
``/usr/local/bin/groonga``. |
| 91 |
|
| 92 |
The default build will work well but you can customize Groonga at |
| 93 |
``configure`` step. |
| 94 |
|
| 95 |
The following describes details about each step. |
| 96 |
|
| 97 |
.. _source-configure: |
| 98 |
|
| 99 |
``configure`` |
| 100 |
^^^^^^^^^^^^^ |
| 101 |
|
| 102 |
First, you need to run ``configure``. Here are important ``configure`` |
| 103 |
options: |
| 104 |
|
| 105 |
``--prefix=PATH`` |
| 106 |
+++++++++++++++++ |
| 107 |
|
| 108 |
Specifies the install base directory. Groonga related files are |
| 109 |
installed under ``${PATH}/`` directory. |
| 110 |
|
| 111 |
The default is ``/usr/local``. In this case, :doc:`/reference/executables/groonga` is |
| 112 |
installed into ``/usr/local/bin/groonga``. |
| 113 |
|
| 114 |
Here is an example that installs Groonga into ``~/local`` for an user |
| 115 |
use instead of system wide use:: |
| 116 |
|
| 117 |
% ./configure --prefix=$HOME/local |
| 118 |
|
| 119 |
``--localstatedir=PATH`` |
| 120 |
++++++++++++++++++++++++ |
| 121 |
|
| 122 |
Specifies the base directory to place modifiable file such as log |
| 123 |
file, PID file and database files. For example, log file is placed at |
| 124 |
``${PATH}/log/groonga.log``. |
| 125 |
|
| 126 |
The default is ``/usr/local/var``. |
| 127 |
|
| 128 |
Here is an example that system wide ``/var`` is used for modifiable |
| 129 |
files:: |
| 130 |
|
| 131 |
% ./configure --localstatedir=/var |
| 132 |
|
| 133 |
``--with-log-path=PATH`` |
| 134 |
++++++++++++++++++++++++ |
| 135 |
|
| 136 |
Specifies the default log file path. You can override the default log |
| 137 |
path is :doc:`/reference/executables/groonga` command's ``--log-path`` |
| 138 |
command line option. So this option is not critical build option. It's |
| 139 |
just for convenient. |
| 140 |
|
| 141 |
The default is ``/usr/local/var/log/groonga.log``. The |
| 142 |
``/usr/local/var`` part is changed by ``--localstatedir`` option. |
| 143 |
|
| 144 |
Here is an example that log file is placed into shared NFS directory |
| 145 |
``/nfs/log/groonga.log``:: |
| 146 |
|
| 147 |
% ./configure --with-log-path=/nfs/log/groonga.log |
| 148 |
|
| 149 |
``--with-default-encoding=ENCODING`` |
| 150 |
++++++++++++++++++++++++++++++++++++ |
| 151 |
|
| 152 |
Specifies the default encoding. Available encodings are ``euc_jp``, |
| 153 |
``sjis``, ``utf8``, ``latin1``, ``koi8r`` and ``none``. |
| 154 |
|
| 155 |
The default is ``utf8``. |
| 156 |
|
| 157 |
Here is an example that Shift_JIS is used as the default encoding:: |
| 158 |
|
| 159 |
% ./configure --with-default-encoding=sjis |
| 160 |
|
| 161 |
.. _install-configure-with-match-escalation-threshold: |
| 162 |
|
| 163 |
``--with-match-escalation-threshold=NUMBER`` |
| 164 |
++++++++++++++++++++++++++++++++++++++++++++ |
| 165 |
|
| 166 |
Specifies the default match escalation threshold. See |
| 167 |
:ref:`select-match-escalation-threshold` about match |
| 168 |
escalation threshold. -1 means that match operation never escalate. |
| 169 |
|
| 170 |
The default is 0. |
| 171 |
|
| 172 |
Here is an example that match escalation isn't used by default:: |
| 173 |
|
| 174 |
% ./configure --with-match-escalation-threshold=-1 |
| 175 |
|
| 176 |
``--with-zlib`` |
| 177 |
+++++++++++++++ |
| 178 |
|
| 179 |
Enables column value compression by zlib. |
| 180 |
|
| 181 |
The default is disabled. |
| 182 |
|
| 183 |
Here is an example that enables column value compression by zlib:: |
| 184 |
|
| 185 |
% ./configure --with-zlib |
| 186 |
|
| 187 |
``--with-lz4`` |
| 188 |
++++++++++++++ |
| 189 |
|
| 190 |
Enables column value compression by LZ4. |
| 191 |
|
| 192 |
The default is disabled. |
| 193 |
|
| 194 |
Here is an example that enables column value compression by LZ4:: |
| 195 |
|
| 196 |
% ./configure --with-lz4 |
| 197 |
|
| 198 |
``--with-message-pack=MESSAGE_PACK_INSTALL_PREFIX`` |
| 199 |
+++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 200 |
|
| 201 |
Specifies where MessagePack is installed. If MessagePack isn't |
| 202 |
installed with ``--prefix=/usr``, you need to specify this option with |
| 203 |
path that you use for building MessagePack. |
| 204 |
|
| 205 |
If you installed MessagePack with ``--prefix=$HOME/local`` option, you |
| 206 |
should specify ``--with-message-pack=$HOME/local`` to Groonga's |
| 207 |
``configure``. |
| 208 |
|
| 209 |
The default is ``/usr``. |
| 210 |
|
| 211 |
Here is an example that uses MessagePack built with |
| 212 |
``--prefix=$HOME/local`` option:: |
| 213 |
|
| 214 |
% ./configure --with-message-pack=$HOME/local |
| 215 |
|
| 216 |
``--with-munin-plugins`` |
| 217 |
++++++++++++++++++++++++ |
| 218 |
|
| 219 |
Installs Munin plugins for Groonga. They are installed into |
| 220 |
``${PREFIX}/share/groonga/munin/plugins/``. |
| 221 |
|
| 222 |
Those plugins are not installed by default. |
| 223 |
|
| 224 |
Here is an example that installs Munin plugins for Groonga:: |
| 225 |
|
| 226 |
% ./configure --with-munin-plugins |
| 227 |
|
| 228 |
``--with-package-platform=PLATFORM`` |
| 229 |
++++++++++++++++++++++++++++++++++++ |
| 230 |
|
| 231 |
Installs platform specific system management files such as init script. |
| 232 |
Only Red Hat and Red Hat clone distributions such as AlmaLinux are supported. |
| 233 |
|
| 234 |
Those system management files are not installed by default. |
| 235 |
|
| 236 |
Here is an example that installs Red Hat or Red Hat clone distributions specific system management files:: |
| 237 |
|
| 238 |
% ./configure --with-package-platform=rhel |
| 239 |
|
| 240 |
``--help`` |
| 241 |
++++++++++ |
| 242 |
|
| 243 |
Shows all ``configure`` options. |
| 244 |
|
| 245 |
``--enable-apache-arrow`` and ``--disable-apache-arrow`` |
| 246 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 247 |
|
| 248 |
Enables or disables Apache Arrow support. |
| 249 |
|
| 250 |
In addition to using Apache Arrow IPC streaming format output, you can also use |
| 251 |
multithreading processing that is used in :ref:`select-n-workers` and |
| 252 |
:doc:`/reference/functions/query_parallel_or` with the Apache Arrow support. |
| 253 |
|
| 254 |
In case of not specifing ``--enable-apache-arrow`` nor ``--disable-apache-arrow``, the Apache Arrow support is enabled if Apache Arrow |
| 255 |
is installed on the system, otherwise disabled. This default behaviour is same as to specify ``--enable-apache-arrow=auto``. |
| 256 |
|
| 257 |
When you specify ``--enable-apache-arrow`` explicitly, you must install Apache |
| 258 |
Arrow on the system beforehand. |
| 259 |
|
| 260 |
You can install Apache Arrow following to `the official installation procedure <https://arrow.apache.org/install/>`_. |
| 261 |
Groonga requires ``libarrow-dev`` on a Debian based system or ``arrow-devel`` on a Red Hat Enterprise Linux based system. |
| 262 |
|
| 263 |
When you specify ``--disable-apache-arrow`` explicitly, Groonga disables the Apache Arrow |
| 264 |
support even if Apache Arrow is installed on the system. |
| 265 |
|
| 266 |
Here is an example how to enable the Apache Arrow support explicitly. |
| 267 |
|
| 268 |
.. code-block:: console |
| 269 |
|
| 270 |
% ./configure --enable-apache-arrow |
| 271 |
|
| 272 |
.. note:: |
| 273 |
|
| 274 |
If you install Apache Arrow into a non-standard directory, you need to specify the :ref:`install-others-configure-pkg-config-path` option. |
| 275 |
|
| 276 |
.. _install-others-configure-pkg-config-path: |
| 277 |
|
| 278 |
``PKG_CONFIG_PATH=PATHS`` |
| 279 |
+++++++++++++++++++++++++ |
| 280 |
|
| 281 |
Adds search paths of ``.pc`` files for ``pkg-config``. |
| 282 |
|
| 283 |
You can specify multiple paths using ``:`` to separating. |
| 284 |
|
| 285 |
Groonga uses ``pkg-config`` to find external libraries. |
| 286 |
|
| 287 |
``pkg-config`` is a tool that collects flags and paths required for using |
| 288 |
external libraries from ``.pc`` files. |
| 289 |
|
| 290 |
When using libraries installed via a package manager, you do not need |
| 291 |
to specify this parameter because ``.pc`` files for the libraries are in |
| 292 |
the default search paths of ``pkg-config``. |
| 293 |
|
| 294 |
When using manual built libraries, you need to specify ``.pc`` file paths |
| 295 |
of those libraries by this parameter. |
| 296 |
|
| 297 |
You can use ``PKG_CONFIG_PATH`` as an environment variable, but we recommend |
| 298 |
to use it as a ``configure`` parameter because of the following reason. |
| 299 |
|
| 300 |
``configure`` is generated from ``configure.ac`` by GNU Autotools. And when |
| 301 |
``make`` detects that ``configure.ac`` has changed, GNU Autotools automatically |
| 302 |
regenerates ``configure`` and re-executes it. If you specify ``PKG_CONFIG_PATH`` |
| 303 |
as a ``configure`` parameter, ``PKG_CONFIG_PATH`` is specified automatically |
| 304 |
when ``configure`` is re-executed. On the other hand, if you specify ``PKG_CONFIG_PATH`` |
| 305 |
as an environment variable, ``PKG_CONFIG_PATH`` is not specified automatically. |
| 306 |
|
| 307 |
Here is an example how to specify a ``.pc`` file path for |
| 308 |
``/tmp/local/lib/pkgconfig/arrow.pc``. |
| 309 |
|
| 310 |
.. code-block:: console |
| 311 |
|
| 312 |
% ./configure PKG_CONFIG_PATH=/tmp/local/lib/pkgconfig/ |
| 313 |
|
| 314 |
``make`` |
| 315 |
^^^^^^^^ |
| 316 |
|
| 317 |
``configure`` is succeeded, you can build Groonga by ``make``:: |
| 318 |
|
| 319 |
% make |
| 320 |
|
| 321 |
If you have multi cores CPU, you can make faster by using ``-j`` |
| 322 |
option. If you have 4 cores CPU, it's good for using ``-j4`` option:: |
| 323 |
|
| 324 |
% make -j4 |
| 325 |
|
| 326 |
If you get some errors by ``make``, please report them to us: |
| 327 |
:doc:`/contribution/report` |
| 328 |
|
| 329 |
``make install`` |
| 330 |
^^^^^^^^^^^^^^^^ |
| 331 |
|
| 332 |
Now, you can install built Groonga!:: |
| 333 |
|
| 334 |
% sudo make install |
| 335 |
|
| 336 |
If you have write permission for ``${PREFIX}``, you don't need to use |
| 337 |
``sudo``. e.g. ``--prefix=$HOME/local`` case. In this case, use ``make |
| 338 |
install``:: |
| 339 |
|
| 340 |
% make install |