]> begriffs open source - ai-pg/blob - full-docs/html/install-meson.html
Include latest toc output
[ai-pg] / full-docs / html / install-meson.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>17.4. Building and Installation with Meson</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="install-make.html" title="17.3. Building and Installation with Autoconf and Make" /><link rel="next" href="install-post.html" title="17.5. Post-Installation Setup" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">17.4. Building and Installation with Meson</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="install-make.html" title="17.3. Building and Installation with Autoconf and Make">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="installation.html" title="Chapter 17. Installation from Source Code">Up</a></td><th width="60%" align="center">Chapter 17. Installation from Source Code</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="install-post.html" title="17.5. Post-Installation Setup">Next</a></td></tr></table><hr /></div><div class="sect1" id="INSTALL-MESON"><div class="titlepage"><div><div><h2 class="title" style="clear: both">17.4. Building and Installation with Meson <a href="#INSTALL-MESON" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="install-meson.html#INSTALL-SHORT-MESON">17.4.1. Short Version</a></span></dt><dt><span class="sect2"><a href="install-meson.html#INSTALL-PROCEDURE-MESON">17.4.2. Installation Procedure</a></span></dt><dt><span class="sect2"><a href="install-meson.html#MESON-OPTIONS">17.4.3. <code class="literal">meson setup</code> Options</a></span></dt><dt><span class="sect2"><a href="install-meson.html#TARGETS-MESON">17.4.4. <code class="literal">meson</code> Build Targets</a></span></dt></dl></div><div class="sect2" id="INSTALL-SHORT-MESON"><div class="titlepage"><div><div><h3 class="title">17.4.1. Short Version <a href="#INSTALL-SHORT-MESON" class="id_link">#</a></h3></div></div></div><p>
3 </p><pre class="synopsis">
4 meson setup build --prefix=/usr/local/pgsql
5 cd build
6 ninja
7 su
8 ninja install
9 adduser postgres
10 mkdir -p /usr/local/pgsql/data
11 chown postgres /usr/local/pgsql/data
12 su - postgres
13 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
14 /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
15 /usr/local/pgsql/bin/createdb test
16 /usr/local/pgsql/bin/psql test
17 </pre><p>
18    The long version is the rest of this
19    <span class="phrase">section</span>.
20   </p></div><div class="sect2" id="INSTALL-PROCEDURE-MESON"><div class="titlepage"><div><div><h3 class="title">17.4.2. Installation Procedure <a href="#INSTALL-PROCEDURE-MESON" class="id_link">#</a></h3></div></div></div><div class="procedure"><ol class="procedure" type="1"><li class="step" id="MESON-CONFIGURE"><p class="title"><strong>Configuration</strong></p><p>
21     The first step of the installation procedure is to configure the
22     build tree for your system and choose the options you would like. To
23     create and configure the build directory, you can start with the
24     <code class="literal">meson setup</code> command.
25 </p><pre class="screen">
26 <strong class="userinput"><code>meson setup build</code></strong>
27 </pre><p>
28     The setup command takes a <code class="literal">builddir</code> and a <code class="literal">srcdir</code>
29     argument. If no <code class="literal">srcdir</code> is given, Meson will deduce the
30     <code class="literal">srcdir</code> based on the current directory and the location
31     of <code class="literal">meson.build</code>. The <code class="literal">builddir</code> is mandatory.
32    </p><p>
33     Running <code class="literal">meson setup</code> loads the build configuration file and sets up the build directory.
34     Additionally, you can also pass several build options to Meson. Some commonly
35     used options are mentioned in the subsequent sections. For example:
36
37 </p><pre class="screen">
38 # configure with a different installation prefix
39 meson setup build --prefix=/home/user/pg-install
40
41 # configure to generate a debug build
42 meson setup build --buildtype=debug
43
44 # configure to build with OpenSSL support
45 meson setup build -Dssl=openssl
46 </pre><p>
47    </p><p>
48     Setting up the build directory is a one-time step. To reconfigure before a
49     new build, you can simply use the <code class="literal">meson configure</code> command
50 </p><pre class="screen">
51 meson configure -Dcassert=true
52 </pre><p>
53     <code class="command">meson configure</code>'s commonly used command-line options
54     are explained in <a class="xref" href="install-meson.html#MESON-OPTIONS" title="17.4.3. meson setup Options">Section 17.4.3</a>.
55    </p></li><li class="step" id="MESON-BUILD"><p class="title"><strong>Build</strong></p><p>
56     By default, <span class="productname">Meson</span> uses the <a class="ulink" href="https://ninja-build.org/" target="_top">Ninja</a> build tool.  To build
57     <span class="productname">PostgreSQL</span> from source using Meson, you can
58     simply use the <code class="literal">ninja</code> command in the build directory.
59 </p><pre class="screen">
60 ninja
61 </pre><p>
62     Ninja will automatically detect the number of CPUs in your computer and
63     parallelize itself accordingly. You can override the number of parallel
64     processes used with the command line argument <code class="literal">-j</code>.
65    </p><p>
66     It should be noted that after the initial configure step,
67     <code class="command">ninja</code> is the only command you ever need to type to
68     compile. No matter how you alter your source tree (short of moving it to a
69     completely new location), Meson will detect the changes and regenerate
70     itself accordingly. This is especially handy if you have multiple build
71     directories. Often one of them is used for development (the "debug" build)
72     and others only every now and then (such as a "static analysis" build).
73     Any configuration can be built just by cd'ing to the corresponding
74     directory and running Ninja.
75    </p><p>
76     If you'd like to build with a backend other than ninja, you can use
77     configure with the <code class="option">--backend</code> option to select the one you
78     want to use and then build using <code class="literal">meson compile</code>. To
79     learn more about these backends and other arguments you can provide to
80     ninja, you can refer to the <a class="ulink" href="https://mesonbuild.com/Running-Meson.html#building-from-the-source" target="_top">
81     Meson documentation</a>.
82    </p></li><li class="step"><p class="title"><strong>Regression Tests</strong></p><a id="id-1.6.4.7.3.2.3.2" class="indexterm"></a><p>
83     If you want to test the newly built server before you install it,
84     you can run the regression tests at this point. The regression
85     tests are a test suite to verify that <span class="productname">PostgreSQL</span>
86     runs on your machine in the way the developers expected it
87     to. Type:
88 </p><pre class="screen">
89 <strong class="userinput"><code>meson test</code></strong>
90 </pre><p>
91     (This won't work as root; do it as an unprivileged user.)
92     See <a class="xref" href="regress.html" title="Chapter 31. Regression Tests">Chapter 31</a> for
93     detailed information about interpreting the test results. You can
94     repeat this test at any later time by issuing the same command.
95    </p><p>
96     To run pg_regress and pg_isolation_regress tests against a running
97     postgres instance, specify <strong class="userinput"><code>--setup running</code></strong> as an
98     argument to <strong class="userinput"><code>meson test</code></strong>.
99    </p></li><li class="step" id="MESON-INSTALL"><p class="title"><strong>Installing the Files</strong></p><div class="note"><h3 class="title">Note</h3><p>
100      If you are upgrading an existing system be sure to read
101      <a class="xref" href="upgrading.html" title="18.6. Upgrading a PostgreSQL Cluster">Section 18.6</a>,
102      which has instructions about upgrading a
103      cluster.
104     </p></div><p>
105     Once PostgreSQL is built, you can install it by simply running the
106     <code class="literal">ninja install</code> command.
107 </p><pre class="screen">
108 ninja install
109 </pre><p>
110    </p><p>
111     This will install files into the directories that were specified
112     in <a class="xref" href="install-meson.html#MESON-CONFIGURE" title="Configuration">Step 1</a>. Make sure that you have appropriate
113     permissions to write into that area. You might need to do this
114     step as root. Alternatively, you can create the target directories
115     in advance and arrange for appropriate permissions to be granted.
116     The standard installation provides all the header files needed for client
117     application development as well as for server-side program
118     development, such as custom functions or data types written in C.
119    </p><p>
120     <code class="literal">ninja install</code> should work for most cases, but if you'd
121     like to use more options (such as <code class="option">--quiet</code> to suppress
122     extra output), you could also use <code class="literal">meson install</code>
123     instead. You can learn more about <a class="ulink" href="https://mesonbuild.com/Commands.html#install" target="_top">meson install</a>
124     and its options in the Meson documentation.
125    </p></li></ol></div><p><strong>Uninstallation: </strong>
126     To undo the installation, you can use the <code class="command">ninja
127     uninstall</code> command.
128    </p><p><strong>Cleaning: </strong>
129     After the installation, you can free disk space by removing the built
130     files from the source tree with the <code class="command">ninja clean</code>
131     command.
132    </p></div><div class="sect2" id="MESON-OPTIONS"><div class="titlepage"><div><div><h3 class="title">17.4.3. <code class="literal">meson setup</code> Options <a href="#MESON-OPTIONS" class="id_link">#</a></h3></div></div></div><p>
133     <code class="command">meson setup</code>'s command-line options are explained below.
134     This list is not exhaustive (use <code class="literal">meson configure --help</code>
135     to get one that is).  The options not covered here are meant for advanced
136     use-cases, and are documented in the standard <a class="ulink" href="https://mesonbuild.com/Commands.html#configure" target="_top">Meson
137     documentation</a>.  These arguments can be used with <code class="command">meson
138     setup</code> as well.
139    </p><div class="sect3" id="MESON-OPTIONS-LOCATIONS"><div class="titlepage"><div><div><h4 class="title">17.4.3.1. Installation Locations <a href="#MESON-OPTIONS-LOCATIONS" class="id_link">#</a></h4></div></div></div><p>
140       These options control where <code class="literal">ninja install</code> (or <code class="literal">meson install</code>) will put
141       the files.  The <code class="option">--prefix</code> option (example
142       <a class="xref" href="install-meson.html#INSTALL-SHORT-MESON" title="17.4.1. Short Version">Section 17.4.1</a>) is sufficient for
143       most cases.  If you have special needs, you can customize the
144       installation subdirectories with the other options described in this
145       section.  Beware however that changing the relative locations of the
146       different subdirectories may render the installation non-relocatable,
147       meaning you won't be able to move it after installation.
148       (The <code class="literal">man</code> and <code class="literal">doc</code> locations are
149       not affected by this restriction.)  For relocatable installs, you
150       might want to use the <code class="literal">-Drpath=false</code> option
151       described later.
152      </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-PREFIX-MESON"><span class="term"><code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em></code></span> <a href="#CONFIGURE-PREFIX-MESON" class="id_link">#</a></dt><dd><p>
153          Install all files under the directory <em class="replaceable"><code>PREFIX</code></em>
154          instead of <code class="filename">/usr/local/pgsql</code> (on Unix based systems) or
155          <code class="filename"><em class="replaceable"><code>current drive letter</code></em>:/usr/local/pgsql</code> (on Windows).
156          The actual files will be installed into various subdirectories; no files
157          will ever be installed directly into the
158          <em class="replaceable"><code>PREFIX</code></em> directory.
159         </p></dd><dt id="CONFIGURE-BINDIR-MESON"><span class="term"><code class="option">--bindir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-BINDIR-MESON" class="id_link">#</a></dt><dd><p>
160          Specifies the directory for executable programs. The default
161          is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/bin</code>.
162         </p></dd><dt id="CONFIGURE-SYSCONFDIR-MESON"><span class="term"><code class="option">--sysconfdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-SYSCONFDIR-MESON" class="id_link">#</a></dt><dd><p>
163          Sets the directory for various configuration files,
164          <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/etc</code> by default.
165         </p></dd><dt id="CONFIGURE-LIBDIR-MESON"><span class="term"><code class="option">--libdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-LIBDIR-MESON" class="id_link">#</a></dt><dd><p>
166          Sets the location to install libraries and dynamically loadable
167          modules. The default is
168          <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/lib</code>.
169         </p></dd><dt id="CONFIGURE-INCLUDEDIR-MESON"><span class="term"><code class="option">--includedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-INCLUDEDIR-MESON" class="id_link">#</a></dt><dd><p>
170          Sets the directory for installing C and C++ header files. The
171          default is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/include</code>.
172         </p></dd><dt id="CONFIGURE-DATADIR-MESON"><span class="term"><code class="option">--datadir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-DATADIR-MESON" class="id_link">#</a></dt><dd><p>
173          Sets the directory for read-only data files used by the
174          installed programs. The default is
175          <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/share</code>. Note that this has
176          nothing to do with where your database files will be placed.
177         </p></dd><dt id="CONFIGURE-LOCALEDIR-MESON"><span class="term"><code class="option">--localedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-LOCALEDIR-MESON" class="id_link">#</a></dt><dd><p>
178          Sets the directory for installing locale data, in particular
179          message translation catalog files.  The default is
180          <code class="filename"><em class="replaceable"><code>DATADIR</code></em>/locale</code>.
181         </p></dd><dt id="CONFIGURE-MANDIR-MESON"><span class="term"><code class="option">--mandir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-MANDIR-MESON" class="id_link">#</a></dt><dd><p>
182          The man pages that come with <span class="productname">PostgreSQL</span> will be installed under
183          this directory, in their respective
184          <code class="filename">man<em class="replaceable"><code>x</code></em></code> subdirectories.
185          The default is <code class="filename"><em class="replaceable"><code>DATADIR</code></em>/man</code>.
186         </p></dd></dl></div><div class="note"><h3 class="title">Note</h3><p>
187        Care has been taken to make it possible to install
188        <span class="productname">PostgreSQL</span> into shared installation locations
189        (such as <code class="filename">/usr/local/include</code>) without
190        interfering with the namespace of the rest of the system. First,
191        the string <span class="quote">“<span class="quote"><code class="literal">/postgresql</code></span>”</span> is
192        automatically appended to <code class="varname">datadir</code>,
193        <code class="varname">sysconfdir</code>, and <code class="varname">docdir</code>,
194        unless the fully expanded directory name already contains the
195        string <span class="quote">“<span class="quote"><code class="literal">postgres</code></span>”</span> or
196        <span class="quote">“<span class="quote"><code class="literal">pgsql</code></span>”</span>. For example, if you choose
197        <code class="filename">/usr/local</code> as prefix, the documentation will
198        be installed in <code class="filename">/usr/local/doc/postgresql</code>,
199        but if the prefix is <code class="filename">/opt/postgres</code>, then it
200        will be in <code class="filename">/opt/postgres/doc</code>. The public C
201        header files of the client interfaces are installed into
202        <code class="varname">includedir</code> and are namespace-clean. The
203        internal header files and the server header files are installed
204        into private directories under <code class="varname">includedir</code>. See
205        the documentation of each interface for information about how to
206        access its header files. Finally, a private subdirectory will
207        also be created, if appropriate, under <code class="varname">libdir</code>
208        for dynamically loadable modules.
209       </p></div></div><div class="sect3" id="MESON-OPTIONS-FEATURES"><div class="titlepage"><div><div><h4 class="title">17.4.3.2. <span class="productname">PostgreSQL</span> Features <a href="#MESON-OPTIONS-FEATURES" class="id_link">#</a></h4></div></div></div><p>
210      The options described in this section enable building of
211      various optional <span class="productname">PostgreSQL</span> features.
212      Most of these require additional software, as described in
213      <a class="xref" href="install-requirements.html" title="17.1. Requirements">Section 17.1</a>, and will be automatically enabled if the
214      required software is found. You can change this behavior by manually
215      setting these features to <code class="literal">enabled</code> to require them
216      or <code class="literal">disabled</code> to not build with them.
217     </p><p>
218      To specify PostgreSQL-specific options, the name of the option
219      must be prefixed by <code class="literal">-D</code>.
220     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-WITH-NLS-MESON"><span class="term"><code class="option">-Dnls={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-NLS-MESON" class="id_link">#</a></dt><dd><p>
221         Enables or disables Native Language Support (<acronym class="acronym">NLS</acronym>),
222         that is, the ability to display a program's messages in a language
223         other than English.  Defaults to auto and will be enabled
224         automatically if an implementation of the <span class="application">Gettext
225         API</span> is found.
226        </p></dd><dt id="CONFIGURE-WITH-PLPERL-MESON"><span class="term"><code class="option">-Dplperl={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-PLPERL-MESON" class="id_link">#</a></dt><dd><p>
227         Build the <span class="application">PL/Perl</span> server-side language.
228         Defaults to auto.
229        </p></dd><dt id="CONFIGURE-WITH-PLPYTHON-MESON"><span class="term"><code class="option">-Dplpython={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-PLPYTHON-MESON" class="id_link">#</a></dt><dd><p>
230         Build the <span class="application">PL/Python</span> server-side language.
231         Defaults to auto.
232        </p></dd><dt id="CONFIGURE-WITH-PLTCL-MESON"><span class="term"><code class="option">-Dpltcl={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-PLTCL-MESON" class="id_link">#</a></dt><dd><p>
233         Build the <span class="application">PL/Tcl</span> server-side language.
234         Defaults to auto.
235        </p></dd><dt id="CONFIGURE-WITH-TCL-VERSION-MESON"><span class="term"><code class="option">-Dtcl_version=<em class="replaceable"><code>TCL_VERSION</code></em></code></span> <a href="#CONFIGURE-WITH-TCL-VERSION-MESON" class="id_link">#</a></dt><dd><p>
236         Specifies the Tcl version to use when building PL/Tcl.
237        </p></dd><dt id="CONFIGURE-WITH-ICU-MESON"><span class="term"><code class="option">-Dicu={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-ICU-MESON" class="id_link">#</a></dt><dd><p>
238         Build with support for the
239         <span class="productname">ICU</span><a id="id-1.6.4.7.4.4.4.6.2.1.2" class="indexterm"></a>
240         library, enabling use of ICU collation features (see <a class="xref" href="collation.html" title="23.2. Collation Support">Section 23.2</a>).  Defaults to auto and requires the
241         <span class="productname">ICU4C</span> package to be installed.  The minimum
242         required version of <span class="productname">ICU4C</span> is currently 4.2.
243        </p></dd><dt id="CONFIGURE-WITH-LLVM-MESON"><span class="term"><code class="option">-Dllvm={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LLVM-MESON" class="id_link">#</a></dt><dd><p>
244         Build with support for <span class="productname">LLVM</span> based
245         <acronym class="acronym">JIT</acronym> compilation (see <a class="xref" href="jit.html" title="Chapter 30. Just-in-Time Compilation (JIT)">Chapter 30</a>).
246         This requires the <span class="productname">LLVM</span> library to be
247         installed.  The minimum required version of
248         <span class="productname">LLVM</span> is currently 14.  Disabled by
249         default.
250        </p><p>
251         <code class="command">llvm-config</code><a id="id-1.6.4.7.4.4.4.7.2.2.2" class="indexterm"></a>
252         will be used to find the required compilation options.
253         <code class="command">llvm-config</code>, and then
254         <code class="command">llvm-config-$version</code> for all supported versions,
255         will be searched for in your <code class="envar">PATH</code>.  If that would not
256         yield the desired program, use <code class="envar">LLVM_CONFIG</code> to specify a
257         path to the correct <code class="command">llvm-config</code>.
258        </p></dd><dt id="CONFIGURE-WITH-LZ4-MESON"><span class="term"><code class="option">-Dlz4={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LZ4-MESON" class="id_link">#</a></dt><dd><p>
259         Build with <span class="productname">LZ4</span> compression support.
260         Defaults to auto.
261        </p></dd><dt id="CONFIGURE-WITH-ZSTD-MESON"><span class="term"><code class="option">-Dzstd={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-ZSTD-MESON" class="id_link">#</a></dt><dd><p>
262         Build with <span class="productname">Zstandard</span> compression support.
263         Defaults to auto.
264        </p></dd><dt id="CONFIGURE-WITH-SSL-MESON"><span class="term"><code class="option">-Dssl={ auto | <em class="replaceable"><code>LIBRARY</code></em> }</code>
265       <a id="id-1.6.4.7.4.4.4.10.1.2" class="indexterm"></a>
266       </span> <a href="#CONFIGURE-WITH-SSL-MESON" class="id_link">#</a></dt><dd><p>
267         Build with support for <acronym class="acronym">SSL</acronym> (encrypted) connections.
268         The only <em class="replaceable"><code>LIBRARY</code></em> supported is
269         <code class="option">openssl</code>. This requires the
270         <span class="productname">OpenSSL</span> package to be installed.  Building
271         with this will check for the required header files and libraries to
272         make sure that your <span class="productname">OpenSSL</span> installation is
273         sufficient before proceeding.  The default for this option is auto.
274        </p></dd><dt id="CONFIGURE-WITH-GSSAPI-MESON"><span class="term"><code class="option">-Dgssapi={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-GSSAPI-MESON" class="id_link">#</a></dt><dd><p>
275         Build with support for GSSAPI authentication. MIT Kerberos is required
276         to be installed for GSSAPI.  On many systems, the GSSAPI system (a part
277         of the MIT Kerberos installation) is not installed in a location
278         that is searched by default (e.g., <code class="filename">/usr/include</code>,
279         <code class="filename">/usr/lib</code>).  In
280         those cases, PostgreSQL will query <code class="command">pkg-config</code> to
281         detect the required compiler and linker options.  Defaults to auto.
282         <code class="filename">meson configure</code> will check for the required
283         header files and libraries to make sure that your GSSAPI installation
284         is sufficient before proceeding.
285        </p></dd><dt id="CONFIGURE-WITH-LDAP-MESON"><span class="term"><code class="option">-Dldap={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LDAP-MESON" class="id_link">#</a></dt><dd><p>
286         Build with
287         <acronym class="acronym">LDAP</acronym><a id="id-1.6.4.7.4.4.4.12.2.1.2" class="indexterm"></a>
288         support for authentication and connection parameter lookup (see
289         <span id="INSTALL-LDAP-LINKS-MESON" class="phrase"><a class="xref" href="libpq-ldap.html" title="32.18. LDAP Lookup of Connection Parameters">Section 32.18</a> and
290         <a class="xref" href="auth-ldap.html" title="20.10. LDAP Authentication">Section 20.10</a></span> for more information).  On Unix,
291         this requires the <span class="productname">OpenLDAP</span> package to be
292         installed. On Windows, the default <span class="productname">WinLDAP</span>
293         library is used.  Defaults to auto.  <code class="filename">meson
294         configure</code> will check for the required header files and
295         libraries to make sure that your <span class="productname">OpenLDAP</span>
296         installation is sufficient before proceeding.
297        </p></dd><dt id="CONFIGURE-WITH-PAM-MESON"><span class="term"><code class="option">-Dpam={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-PAM-MESON" class="id_link">#</a></dt><dd><p>
298         Build with
299         <acronym class="acronym">PAM</acronym><a id="id-1.6.4.7.4.4.4.13.2.1.2" class="indexterm"></a>
300         (Pluggable Authentication Modules) support.  Defaults to auto.
301        </p></dd><dt id="CONFIGURE-WITH-BSD-AUTH-MESON"><span class="term"><code class="option">-Dbsd_auth={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-BSD-AUTH-MESON" class="id_link">#</a></dt><dd><p>
302         Build with BSD Authentication support.  (The BSD Authentication
303         framework is currently only available on OpenBSD.)  Defaults to auto.
304        </p></dd><dt id="CONFIGURE-WITH-SYSTEMD-MESON"><span class="term"><code class="option">-Dsystemd={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-SYSTEMD-MESON" class="id_link">#</a></dt><dd><p>
305         Build with support for
306         <span class="application">systemd</span><a id="id-1.6.4.7.4.4.4.15.2.1.2" class="indexterm"></a>
307         service notifications.  This improves integration if the server is
308         started under <span class="application">systemd</span> but has no impact
309         otherwise; see <a class="xref" href="server-start.html" title="18.3. Starting the Database Server">Section 18.3</a> for more information.  Defaults to
310         auto.  <span class="application">libsystemd</span> and the associated header
311         files need to be installed to use this option.
312        </p></dd><dt id="CONFIGURE-WITH-BONJOUR-MESON"><span class="term"><code class="option">-Dbonjour={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-BONJOUR-MESON" class="id_link">#</a></dt><dd><p>
313         Build with support for Bonjour automatic service discovery.  Defaults
314         to auto and requires Bonjour support in your operating system.
315         Recommended on macOS.
316        </p></dd><dt id="CONFIGURE-WITH-UUID-MESON"><span class="term"><code class="option">-Duuid=<em class="replaceable"><code>LIBRARY</code></em></code></span> <a href="#CONFIGURE-WITH-UUID-MESON" class="id_link">#</a></dt><dd><p>
317         Build the <a class="xref" href="uuid-ossp.html" title="F.49. uuid-ossp — a UUID generator">uuid-ossp</a> module
318         (which provides functions to generate UUIDs), using the specified
319         UUID library.<a id="id-1.6.4.7.4.4.4.17.2.1.2" class="indexterm"></a>
320         <em class="replaceable"><code>LIBRARY</code></em> must be one of:
321        </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
322           <code class="option">none</code> to not build the uuid module. This is the default.
323          </p></li><li class="listitem"><p>
324           <code class="option">bsd</code> to use the UUID functions found in FreeBSD,
325           and some other BSD-derived systems
326          </p></li><li class="listitem"><p>
327           <code class="option">e2fs</code> to use the UUID library created by
328           the <code class="literal">e2fsprogs</code> project; this library is present in most
329           Linux systems and in macOS, and can be obtained for other
330           platforms as well
331          </p></li><li class="listitem"><p>
332           <code class="option">ossp</code> to use the <a class="ulink" href="http://www.ossp.org/pkg/lib/uuid/" target="_top">OSSP UUID library</a>
333          </p></li></ul></div></dd><dt id="CONFIGURE-WITH-LIBCURL-MESON"><span class="term"><code class="option">-Dlibcurl={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LIBCURL-MESON" class="id_link">#</a></dt><dd><p>
334         Build with libcurl support for OAuth 2.0 client flows.
335         Libcurl version 7.61.0 or later is required for this feature.
336         Building with this will check for the required header files
337         and libraries to make sure that your <span class="productname">Curl</span>
338         installation is sufficient before proceeding. The default for this
339         option is auto.
340        </p></dd><dt id="CONFIGURE-WITH-LIBURING-MESON"><span class="term"><code class="option">-Dliburing={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LIBURING-MESON" class="id_link">#</a></dt><dd><p>
341         Build with liburing, enabling io_uring support for asynchronous I/O.
342         Defaults to auto.
343        </p><p>
344         To use a liburing installation that is in an unusual location, you
345         can set <code class="command">pkg-config</code>-related environment
346         variables (see its documentation).
347        </p></dd><dt id="CONFIGURE-WITH-LIBNUMA-MESON"><span class="term"><code class="option">-Dlibnuma={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LIBNUMA-MESON" class="id_link">#</a></dt><dd><p>
348         Build with libnuma support for basic NUMA support.
349         Only supported on platforms for which the <span class="productname">libnuma</span>
350         library is implemented. The default for this option is auto.
351        </p></dd><dt id="CONFIGURE-WITH-LIBXML-MESON"><span class="term"><code class="option">-Dlibxml={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LIBXML-MESON" class="id_link">#</a></dt><dd><p>
352         Build with libxml2, enabling SQL/XML support.  Defaults to
353         auto. Libxml2 version 2.6.23 or later is required for this feature.
354        </p><p>
355         To use a libxml2 installation that is in an unusual location, you
356         can set <code class="command">pkg-config</code>-related environment
357         variables (see its documentation).
358        </p></dd><dt id="CONFIGURE-WITH-LIBXSLT-MESON"><span class="term"><code class="option">-Dlibxslt={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-LIBXSLT-MESON" class="id_link">#</a></dt><dd><p>
359         Build with libxslt, enabling the
360         <a class="xref" href="xml2.html" title="F.50. xml2 — XPath querying and XSLT functionality">xml2</a>
361         module to perform XSL transformations of XML.
362         <code class="option">-Dlibxml</code> must be specified as well.  Defaults to
363         auto.
364        </p></dd><dt id="CONFIGURE-WITH-SEPGSQL-MESON"><span class="term"><code class="option">-Dselinux={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-WITH-SEPGSQL-MESON" class="id_link">#</a></dt><dd><p>
365         Build with SElinux support, enabling the <a class="xref" href="sepgsql.html" title="F.40. sepgsql — SELinux-, label-based mandatory access control (MAC) security module">sepgsql</a>
366         extension.  Defaults to auto.
367        </p></dd></dl></div></div><div class="sect3" id="MESON-OPTIONS-ANTI-FEATURES"><div class="titlepage"><div><div><h4 class="title">17.4.3.3. Anti-Features <a href="#MESON-OPTIONS-ANTI-FEATURES" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-READLINE-MESON"><span class="term"><code class="option">-Dreadline={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-READLINE-MESON" class="id_link">#</a></dt><dd><p>
368         Allows use of the <span class="application">Readline</span> library (and
369         <span class="application">libedit</span> as well).  This option defaults to
370         auto and enables command-line editing and history in
371         <span class="application">psql</span> and is strongly recommended.
372        </p></dd><dt id="CONFIGURE-LIBEDIT-PREFERRED-MESON"><span class="term"><code class="option">-Dlibedit_preferred={ true | false }</code></span> <a href="#CONFIGURE-LIBEDIT-PREFERRED-MESON" class="id_link">#</a></dt><dd><p>
373         Setting this to true favors the use of the BSD-licensed
374         <span class="application">libedit</span> library rather than GPL-licensed
375         <span class="application">Readline</span>.  This option is significant only
376         if you have both libraries installed; the default is false, that is to
377         use <span class="application">Readline</span>.
378        </p></dd><dt id="CONFIGURE-ZLIB-MESON"><span class="term"><code class="option">-Dzlib={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-ZLIB-MESON" class="id_link">#</a></dt><dd><p>
379         <a id="id-1.6.4.7.4.5.2.3.2.1.1" class="indexterm"></a>
380         Enables use of the <span class="application">Zlib</span> library.
381         It defaults to auto and enables
382         support for compressed archives in <span class="application">pg_dump</span>,
383         <span class="application">pg_restore</span> and <span class="application">pg_basebackup</span> and is recommended.
384        </p></dd></dl></div></div><div class="sect3" id="MESON-OPTIONS-BUILD-PROCESS"><div class="titlepage"><div><div><h4 class="title">17.4.3.4. Build Process Details <a href="#MESON-OPTIONS-BUILD-PROCESS" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-AUTO-FEATURES-MESON"><span class="term"><code class="option">--auto-features={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-AUTO-FEATURES-MESON" class="id_link">#</a></dt><dd><p>
385         Setting this option allows you to override the value of all
386         <span class="quote">“<span class="quote">auto</span>”</span> features (features that are enabled automatically
387         if the required software is found).  This can be useful when you want
388         to disable or enable all the <span class="quote">“<span class="quote">optional</span>”</span> features at once
389         without having to set each of them manually. The default value for
390         this parameter is auto.
391        </p></dd><dt id="CONFIGURE-BACKEND-MESON"><span class="term"><code class="option">--backend=<em class="replaceable"><code>BACKEND</code></em></code></span> <a href="#CONFIGURE-BACKEND-MESON" class="id_link">#</a></dt><dd><p>
392         The default backend Meson uses is ninja and that should suffice for
393         most use cases.  However, if you'd like to fully integrate with Visual
394         Studio, you can set the <em class="replaceable"><code>BACKEND</code></em> to
395         <code class="literal">vs</code>.
396        </p></dd><dt id="CONFIGURE-C-ARGS-MESON"><span class="term"><code class="option">-Dc_args=<em class="replaceable"><code>OPTIONS</code></em></code></span> <a href="#CONFIGURE-C-ARGS-MESON" class="id_link">#</a></dt><dd><p>
397         This option can be used to pass extra options to the C compiler.
398        </p></dd><dt id="CONFIGURE-C-LINK-ARGS-MESON"><span class="term"><code class="option">-Dc_link_args=<em class="replaceable"><code>OPTIONS</code></em></code></span> <a href="#CONFIGURE-C-LINK-ARGS-MESON" class="id_link">#</a></dt><dd><p>
399         This option can be used to pass extra options to the C linker.
400        </p></dd><dt id="CONFIGURE-EXTRA-INCLUDE-DIRS-MESON"><span class="term"><code class="option">-Dextra_include_dirs=<em class="replaceable"><code>DIRECTORIES</code></em></code></span> <a href="#CONFIGURE-EXTRA-INCLUDE-DIRS-MESON" class="id_link">#</a></dt><dd><p>
401         <em class="replaceable"><code>DIRECTORIES</code></em> is a comma-separated list of
402         directories that will be added to the list the compiler searches for
403         header files. If you have optional packages (such as GNU
404         <span class="application">Readline</span>) installed in a non-standard
405         location, you have to use this option and probably also the
406         corresponding <code class="option">-Dextra_lib_dirs</code> option.
407        </p><p>
408         Example: <code class="literal">-Dextra_include_dirs=/opt/gnu/include,/usr/sup/include</code>.
409        </p></dd><dt id="CONFIGURE-EXTRA-LIB-DIRS-MESON"><span class="term"><code class="option">-Dextra_lib_dirs=<em class="replaceable"><code>DIRECTORIES</code></em></code></span> <a href="#CONFIGURE-EXTRA-LIB-DIRS-MESON" class="id_link">#</a></dt><dd><p>
410         <em class="replaceable"><code>DIRECTORIES</code></em> is a comma-separated list of
411         directories to search for libraries. You will probably have to use
412         this option (and the corresponding
413         <code class="option">-Dextra_include_dirs</code> option) if you have packages
414         installed in non-standard locations.
415        </p><p>
416         Example: <code class="literal">-Dextra_lib_dirs=/opt/gnu/lib,/usr/sup/lib</code>.
417        </p></dd><dt id="CONFIGURE-SYSTEM-TZDATA-MESON"><span class="term"><code class="option">-Dsystem_tzdata=<em class="replaceable"><code>DIRECTORY</code></em></code>
418       <a id="id-1.6.4.7.4.6.2.7.1.2" class="indexterm"></a>
419       </span> <a href="#CONFIGURE-SYSTEM-TZDATA-MESON" class="id_link">#</a></dt><dd><p>
420         <span class="productname">PostgreSQL</span> includes its own time zone
421         database, which it requires for date and time operations.  This time
422         zone database is in fact compatible with the IANA time zone database
423         provided by many operating systems such as FreeBSD, Linux, and
424         Solaris, so it would be redundant to install it again.  When this
425         option is used, the system-supplied time zone database in
426         <em class="replaceable"><code>DIRECTORY</code></em> is used instead of the one
427         included in the PostgreSQL source distribution.
428         <em class="replaceable"><code>DIRECTORY</code></em> must be specified as an absolute
429         path.  <code class="filename">/usr/share/zoneinfo</code> is a likely directory
430         on some operating systems.  Note that the installation routine will
431         not detect mismatching or erroneous time zone data.  If you use this
432         option, you are advised to run the regression tests to verify that the
433         time zone data you have pointed to works correctly with
434         <span class="productname">PostgreSQL</span>.
435        </p><a id="id-1.6.4.7.4.6.2.7.2.2" class="indexterm"></a><p>
436         This option is mainly aimed at binary package distributors who know
437         their target operating system well.  The main advantage of using this
438         option is that the PostgreSQL package won't need to be upgraded
439         whenever any of the many local daylight-saving time rules change.
440         Another advantage is that PostgreSQL can be cross-compiled more
441         straightforwardly if the time zone database files do not need to be
442         built during the installation.
443        </p></dd><dt id="CONFIGURE-EXTRA-VERSION-MESON"><span class="term"><code class="option">-Dextra_version=<em class="replaceable"><code>STRING</code></em></code></span> <a href="#CONFIGURE-EXTRA-VERSION-MESON" class="id_link">#</a></dt><dd><p>
444         Append <em class="replaceable"><code>STRING</code></em> to the PostgreSQL version
445         number.  You can use this, for example, to mark binaries built from
446         unreleased <span class="productname">Git</span> snapshots or containing
447         custom patches with an extra version string, such as a <code class="command">git
448         describe</code> identifier or a distribution package release
449         number.
450        </p></dd><dt id="CONFIGURE-RPATH-MESON"><span class="term"><code class="option">-Drpath={ true | false }</code></span> <a href="#CONFIGURE-RPATH-MESON" class="id_link">#</a></dt><dd><p>
451         This option is set to true by default.  If set to false,
452         do not mark <span class="productname">PostgreSQL</span>'s executables
453         to indicate that they should search for shared libraries in the
454         installation's library directory (see <code class="option">--libdir</code>).
455         On most platforms, this marking uses an absolute path to the
456         library directory, so that it will be unhelpful if you relocate
457         the installation later.  However, you will then need to provide
458         some other way for the executables to find the shared libraries.
459         Typically this requires configuring the operating system's
460         dynamic linker to search the library directory; see
461         <a class="xref" href="install-post.html#INSTALL-POST-SHLIBS" title="17.5.1. Shared Libraries">Section 17.5.1</a> for more detail.
462        </p></dd><dt id="CONFIGURE-BINARY-NAME-MESON"><span class="term"><code class="option">-D<em class="replaceable"><code>BINARY_NAME</code></em>=<em class="replaceable"><code>PATH</code></em></code></span> <a href="#CONFIGURE-BINARY-NAME-MESON" class="id_link">#</a></dt><dd><p>
463         If a program required to build PostgreSQL (with or without optional
464         flags) is stored at a non-standard path, you can specify it manually
465         to <code class="literal">meson configure</code>.  The complete list of programs
466         for which this is supported can be found by running <code class="literal">meson
467         configure</code>.  Example:
468 </p><pre class="programlisting">meson configure -DBISON=PATH_TO_BISON</pre><p>
469        </p></dd></dl></div></div><div class="sect3" id="MESON-OPTIONS-DOCS"><div class="titlepage"><div><div><h4 class="title">17.4.3.5. Documentation <a href="#MESON-OPTIONS-DOCS" class="id_link">#</a></h4></div></div></div><p>
470      See <a class="xref" href="docguide-toolsets.html" title="J.2. Tool Sets">Section J.2</a> for the tools needed for building
471      the documentation.
472     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-DOCS-MESON"><span class="term"><code class="option">-Ddocs={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-DOCS-MESON" class="id_link">#</a></dt><dd><p>
473         Enables building the documentation in <acronym class="acronym">HTML</acronym> and
474         <acronym class="acronym">man</acronym> format. It defaults to auto.
475        </p></dd><dt id="CONFIGURE-DOCS-PDF-MESON"><span class="term"><code class="option">-Ddocs_pdf={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-DOCS-PDF-MESON" class="id_link">#</a></dt><dd><p>
476         Enables building the documentation in <acronym class="acronym">PDF</acronym>
477         format. It defaults to auto.
478        </p></dd><dt id="CONFIGURE-DOCS-HTML-STYLE"><span class="term"><code class="option">-Ddocs_html_style={ simple | website }</code></span> <a href="#CONFIGURE-DOCS-HTML-STYLE" class="id_link">#</a></dt><dd><p>
479         Controls which <acronym class="acronym">CSS</acronym> stylesheet is used.  The default
480         is <code class="literal">simple</code>.  If set to <code class="literal">website</code>,
481         the HTML documentation will reference the stylesheet for <a class="ulink" href="https://www.postgresql.org/docs/current/" target="_top">postgresql.org</a>.
482        </p></dd></dl></div></div><div class="sect3" id="MESON-OPTIONS-MISC"><div class="titlepage"><div><div><h4 class="title">17.4.3.6. Miscellaneous <a href="#MESON-OPTIONS-MISC" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-PGPORT-MESON"><span class="term"><code class="option">-Dpgport=<em class="replaceable"><code>NUMBER</code></em></code></span> <a href="#CONFIGURE-PGPORT-MESON" class="id_link">#</a></dt><dd><p>
483         Set <em class="replaceable"><code>NUMBER</code></em> as the default port number for
484         server and clients. The default is 5432. The port can always
485         be changed later on, but if you specify it here then both
486         server and clients will have the same default compiled in,
487         which can be very convenient.  Usually the only good reason
488         to select a non-default value is if you intend to run multiple
489         <span class="productname">PostgreSQL</span> servers on the same machine.
490        </p></dd><dt id="CONFIGURE-KRB-SRVNAM-MESON"><span class="term"><code class="option">-Dkrb_srvnam=<em class="replaceable"><code>NAME</code></em></code></span> <a href="#CONFIGURE-KRB-SRVNAM-MESON" class="id_link">#</a></dt><dd><p>
491         The default name of the Kerberos service principal used
492         by GSSAPI.
493         <code class="literal">postgres</code> is the default. There's usually no
494         reason to change this unless you are building for a Windows
495         environment, in which case it must be set to upper case
496         <code class="literal">POSTGRES</code>.
497        </p></dd><dt id="CONFIGURE-SEGSIZE-MESON"><span class="term"><code class="option">-Dsegsize=<em class="replaceable"><code>SEGSIZE</code></em></code></span> <a href="#CONFIGURE-SEGSIZE-MESON" class="id_link">#</a></dt><dd><p>
498         Set the <em class="firstterm">segment size</em>, in gigabytes.  Large tables are
499         divided into multiple operating-system files, each of size equal
500         to the segment size.  This avoids problems with file size limits
501         that exist on many platforms.  The default segment size, 1 gigabyte,
502         is safe on all supported platforms.  If your operating system has
503         <span class="quote">“<span class="quote">largefile</span>”</span> support (which most do, nowadays), you can use
504         a larger segment size.  This can be helpful to reduce the number of
505         file descriptors consumed when working with very large tables.
506         But be careful not to select a value larger than is supported
507         by your platform and the file systems you intend to use.  Other
508         tools you might wish to use, such as <span class="application">tar</span>, could
509         also set limits on the usable file size.
510         It is recommended, though not absolutely required, that this value
511         be a power of 2.
512        </p></dd><dt id="CONFIGURE-BLOCKSIZE-MESON"><span class="term"><code class="option">-Dblocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span> <a href="#CONFIGURE-BLOCKSIZE-MESON" class="id_link">#</a></dt><dd><p>
513         Set the <em class="firstterm">block size</em>, in kilobytes.  This is the unit
514         of storage and I/O within tables.  The default, 8 kilobytes,
515         is suitable for most situations; but other values may be useful
516         in special cases.
517         The value must be a power of 2 between 1 and 32 (kilobytes).
518        </p></dd><dt id="CONFIGURE-WAL-BLOCKSIZE-MESON"><span class="term"><code class="option">-Dwal_blocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span> <a href="#CONFIGURE-WAL-BLOCKSIZE-MESON" class="id_link">#</a></dt><dd><p>
519         Set the <em class="firstterm">WAL block size</em>, in kilobytes.  This is the unit
520         of storage and I/O within the WAL log.  The default, 8 kilobytes,
521         is suitable for most situations; but other values may be useful
522         in special cases.
523         The value must be a power of 2 between 1 and 64 (kilobytes).
524        </p></dd></dl></div></div><div class="sect3" id="MESON-OPTIONS-DEVEL"><div class="titlepage"><div><div><h4 class="title">17.4.3.7. Developer Options <a href="#MESON-OPTIONS-DEVEL" class="id_link">#</a></h4></div></div></div><p>
525      Most of the options in this section are only of interest for
526      developing or debugging <span class="productname">PostgreSQL</span>.
527      They are not recommended for production builds, except
528      for <code class="option">--debug</code>, which can be useful to enable
529      detailed bug reports in the unlucky event that you encounter a bug.
530      On platforms supporting DTrace, <code class="option">-Ddtrace</code>
531      may also be reasonable to use in production.
532     </p><p>
533      When building an installation that will be used to develop code inside
534      the server, it is recommended to use at least the <code class="option">--buildtype=debug</code>
535      and <code class="option">-Dcassert</code> options.
536     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-BUILDTYPE-MESON"><span class="term"><code class="option">--buildtype=<em class="replaceable"><code>BUILDTYPE</code></em></code></span> <a href="#CONFIGURE-BUILDTYPE-MESON" class="id_link">#</a></dt><dd><p>
537         This option can be used to specify the buildtype to use; defaults to
538         <code class="option">debugoptimized</code>.  If you'd like finer control on the debug
539         symbols and optimization levels than what this option provides, you
540         can refer to the <code class="option">--debug</code> and
541         <code class="option">--optimization</code> flags.
542        </p><p>
543         The following build types are generally used: <code class="option">plain</code>,
544         <code class="option">debug</code>, <code class="option">debugoptimized</code> and
545         <code class="option">release</code>.  More information about them can be found in
546         the <a class="ulink" href="https://mesonbuild.com/Running-Meson.html#configuring-the-build-directory" target="_top">Meson
547         documentation</a>.
548        </p></dd><dt id="CONFIGURE-DEBUG-MESON"><span class="term"><code class="option">--debug</code></span> <a href="#CONFIGURE-DEBUG-MESON" class="id_link">#</a></dt><dd><p>
549         Compiles all programs and libraries with debugging symbols.  This
550         means that you can run the programs in a debugger to analyze
551         problems. This enlarges the size of the installed executables
552         considerably, and on non-GCC compilers it usually also disables
553         compiler optimization, causing slowdowns. However, having the symbols
554         available is extremely helpful for dealing with any problems that
555         might arise.  Currently, this option is recommended for production
556         installations only if you use GCC.  But you should always have it on
557         if you are doing development work or running a beta version.
558        </p></dd><dt id="CONFIGURE-OPTIMIZATION-MESON"><span class="term"><code class="option">--optimization</code>=<em class="replaceable"><code>LEVEL</code></em></span> <a href="#CONFIGURE-OPTIMIZATION-MESON" class="id_link">#</a></dt><dd><p>
559         Specify the optimization level. <code class="option">LEVEL</code> can be set to any of {0,g,1,2,3,s}.
560        </p></dd><dt id="CONFIGURE-WERROR-MESON"><span class="term"><code class="option">--werror</code></span> <a href="#CONFIGURE-WERROR-MESON" class="id_link">#</a></dt><dd><p>
561         Setting this option asks the compiler to treat warnings as
562         errors. This can be useful for code development.
563        </p></dd><dt id="CONFIGURE-CASSERT-MESON"><span class="term"><code class="option">-Dcassert={ true | false }</code></span> <a href="#CONFIGURE-CASSERT-MESON" class="id_link">#</a></dt><dd><p>
564         Enables <em class="firstterm">assertion</em> checks in the server, which
565         test for many <span class="quote">“<span class="quote">cannot happen</span>”</span> conditions.  This is
566         invaluable for code development purposes, but the tests slow down the
567         server significantly.  Also, having the tests turned on won't
568         necessarily enhance the stability of your server!  The assertion
569         checks are not categorized for severity, and so what might be a
570         relatively harmless bug will still lead to server restarts if it
571         triggers an assertion failure.  This option is not recommended for
572         production use, but you should have it on for development work or when
573         running a beta version.
574        </p></dd><dt id="CONFIGURE-TAP-TESTS-MESON"><span class="term"><code class="option">-Dtap_tests={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-TAP-TESTS-MESON" class="id_link">#</a></dt><dd><p>
575         Enable tests using the Perl TAP tools.  Defaults to auto and requires
576         a Perl installation and the Perl module <code class="literal">IPC::Run</code>.
577         See <a class="xref" href="regress-tap.html" title="31.4. TAP Tests">Section 31.4</a> for more information.
578        </p></dd><dt id="CONFIGURE-PG-TEST-EXTRA-MESON"><span class="term"><code class="option">-DPG_TEST_EXTRA=<em class="replaceable"><code>TEST_SUITES</code></em></code></span> <a href="#CONFIGURE-PG-TEST-EXTRA-MESON" class="id_link">#</a></dt><dd><p>
579         Enable additional test suites, which are not run by default because
580         they are not secure to run on a multiuser system, require special
581         software to run, or are resource intensive.  The argument is a
582         whitespace-separated list of tests to enable. See
583         <a class="xref" href="regress-run.html#REGRESS-ADDITIONAL" title="31.1.3. Additional Test Suites">Section 31.1.3</a> for details. If the
584         <code class="envar">PG_TEST_EXTRA</code> environment variable is set when the
585         tests are run, it overrides this setup-time option.
586        </p></dd><dt id="CONFIGURE-B-COVERAGE-MESON"><span class="term"><code class="option">-Db_coverage={ true | false }</code></span> <a href="#CONFIGURE-B-COVERAGE-MESON" class="id_link">#</a></dt><dd><p>
587         If using GCC, all programs and libraries are compiled with
588         code coverage testing instrumentation.  When run, they
589         generate files in the build directory with code coverage
590         metrics.
591         See <a class="xref" href="regress-coverage.html" title="31.5. Test Coverage Examination">Section 31.5</a>
592         for more information. This option is for use only with GCC
593         and when doing development work.
594        </p></dd><dt id="CONFIGURE-DTRACE-MESON"><span class="term"><code class="option">-Ddtrace={ auto | enabled | disabled }</code></span> <a href="#CONFIGURE-DTRACE-MESON" class="id_link">#</a></dt><dd><p>
595         <a id="id-1.6.4.7.4.9.4.9.2.1.1" class="indexterm"></a>
596         Enabling this compiles <span class="productname">PostgreSQL</span> with support for the
597         dynamic tracing tool DTrace.
598         See <a class="xref" href="dynamic-trace.html" title="27.5. Dynamic Tracing">Section 27.5</a> for more information.
599        </p><p>
600         To point to the <code class="command">dtrace</code> program, the
601         <code class="option">DTRACE</code> option can be set.  This
602         will often be necessary because <code class="command">dtrace</code> is
603         typically installed under <code class="filename">/usr/sbin</code>,
604         which might not be in your <code class="envar">PATH</code>.
605        </p></dd><dt id="CONFIGURE-INJECTION-POINTS-MESON"><span class="term"><code class="option">-Dinjection_points={ true | false }</code></span> <a href="#CONFIGURE-INJECTION-POINTS-MESON" class="id_link">#</a></dt><dd><p>
606         Compiles <span class="productname">PostgreSQL</span> with support for
607         injection points in the server. Injection points allow to run
608         user-defined code from within the server in pre-defined code paths.
609         This helps in testing and in the investigation of concurrency scenarios
610         in a controlled fashion. This option is disabled by default.  See
611         <a class="xref" href="xfunc-c.html#XFUNC-ADDIN-INJECTION-POINTS" title="36.10.14. Injection Points">Section 36.10.14</a> for more details.  This
612         option is intended to be used only by developers for testing.
613        </p></dd><dt id="CONFIGURE-SEGSIZE-BLOCKS-MESON"><span class="term"><code class="option">-Dsegsize_blocks=SEGSIZE_BLOCKS</code></span> <a href="#CONFIGURE-SEGSIZE-BLOCKS-MESON" class="id_link">#</a></dt><dd><p>
614          Specify the relation segment size in blocks. If both
615          <code class="option">-Dsegsize</code> and this option are specified, this option
616          wins.
617
618          This option is only for developers, to test segment related code.
619         </p></dd></dl></div></div></div><div class="sect2" id="TARGETS-MESON"><div class="titlepage"><div><div><h3 class="title">17.4.4. <code class="literal">meson</code> Build Targets <a href="#TARGETS-MESON" class="id_link">#</a></h3></div></div></div><p>
620     Individual build targets can be built using <code class="command">ninja</code> <em class="replaceable"><code>target</code></em>.
621
622     When no target is specified, everything except documentation is
623     built. Individual build products can be built using the path/filename as
624     <em class="replaceable"><code>target</code></em>.
625    </p><div class="sect3" id="TARGETS-MESON-CODE"><div class="titlepage"><div><div><h4 class="title">17.4.4.1. Code Targets <a href="#TARGETS-MESON-CODE" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="MESON-TARGET-ALL"><span class="term"><code class="option">all</code></span> <a href="#MESON-TARGET-ALL" class="id_link">#</a></dt><dd><p>
626       Build everything other than documentation
627      </p></dd><dt id="MESON-TARGET-BACKEND"><span class="term"><code class="option">backend</code></span> <a href="#MESON-TARGET-BACKEND" class="id_link">#</a></dt><dd><p>
628       Build backend and related modules
629      </p></dd><dt id="MESON-TARGET-BIN"><span class="term"><code class="option">bin</code></span> <a href="#MESON-TARGET-BIN" class="id_link">#</a></dt><dd><p>
630       Build frontend binaries
631      </p></dd><dt id="MESON-TARGET-CONTRIB"><span class="term"><code class="option">contrib</code></span> <a href="#MESON-TARGET-CONTRIB" class="id_link">#</a></dt><dd><p>
632       Build contrib modules
633      </p></dd><dt id="MESON-TARGET-PL"><span class="term"><code class="option">pl</code></span> <a href="#MESON-TARGET-PL" class="id_link">#</a></dt><dd><p>
634       Build procedural languages
635      </p></dd></dl></div></div><div class="sect3" id="TARGETS-MESON-DEVELOPER"><div class="titlepage"><div><div><h4 class="title">17.4.4.2. Developer Targets <a href="#TARGETS-MESON-DEVELOPER" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="MESON-TARGET-REFORMAT-DAT-FILES"><span class="term"><code class="option">reformat-dat-files</code></span> <a href="#MESON-TARGET-REFORMAT-DAT-FILES" class="id_link">#</a></dt><dd><p>
636       Rewrite catalog data files into standard format
637      </p></dd><dt id="MESON-TARGET-EXPAND-DAT-FILES"><span class="term"><code class="option">expand-dat-files</code></span> <a href="#MESON-TARGET-EXPAND-DAT-FILES" class="id_link">#</a></dt><dd><p>
638       Expand all data files to include defaults
639      </p></dd><dt id="MESON-TARGET-UPDATE-UNICODE"><span class="term"><code class="option">update-unicode</code></span> <a href="#MESON-TARGET-UPDATE-UNICODE" class="id_link">#</a></dt><dd><p>
640       Update unicode data to new version
641      </p></dd></dl></div></div><div class="sect3" id="TARGETS-MESON-DOCUMENTATION"><div class="titlepage"><div><div><h4 class="title">17.4.4.3. Documentation Targets <a href="#TARGETS-MESON-DOCUMENTATION" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="MESON-TARGET-HTML"><span class="term"><code class="option">html</code></span> <a href="#MESON-TARGET-HTML" class="id_link">#</a></dt><dd><p>
642       Build documentation in multi-page HTML format
643      </p></dd><dt id="MESON-TARGET-MAN"><span class="term"><code class="option">man</code></span> <a href="#MESON-TARGET-MAN" class="id_link">#</a></dt><dd><p>
644       Build documentation in man page format
645      </p></dd><dt id="MESON-TARGET-DOCS"><span class="term"><code class="option">docs</code></span> <a href="#MESON-TARGET-DOCS" class="id_link">#</a></dt><dd><p>
646       Build documentation in multi-page HTML and man page format
647      </p></dd><dt id="MESON-TARGET-DOC-SRC-SGML-POSTGRES-A4.PDF"><span class="term"><code class="option">doc/src/sgml/postgres-A4.pdf</code></span> <a href="#MESON-TARGET-DOC-SRC-SGML-POSTGRES-A4.PDF" class="id_link">#</a></dt><dd><p>
648       Build documentation in PDF format, with A4 pages
649      </p></dd><dt id="MESON-TARGET-DOC-SRC-SGML-POSTGRES-US.PDF"><span class="term"><code class="option">doc/src/sgml/postgres-US.pdf</code></span> <a href="#MESON-TARGET-DOC-SRC-SGML-POSTGRES-US.PDF" class="id_link">#</a></dt><dd><p>
650       Build documentation in PDF format, with US letter pages
651      </p></dd><dt id="MESON-TARGET-DOC-SRC-SGML-POSTGRES.HTML"><span class="term"><code class="option">doc/src/sgml/postgres.html</code></span> <a href="#MESON-TARGET-DOC-SRC-SGML-POSTGRES.HTML" class="id_link">#</a></dt><dd><p>
652       Build documentation in single-page HTML format
653      </p></dd><dt id="MESON-TARGET-ALLDOCS"><span class="term"><code class="option">alldocs</code></span> <a href="#MESON-TARGET-ALLDOCS" class="id_link">#</a></dt><dd><p>
654       Build documentation in all supported formats
655      </p></dd></dl></div></div><div class="sect3" id="TARGETS-MESON-INSTALLATION"><div class="titlepage"><div><div><h4 class="title">17.4.4.4. Installation Targets <a href="#TARGETS-MESON-INSTALLATION" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="MESON-TARGET-INSTALL"><span class="term"><code class="option">install</code></span> <a href="#MESON-TARGET-INSTALL" class="id_link">#</a></dt><dd><p>
656       Install postgres, excluding documentation
657      </p></dd><dt id="MESON-TARGET-INSTALL-DOCS"><span class="term"><code class="option">install-docs</code></span> <a href="#MESON-TARGET-INSTALL-DOCS" class="id_link">#</a></dt><dd><p>
658       Install documentation in multi-page HTML and man page formats
659      </p></dd><dt id="MESON-TARGET-INSTALL-HTML"><span class="term"><code class="option">install-html</code></span> <a href="#MESON-TARGET-INSTALL-HTML" class="id_link">#</a></dt><dd><p>
660       Install documentation in multi-page HTML format
661      </p></dd><dt id="MESON-TARGET-INSTALL-MAN"><span class="term"><code class="option">install-man</code></span> <a href="#MESON-TARGET-INSTALL-MAN" class="id_link">#</a></dt><dd><p>
662       Install documentation in man page format
663      </p></dd><dt id="MESON-TARGET-INSTALL-QUIET"><span class="term"><code class="option">install-quiet</code></span> <a href="#MESON-TARGET-INSTALL-QUIET" class="id_link">#</a></dt><dd><p>
664       Like "install", but installed files are not displayed
665      </p></dd><dt id="MESON-TARGET-INSTALL-WORLD"><span class="term"><code class="option">install-world</code></span> <a href="#MESON-TARGET-INSTALL-WORLD" class="id_link">#</a></dt><dd><p>
666       Install postgres, including multi-page HTML and man page documentation
667      </p></dd><dt id="MESON-TARGET-UNINSTALL"><span class="term"><code class="option">uninstall</code></span> <a href="#MESON-TARGET-UNINSTALL" class="id_link">#</a></dt><dd><p>
668       Remove installed files
669      </p></dd></dl></div></div><div class="sect3" id="TARGETS-MESON-OTHER"><div class="titlepage"><div><div><h4 class="title">17.4.4.5. Other Targets <a href="#TARGETS-MESON-OTHER" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="MESON-TARGET-CLEAN"><span class="term"><code class="option">clean</code></span> <a href="#MESON-TARGET-CLEAN" class="id_link">#</a></dt><dd><p>
670       Remove all build products
671      </p></dd><dt id="MESON-TARGET-TEST"><span class="term"><code class="option">test</code></span> <a href="#MESON-TARGET-TEST" class="id_link">#</a></dt><dd><p>
672       Run all enabled tests (including contrib)
673      </p></dd><dt id="MESON-TARGET-WORLD"><span class="term"><code class="option">world</code></span> <a href="#MESON-TARGET-WORLD" class="id_link">#</a></dt><dd><p>
674       Build everything, including documentation
675      </p></dd><dt id="MESON-TARGET-HELP"><span class="term"><code class="option">help</code></span> <a href="#MESON-TARGET-HELP" class="id_link">#</a></dt><dd><p>
676       List important targets
677      </p></dd></dl></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install-make.html" title="17.3. Building and Installation with Autoconf and Make">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="installation.html" title="Chapter 17. Installation from Source Code">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="install-post.html" title="17.5. Post-Installation Setup">Next</a></td></tr><tr><td width="40%" align="left" valign="top">17.3. Building and Installation with Autoconf and Make </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 17.5. Post-Installation Setup</td></tr></table></div></body></html>