]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/install-make.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / install-make.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.3. Building and Installation with Autoconf and Make</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-getsource.html" title="17.2. Getting the Source" /><link rel="next" href="install-meson.html" title="17.4. Building and Installation with Meson" /></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.3. Building and Installation with Autoconf and Make</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="install-getsource.html" title="17.2. Getting the Source">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-meson.html" title="17.4. Building and Installation with Meson">Next</a></td></tr></table><hr /></div><div class="sect1" id="INSTALL-MAKE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">17.3. Building and Installation with Autoconf and Make <a href="#INSTALL-MAKE" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="install-make.html#INSTALL-SHORT-MAKE">17.3.1. Short Version</a></span></dt><dt><span class="sect2"><a href="install-make.html#INSTALL-PROCEDURE-MAKE">17.3.2. Installation Procedure</a></span></dt><dt><span class="sect2"><a href="install-make.html#CONFIGURE-OPTIONS">17.3.3. <code class="filename">configure</code> Options</a></span></dt><dt><span class="sect2"><a href="install-make.html#CONFIGURE-ENVVARS">17.3.4. <code class="filename">configure</code> Environment Variables</a></span></dt></dl></div><div class="sect2" id="INSTALL-SHORT-MAKE"><div class="titlepage"><div><div><h3 class="title">17.3.1. Short Version <a href="#INSTALL-SHORT-MAKE" class="id_link">#</a></h3></div></div></div><p>
3 </p><pre class="synopsis">
4 ./configure
5 make
6 su
7 make install
8 adduser postgres
9 mkdir -p /usr/local/pgsql/data
10 chown postgres /usr/local/pgsql/data
11 su - postgres
12 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
13 /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
14 /usr/local/pgsql/bin/createdb test
15 /usr/local/pgsql/bin/psql test
16 </pre><p>
17    The long version is the rest of this
18    <span class="phrase">section</span>.
19   </p></div><div class="sect2" id="INSTALL-PROCEDURE-MAKE"><div class="titlepage"><div><div><h3 class="title">17.3.2. Installation Procedure <a href="#INSTALL-PROCEDURE-MAKE" class="id_link">#</a></h3></div></div></div><div class="procedure"><ol class="procedure" type="1"><li class="step" id="CONFIGURE"><p class="title"><strong>Configuration</strong></p><a id="id-1.6.4.6.3.2.1.2" class="indexterm"></a><p>
20     The first step of the installation procedure is to configure the
21     source tree for your system and choose the options you would like.
22     This is done by running the <code class="filename">configure</code> script. For a
23     default installation simply enter:
24 </p><pre class="screen">
25 <strong class="userinput"><code>./configure</code></strong>
26 </pre><p>
27     This script will run a number of tests to determine values for various
28     system dependent variables and detect any quirks of your
29     operating system, and finally will create several files in the
30     build tree to record what it found.
31    </p><p>
32     You can also run <code class="filename">configure</code> in a directory outside
33     the source tree, and then build there, if you want to keep the build
34     directory separate from the original source files.  This procedure is
35     called a
36     <a id="id-1.6.4.6.3.2.1.4.2" class="indexterm"></a><em class="firstterm">VPATH</em>
37     build.  Here's how:
38 </p><pre class="screen">
39 <strong class="userinput"><code>mkdir build_dir</code></strong>
40 <strong class="userinput"><code>cd build_dir</code></strong>
41 <strong class="userinput"><code>/path/to/source/tree/configure [options go here]</code></strong>
42 <strong class="userinput"><code>make</code></strong>
43 </pre><p>
44    </p><p>
45     The default configuration will build the server and utilities, as
46     well as all client applications and interfaces that require only a
47     C compiler. All files will be installed under
48     <code class="filename">/usr/local/pgsql</code> by default.
49    </p><p>
50     You can customize the build and installation process by supplying one
51     or more command line options to <code class="filename">configure</code>.
52     Typically you would customize the install location, or the set of
53     optional features that are built.  <code class="filename">configure</code>
54     has a large number of options, which are described in
55     <a class="xref" href="install-make.html#CONFIGURE-OPTIONS" title="17.3.3. configure Options">Section 17.3.3</a>.
56    </p><p>
57     Also, <code class="filename">configure</code> responds to certain environment
58     variables, as described in <a class="xref" href="install-make.html#CONFIGURE-ENVVARS" title="17.3.4. configure Environment Variables">Section 17.3.4</a>.
59     These provide additional ways to customize the configuration.
60    </p></li><li class="step" id="BUILD"><p class="title"><strong>Build</strong></p><p>
61     To start the build, type either of:
62 </p><pre class="screen">
63 <strong class="userinput"><code>make</code></strong>
64 <strong class="userinput"><code>make all</code></strong>
65 </pre><p>
66     (Remember to use <acronym class="acronym">GNU</acronym> <span class="application">make</span>.)
67     The build will take a few minutes depending on your
68     hardware.
69    </p><p>
70    If you want to build everything that can be built, including the
71    documentation (HTML and man pages), and the additional modules
72    (<code class="filename">contrib</code>), type instead:
73 </p><pre class="screen">
74 <strong class="userinput"><code>make world</code></strong>
75 </pre><p>
76   </p><p>
77    If you want to build everything that can be built, including the
78    additional modules (<code class="filename">contrib</code>), but without
79    the documentation, type instead:
80 </p><pre class="screen">
81 <strong class="userinput"><code>make world-bin</code></strong>
82 </pre><p>
83    </p><p>
84     If you want to invoke the build from another makefile rather than
85     manually, you must unset <code class="varname">MAKELEVEL</code> or set it to zero,
86     for instance like this:
87 </p><pre class="programlisting">
88 build-postgresql:
89         $(MAKE) -C postgresql MAKELEVEL=0 all
90 </pre><p>
91     Failure to do that can lead to strange error messages, typically about
92     missing header files.
93    </p></li><li class="step"><p class="title"><strong>Regression Tests</strong></p><a id="id-1.6.4.6.3.2.3.2" class="indexterm"></a><p>
94     If you want to test the newly built server before you install it,
95     you can run the regression tests at this point. The regression
96     tests are a test suite to verify that <span class="productname">PostgreSQL</span>
97     runs on your machine in the way the developers expected it
98     to. Type:
99 </p><pre class="screen">
100 <strong class="userinput"><code>make check</code></strong>
101 </pre><p>
102     (This won't work as root; do it as an unprivileged user.)
103     See <a class="xref" href="regress.html" title="Chapter 31. Regression Tests">Chapter 31</a> for
104     detailed information about interpreting the test results. You can
105     repeat this test at any later time by issuing the same command.
106    </p></li><li class="step" id="INSTALL"><p class="title"><strong>Installing the Files</strong></p><div class="note"><h3 class="title">Note</h3><p>
107      If you are upgrading an existing system be sure to read
108      <a class="xref" href="upgrading.html" title="18.6. Upgrading a PostgreSQL Cluster">Section 18.6</a>,
109      which has instructions about upgrading a
110      cluster.
111     </p></div><p>
112     To install <span class="productname">PostgreSQL</span> enter:
113 </p><pre class="screen">
114 <strong class="userinput"><code>make install</code></strong>
115 </pre><p>
116     This will install files into the directories that were specified
117     in <a class="xref" href="install-make.html#CONFIGURE" title="Configuration">Step 1</a>. Make sure that you have appropriate
118     permissions to write into that area. Normally you need to do this
119     step as root. Alternatively, you can create the target
120     directories in advance and arrange for appropriate permissions to
121     be granted.
122    </p><p>
123     To install the documentation (HTML and man pages), enter:
124 </p><pre class="screen">
125 <strong class="userinput"><code>make install-docs</code></strong>
126 </pre><p>
127    </p><p>
128     If you built the world above, type instead:
129 </p><pre class="screen">
130 <strong class="userinput"><code>make install-world</code></strong>
131 </pre><p>
132     This also installs the documentation.
133    </p><p>
134     If you built the world without the documentation above, type instead:
135 </p><pre class="screen">
136 <strong class="userinput"><code>make install-world-bin</code></strong>
137 </pre><p>
138    </p><p>
139     You can use <code class="literal">make install-strip</code> instead of
140     <code class="literal">make install</code> to strip the executable files and
141     libraries as they are installed.  This will save some space.  If
142     you built with debugging support, stripping will effectively
143     remove the debugging support, so it should only be done if
144     debugging is no longer needed.  <code class="literal">install-strip</code>
145     tries to do a reasonable job saving space, but it does not have
146     perfect knowledge of how to strip every unneeded byte from an
147     executable file, so if you want to save all the disk space you
148     possibly can, you will have to do manual work.
149    </p><p>
150     The standard installation provides all the header files needed for client
151     application development as well as for server-side program
152     development, such as custom functions or data types written in C.
153    </p><p><strong>Client-only installation: </strong>
154      If you want to install only the client applications and
155      interface libraries, then you can use these commands:
156 </p><pre class="screen">
157 <strong class="userinput"><code>make -C src/bin install</code></strong>
158 <strong class="userinput"><code>make -C src/include install</code></strong>
159 <strong class="userinput"><code>make -C src/interfaces install</code></strong>
160 <strong class="userinput"><code>make -C doc install</code></strong>
161 </pre><p>
162     <code class="filename">src/bin</code> has a few binaries for server-only use,
163     but they are small.
164     </p></li></ol></div><p><strong>Uninstallation: </strong>
165     To undo the installation use the command <code class="command">make
166     uninstall</code>. However, this will not remove any created directories.
167    </p><p><strong>Cleaning: </strong>
168     After the installation you can free disk space by removing the built
169     files from the source tree with the command <code class="command">make
170     clean</code>. This will preserve the files made by the <code class="command">configure</code>
171     program, so that you can rebuild everything with <code class="command">make</code>
172     later on. To reset the source tree to the state in which it was
173     distributed, use <code class="command">make distclean</code>. If you are going to
174     build for several platforms within the same source tree you must do
175     this and re-configure for each platform.  (Alternatively, use
176     a separate build tree for each platform, so that the source tree
177     remains unmodified.)
178    </p><p>
179    If you perform a build and then discover that your <code class="command">configure</code>
180    options were wrong, or if you change anything that <code class="command">configure</code>
181    investigates (for example, software upgrades), then it's a good
182    idea to do <code class="command">make distclean</code> before reconfiguring and
183    rebuilding.  Without this, your changes in configuration choices
184    might not propagate everywhere they need to.
185   </p></div><div class="sect2" id="CONFIGURE-OPTIONS"><div class="titlepage"><div><div><h3 class="title">17.3.3. <code class="filename">configure</code> Options <a href="#CONFIGURE-OPTIONS" class="id_link">#</a></h3></div></div></div><a id="id-1.6.4.6.4.2" class="indexterm"></a><p>
186     <code class="command">configure</code>'s command line options are explained below.
187     This list is not exhaustive (use <code class="literal">./configure --help</code>
188     to get one that is).  The options not covered here are meant for
189     advanced use-cases such as cross-compilation, and are documented in
190     the standard Autoconf documentation.
191    </p><div class="sect3" id="CONFIGURE-OPTIONS-LOCATIONS"><div class="titlepage"><div><div><h4 class="title">17.3.3.1. Installation Locations <a href="#CONFIGURE-OPTIONS-LOCATIONS" class="id_link">#</a></h4></div></div></div><p>
192       These options control where <code class="literal">make install</code> will put
193       the files.  The <code class="option">--prefix</code> option is sufficient for
194       most cases.  If you have special needs, you can customize the
195       installation subdirectories with the other options described in this
196       section.  Beware however that changing the relative locations of the
197       different subdirectories may render the installation non-relocatable,
198       meaning you won't be able to move it after installation.
199       (The <code class="literal">man</code> and <code class="literal">doc</code> locations are
200       not affected by this restriction.)  For relocatable installs, you
201       might want to use the <code class="literal">--disable-rpath</code> option
202       described later.
203      </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-PREFIX"><span class="term"><code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em></code></span> <a href="#CONFIGURE-OPTION-PREFIX" class="id_link">#</a></dt><dd><p>
204          Install all files under the directory <em class="replaceable"><code>PREFIX</code></em>
205          instead of <code class="filename">/usr/local/pgsql</code>. The actual
206          files will be installed into various subdirectories; no files
207          will ever be installed directly into the
208          <em class="replaceable"><code>PREFIX</code></em> directory.
209         </p></dd><dt id="CONFIGURE-OPTION-EXEC-PREFIX"><span class="term"><code class="option">--exec-prefix=<em class="replaceable"><code>EXEC-PREFIX</code></em></code></span> <a href="#CONFIGURE-OPTION-EXEC-PREFIX" class="id_link">#</a></dt><dd><p>
210          You can install architecture-dependent files under a
211          different prefix, <em class="replaceable"><code>EXEC-PREFIX</code></em>, than what
212          <em class="replaceable"><code>PREFIX</code></em> was set to. This can be useful to
213          share architecture-independent files between hosts. If you
214          omit this, then <em class="replaceable"><code>EXEC-PREFIX</code></em> is set equal to
215          <em class="replaceable"><code>PREFIX</code></em> and both architecture-dependent and
216          independent files will be installed under the same tree,
217          which is probably what you want.
218         </p></dd><dt id="CONFIGURE-OPTION-BINDIR"><span class="term"><code class="option">--bindir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-BINDIR" class="id_link">#</a></dt><dd><p>
219          Specifies the directory for executable programs. The default
220          is <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/bin</code>, which
221          normally means <code class="filename">/usr/local/pgsql/bin</code>.
222         </p></dd><dt id="CONFIGURE-OPTION-SYSCONFDIR"><span class="term"><code class="option">--sysconfdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-SYSCONFDIR" class="id_link">#</a></dt><dd><p>
223          Sets the directory for various configuration files,
224          <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/etc</code> by default.
225         </p></dd><dt id="CONFIGURE-OPTION-LIBDIR"><span class="term"><code class="option">--libdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-LIBDIR" class="id_link">#</a></dt><dd><p>
226          Sets the location to install libraries and dynamically loadable
227          modules. The default is
228          <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/lib</code>.
229         </p></dd><dt id="CONFIGURE-OPTION-INCLUDEDIR"><span class="term"><code class="option">--includedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-INCLUDEDIR" class="id_link">#</a></dt><dd><p>
230          Sets the directory for installing C and C++ header files. The
231          default is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/include</code>.
232         </p></dd><dt id="CONFIGURE-OPTION-DATAROOTDIR"><span class="term"><code class="option">--datarootdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-DATAROOTDIR" class="id_link">#</a></dt><dd><p>
233          Sets the root directory for various types of read-only data
234          files.  This only sets the default for some of the following
235          options.  The default is
236          <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/share</code>.
237         </p></dd><dt id="CONFIGURE-OPTION-DATADIR"><span class="term"><code class="option">--datadir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-DATADIR" class="id_link">#</a></dt><dd><p>
238          Sets the directory for read-only data files used by the
239          installed programs. The default is
240          <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em></code>. Note that this has
241          nothing to do with where your database files will be placed.
242         </p></dd><dt id="CONFIGURE-OPTION-LOCALEDIR"><span class="term"><code class="option">--localedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-LOCALEDIR" class="id_link">#</a></dt><dd><p>
243          Sets the directory for installing locale data, in particular
244          message translation catalog files.  The default is
245          <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/locale</code>.
246         </p></dd><dt id="CONFIGURE-OPTION-MANDIR"><span class="term"><code class="option">--mandir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-MANDIR" class="id_link">#</a></dt><dd><p>
247          The man pages that come with <span class="productname">PostgreSQL</span> will be installed under
248          this directory, in their respective
249          <code class="filename">man<em class="replaceable"><code>x</code></em></code> subdirectories.
250          The default is <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/man</code>.
251         </p></dd><dt id="CONFIGURE-OPTION-DOCDIR"><span class="term"><code class="option">--docdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-DOCDIR" class="id_link">#</a></dt><dd><p>
252          Sets the root directory for installing documentation files,
253          except <span class="quote">“<span class="quote">man</span>”</span> pages.  This only sets the default for
254          the following options.  The default value for this option is
255          <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/doc/postgresql</code>.
256         </p></dd><dt id="CONFIGURE-OPTION-HTMLDIR"><span class="term"><code class="option">--htmldir=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-HTMLDIR" class="id_link">#</a></dt><dd><p>
257          The HTML-formatted documentation for
258          <span class="productname">PostgreSQL</span> will be installed under
259          this directory.  The default is
260          <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em></code>.
261         </p></dd></dl></div><div class="note"><h3 class="title">Note</h3><p>
262        Care has been taken to make it possible to install
263        <span class="productname">PostgreSQL</span> into shared installation locations
264        (such as <code class="filename">/usr/local/include</code>) without
265        interfering with the namespace of the rest of the system. First,
266        the string <span class="quote">“<span class="quote"><code class="literal">/postgresql</code></span>”</span> is
267        automatically appended to <code class="varname">datadir</code>,
268        <code class="varname">sysconfdir</code>, and <code class="varname">docdir</code>,
269        unless the fully expanded directory name already contains the
270        string <span class="quote">“<span class="quote"><code class="literal">postgres</code></span>”</span> or
271        <span class="quote">“<span class="quote"><code class="literal">pgsql</code></span>”</span>. For example, if you choose
272        <code class="filename">/usr/local</code> as prefix, the documentation will
273        be installed in <code class="filename">/usr/local/doc/postgresql</code>,
274        but if the prefix is <code class="filename">/opt/postgres</code>, then it
275        will be in <code class="filename">/opt/postgres/doc</code>. The public C
276        header files of the client interfaces are installed into
277        <code class="varname">includedir</code> and are namespace-clean. The
278        internal header files and the server header files are installed
279        into private directories under <code class="varname">includedir</code>. See
280        the documentation of each interface for information about how to
281        access its header files. Finally, a private subdirectory will
282        also be created, if appropriate, under <code class="varname">libdir</code>
283        for dynamically loadable modules.
284       </p></div></div><div class="sect3" id="CONFIGURE-OPTIONS-FEATURES"><div class="titlepage"><div><div><h4 class="title">17.3.3.2. <span class="productname">PostgreSQL</span> Features <a href="#CONFIGURE-OPTIONS-FEATURES" class="id_link">#</a></h4></div></div></div><p>
285      The options described in this section enable building of
286      various <span class="productname">PostgreSQL</span> features that are not
287      built by default.  Most of these are non-default only because they
288      require additional software, as described in
289      <a class="xref" href="install-requirements.html" title="17.1. Requirements">Section 17.1</a>.
290     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-ENABLE-NLS"><span class="term"><code class="option">--enable-nls[<span class="optional">=<em class="replaceable"><code>LANGUAGES</code></em></span>]</code></span> <a href="#CONFIGURE-OPTION-ENABLE-NLS" class="id_link">#</a></dt><dd><p>
291          Enables Native Language Support (<acronym class="acronym">NLS</acronym>),
292          that is, the ability to display a program's messages in a
293          language other than English.
294          <em class="replaceable"><code>LANGUAGES</code></em> is an optional space-separated
295          list of codes of the languages that you want supported, for
296          example <code class="literal">--enable-nls='de fr'</code>.  (The intersection
297          between your list and the set of actually provided
298          translations will be computed automatically.)  If you do not
299          specify a list, then all available translations are
300          installed.
301         </p><p>
302          To use this option, you will need an implementation of the
303          <span class="application">Gettext</span> API.
304         </p></dd><dt id="CONFIGURE-OPTION-WITH-PERL"><span class="term"><code class="option">--with-perl</code></span> <a href="#CONFIGURE-OPTION-WITH-PERL" class="id_link">#</a></dt><dd><p>
305          Build the <span class="application">PL/Perl</span> server-side language.
306         </p></dd><dt id="CONFIGURE-OPTION-WITH-PYTHON"><span class="term"><code class="option">--with-python</code></span> <a href="#CONFIGURE-OPTION-WITH-PYTHON" class="id_link">#</a></dt><dd><p>
307          Build the <span class="application">PL/Python</span> server-side language.
308         </p></dd><dt id="CONFIGURE-OPTION-WITH-TCL"><span class="term"><code class="option">--with-tcl</code></span> <a href="#CONFIGURE-OPTION-WITH-TCL" class="id_link">#</a></dt><dd><p>
309          Build the <span class="application">PL/Tcl</span> server-side language.
310         </p></dd><dt id="CONFIGURE-OPTION-WITH-TCLCONFIG"><span class="term"><code class="option">--with-tclconfig=<em class="replaceable"><code>DIRECTORY</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-TCLCONFIG" class="id_link">#</a></dt><dd><p>
311          Tcl installs the file <code class="filename">tclConfig.sh</code>, which
312          contains configuration information needed to build modules
313          interfacing to Tcl. This file is normally found automatically
314          at a well-known location, but if you want to use a different
315          version of Tcl you can specify the directory in which to look
316          for <code class="filename">tclConfig.sh</code>.
317         </p></dd><dt id="CONFIGURE-WITH-LLVM"><span class="term"><code class="option">--with-llvm</code></span> <a href="#CONFIGURE-WITH-LLVM" class="id_link">#</a></dt><dd><p>
318          Build with support for <span class="productname">LLVM</span> based
319          <acronym class="acronym">JIT</acronym> compilation (see <a class="xref" href="jit.html" title="Chapter 30. Just-in-Time Compilation (JIT)">Chapter 30</a>).  This
320          requires the <span class="productname">LLVM</span> library to be installed.
321          The minimum required version of <span class="productname">LLVM</span> is
322          currently 14.
323         </p><p>
324          <code class="command">llvm-config</code><a id="id-1.6.4.6.4.5.3.6.2.2.2" class="indexterm"></a>
325          will be used to find the required compilation options.
326          <code class="command">llvm-config</code> will be searched for in your
327          <code class="envar">PATH</code>.  If that would not yield the desired program,
328          use <code class="envar">LLVM_CONFIG</code> to specify a path to the correct
329          <code class="command">llvm-config</code>. For example
330 </p><pre class="programlisting">
331 ./configure ... --with-llvm LLVM_CONFIG='/path/to/llvm/bin/llvm-config'
332 </pre><p>
333         </p><p>
334          <span class="productname">LLVM</span> support requires a compatible
335          <code class="command">clang</code> compiler (specified, if necessary, using the
336          <code class="envar">CLANG</code> environment variable), and a working C++
337          compiler (specified, if necessary, using the <code class="envar">CXX</code>
338          environment variable).
339         </p></dd><dt id="CONFIGURE-OPTION-WITH-LZ4"><span class="term"><code class="option">--with-lz4</code></span> <a href="#CONFIGURE-OPTION-WITH-LZ4" class="id_link">#</a></dt><dd><p>
340          Build with <span class="productname">LZ4</span> compression support.
341         </p></dd><dt id="CONFIGURE-OPTION-WITH-ZSTD"><span class="term"><code class="option">--with-zstd</code></span> <a href="#CONFIGURE-OPTION-WITH-ZSTD" class="id_link">#</a></dt><dd><p>
342          Build with <span class="productname">Zstandard</span> compression support.
343         </p></dd><dt id="CONFIGURE-OPTION-WITH-SSL"><span class="term"><code class="option">--with-ssl=<em class="replaceable"><code>LIBRARY</code></em></code>
344        <a id="id-1.6.4.6.4.5.3.9.1.2" class="indexterm"></a>
345        </span> <a href="#CONFIGURE-OPTION-WITH-SSL" class="id_link">#</a></dt><dd><p>
346          Build with support for <acronym class="acronym">SSL</acronym> (encrypted)
347          connections. The only <em class="replaceable"><code>LIBRARY</code></em>
348          supported is <code class="option">openssl</code>, which is used for both
349          <span class="productname">OpenSSL</span>
350          and <span class="productname">LibreSSL</span>. This requires the
351          <span class="productname">OpenSSL</span> package to be installed.
352          <code class="filename">configure</code> will check for the required
353          header files and libraries to make sure that your
354          <span class="productname">OpenSSL</span> installation is sufficient
355          before proceeding.
356         </p></dd><dt id="CONFIGURE-OPTION-WITH-OPENSSL"><span class="term"><code class="option">--with-openssl</code></span> <a href="#CONFIGURE-OPTION-WITH-OPENSSL" class="id_link">#</a></dt><dd><p>
357          Obsolete equivalent of <code class="literal">--with-ssl=openssl</code>.
358         </p></dd><dt id="CONFIGURE-OPTION-WITH-GSSAPI"><span class="term"><code class="option">--with-gssapi</code></span> <a href="#CONFIGURE-OPTION-WITH-GSSAPI" class="id_link">#</a></dt><dd><p>
359          Build with support for GSSAPI authentication. MIT Kerberos is required
360          to be installed for GSSAPI.  On many systems, the GSSAPI system (a part
361          of the MIT Kerberos installation) is not installed in a location
362          that is searched by default (e.g., <code class="filename">/usr/include</code>,
363          <code class="filename">/usr/lib</code>), so you must use the options
364          <code class="option">--with-includes</code> and <code class="option">--with-libraries</code> in
365          addition to this option.  <code class="filename">configure</code> will check
366          for the required header files and libraries to make sure that
367          your GSSAPI installation is sufficient before proceeding.
368         </p></dd><dt id="CONFIGURE-OPTION-WITH-LDAP"><span class="term"><code class="option">--with-ldap</code></span> <a href="#CONFIGURE-OPTION-WITH-LDAP" class="id_link">#</a></dt><dd><p>
369          Build with <acronym class="acronym">LDAP</acronym><a id="id-1.6.4.6.4.5.3.12.2.1.2" class="indexterm"></a>
370          support for authentication and connection parameter lookup (see
371          <span id="INSTALL-LDAP-LINKS" class="phrase"><a class="xref" href="libpq-ldap.html" title="32.18. LDAP Lookup of Connection Parameters">Section 32.18</a> and
372          <a class="xref" href="auth-ldap.html" title="20.10. LDAP Authentication">Section 20.10</a></span> for more information). On Unix,
373          this requires the <span class="productname">OpenLDAP</span> package to be
374          installed. On Windows, the default <span class="productname">WinLDAP</span>
375          library is used.  <code class="filename">configure</code> will check for the required
376          header files and libraries to make sure that your
377          <span class="productname">OpenLDAP</span> installation is sufficient before
378          proceeding.
379         </p></dd><dt id="CONFIGURE-OPTION-WITH-PAM"><span class="term"><code class="option">--with-pam</code></span> <a href="#CONFIGURE-OPTION-WITH-PAM" class="id_link">#</a></dt><dd><p>
380          Build with <acronym class="acronym">PAM</acronym><a id="id-1.6.4.6.4.5.3.13.2.1.2" class="indexterm"></a>
381          (Pluggable Authentication Modules) support.
382         </p></dd><dt id="CONFIGURE-OPTION-WITH-BSD-AUTH"><span class="term"><code class="option">--with-bsd-auth</code></span> <a href="#CONFIGURE-OPTION-WITH-BSD-AUTH" class="id_link">#</a></dt><dd><p>
383          Build with BSD Authentication support.
384          (The BSD Authentication framework is
385          currently only available on OpenBSD.)
386         </p></dd><dt id="CONFIGURE-OPTION-WITH-SYSTEMD"><span class="term"><code class="option">--with-systemd</code></span> <a href="#CONFIGURE-OPTION-WITH-SYSTEMD" class="id_link">#</a></dt><dd><p>
387          Build with support
388          for <span class="application">systemd</span><a id="id-1.6.4.6.4.5.3.15.2.1.2" class="indexterm"></a>
389          service notifications.  This improves integration if the server
390          is started under <span class="application">systemd</span> but has no impact
391          otherwise; see <a class="xref" href="server-start.html" title="18.3. Starting the Database Server">Section 18.3</a> for more
392          information.  <span class="application">libsystemd</span> and the
393          associated header files need to be installed to use this option.
394         </p></dd><dt id="CONFIGURE-OPTION-WITH-BONJOUR"><span class="term"><code class="option">--with-bonjour</code></span> <a href="#CONFIGURE-OPTION-WITH-BONJOUR" class="id_link">#</a></dt><dd><p>
395          Build with support for Bonjour automatic service discovery.
396          This requires Bonjour support in your operating system.
397          Recommended on macOS.
398         </p></dd><dt id="CONFIGURE-OPTION-WITH-UUID"><span class="term"><code class="option">--with-uuid=<em class="replaceable"><code>LIBRARY</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-UUID" class="id_link">#</a></dt><dd><p>
399          Build the <a class="xref" href="uuid-ossp.html" title="F.49. uuid-ossp — a UUID generator">uuid-ossp</a> module
400          (which provides functions to generate UUIDs), using the specified
401          UUID library.<a id="id-1.6.4.6.4.5.3.17.2.1.2" class="indexterm"></a>
402          <em class="replaceable"><code>LIBRARY</code></em> must be one of:
403         </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
404            <code class="option">bsd</code> to use the UUID functions found in FreeBSD
405            and some other BSD-derived systems
406           </p></li><li class="listitem"><p>
407            <code class="option">e2fs</code> to use the UUID library created by
408            the <code class="literal">e2fsprogs</code> project; this library is present in most
409            Linux systems and in macOS, and can be obtained for other
410            platforms as well
411           </p></li><li class="listitem"><p>
412            <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>
413           </p></li></ul></div></dd><dt id="CONFIGURE-OPTION-WITH-OSSP-UUID"><span class="term"><code class="option">--with-ossp-uuid</code></span> <a href="#CONFIGURE-OPTION-WITH-OSSP-UUID" class="id_link">#</a></dt><dd><p>
414          Obsolete equivalent of <code class="literal">--with-uuid=ossp</code>.
415         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBCURL"><span class="term"><code class="option">--with-libcurl</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBCURL" class="id_link">#</a></dt><dd><p>
416          Build with libcurl support for OAuth 2.0 client flows.
417          Libcurl version 7.61.0 or later is required for this feature.
418          Building with this will check for the required header files
419          and libraries to make sure that your <span class="productname">curl</span>
420          installation is sufficient before proceeding.
421         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBNUMA"><span class="term"><code class="option">--with-libnuma</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBNUMA" class="id_link">#</a></dt><dd><p>
422          Build with libnuma support for basic NUMA support.
423          Only supported on platforms for which the <span class="productname">libnuma</span>
424          library is implemented.
425         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBURING"><span class="term"><code class="option">--with-liburing</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBURING" class="id_link">#</a></dt><dd><p>
426         Build with liburing, enabling io_uring support for asynchronous I/O.
427         </p><p>
428          To detect the required compiler and linker options, PostgreSQL will
429          query <code class="command">pkg-config</code>.
430         </p><p>
431          To use a liburing installation that is in an unusual location, you
432          can set <code class="command">pkg-config</code>-related environment
433          variables (see its documentation).
434         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBXML"><span class="term"><code class="option">--with-libxml</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBXML" class="id_link">#</a></dt><dd><p>
435          Build with libxml2, enabling SQL/XML support.  Libxml2 version 2.6.23 or
436          later is required for this feature.
437         </p><p>
438          To detect the required compiler and linker options, PostgreSQL will
439          query <code class="command">pkg-config</code>, if that is installed and knows
440          about libxml2.  Otherwise the program <code class="command">xml2-config</code>,
441          which is installed by libxml2, will be used if it is found.  Use
442          of <code class="command">pkg-config</code> is preferred, because it can deal
443          with multi-architecture installations better.
444         </p><p>
445          To use a libxml2 installation that is in an unusual location, you
446          can set <code class="command">pkg-config</code>-related environment
447          variables (see its documentation), or set the environment variable
448          <code class="envar">XML2_CONFIG</code> to point to
449          the <code class="command">xml2-config</code> program belonging to the libxml2
450          installation, or set the variables <code class="envar">XML2_CFLAGS</code>
451          and <code class="envar">XML2_LIBS</code>.  (If <code class="command">pkg-config</code> is
452          installed, then to override its idea of where libxml2 is you must
453          either set <code class="envar">XML2_CONFIG</code> or set
454          both <code class="envar">XML2_CFLAGS</code> and <code class="envar">XML2_LIBS</code> to
455          nonempty strings.)
456         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBXSLT"><span class="term"><code class="option">--with-libxslt</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBXSLT" class="id_link">#</a></dt><dd><p>
457          Build with libxslt, enabling the
458          <a class="xref" href="xml2.html" title="F.50. xml2 — XPath querying and XSLT functionality">xml2</a>
459          module to perform XSL transformations of XML.
460          <code class="option">--with-libxml</code> must be specified as well.
461         </p></dd><dt id="CONFIGURE-OPTION-WITH-SEPGSQL"><span class="term"><code class="option">--with-selinux</code></span> <a href="#CONFIGURE-OPTION-WITH-SEPGSQL" class="id_link">#</a></dt><dd><p>
462          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>
463          extension.
464         </p></dd></dl></div></div><div class="sect3" id="CONFIGURE-OPTIONS-ANTI-FEATURES"><div class="titlepage"><div><div><h4 class="title">17.3.3.3. Anti-Features <a href="#CONFIGURE-OPTIONS-ANTI-FEATURES" class="id_link">#</a></h4></div></div></div><p>
465      The options described in this section allow disabling
466      certain <span class="productname">PostgreSQL</span> features that are built
467      by default, but which might need to be turned off if the required
468      software or system features are not available.  Using these options is
469      not recommended unless really necessary.
470     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-WITHOUT-ICU"><span class="term"><code class="option">--without-icu</code></span> <a href="#CONFIGURE-OPTION-WITHOUT-ICU" class="id_link">#</a></dt><dd><p>
471          Build without support for the
472          <span class="productname">ICU</span><a id="id-1.6.4.6.4.6.3.1.2.1.2" class="indexterm"></a>
473          library, disabling the use of ICU collation features (see <a class="xref" href="collation.html" title="23.2. Collation Support">Section 23.2</a>).
474         </p></dd><dt id="CONFIGURE-OPTION-WITHOUT-READLINE"><span class="term"><code class="option">--without-readline</code></span> <a href="#CONFIGURE-OPTION-WITHOUT-READLINE" class="id_link">#</a></dt><dd><p>
475          Prevents use of the <span class="application">Readline</span> library
476          (and <span class="application">libedit</span> as well).  This option disables
477          command-line editing and history in
478          <span class="application">psql</span>.
479         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBEDIT-PREFERRED"><span class="term"><code class="option">--with-libedit-preferred</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBEDIT-PREFERRED" class="id_link">#</a></dt><dd><p>
480          Favors the use of the BSD-licensed <span class="application">libedit</span> library
481          rather than GPL-licensed <span class="application">Readline</span>.  This option
482          is significant only if you have both libraries installed; the
483          default in that case is to use <span class="application">Readline</span>.
484         </p></dd><dt id="CONFIGURE-OPTION-WITHOUT-ZLIB"><span class="term"><code class="option">--without-zlib</code></span> <a href="#CONFIGURE-OPTION-WITHOUT-ZLIB" class="id_link">#</a></dt><dd><p>
485          <a id="id-1.6.4.6.4.6.3.4.2.1.1" class="indexterm"></a>
486          Prevents use of the <span class="application">Zlib</span> library.
487          This disables
488          support for compressed archives in <span class="application">pg_dump</span>
489          and <span class="application">pg_restore</span>.
490         </p></dd></dl></div></div><div class="sect3" id="CONFIGURE-OPTIONS-BUILD-PROCESS"><div class="titlepage"><div><div><h4 class="title">17.3.3.4. Build Process Details <a href="#CONFIGURE-OPTIONS-BUILD-PROCESS" class="id_link">#</a></h4></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-WITH-INCLUDES"><span class="term"><code class="option">--with-includes=<em class="replaceable"><code>DIRECTORIES</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-INCLUDES" class="id_link">#</a></dt><dd><p>
491          <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
492          directories that will be added to the list the compiler
493          searches for header files. If you have optional packages
494          (such as GNU <span class="application">Readline</span>) installed in a non-standard
495          location,
496          you have to use this option and probably also the corresponding
497          <code class="option">--with-libraries</code> option.
498         </p><p>
499          Example: <code class="literal">--with-includes=/opt/gnu/include:/usr/sup/include</code>.
500         </p></dd><dt id="CONFIGURE-OPTION-WITH-LIBRARIES"><span class="term"><code class="option">--with-libraries=<em class="replaceable"><code>DIRECTORIES</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-LIBRARIES" class="id_link">#</a></dt><dd><p>
501          <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
502          directories to search for libraries. You will probably have
503          to use this option (and the corresponding
504          <code class="option">--with-includes</code> option) if you have packages
505          installed in non-standard locations.
506         </p><p>
507          Example: <code class="literal">--with-libraries=/opt/gnu/lib:/usr/sup/lib</code>.
508         </p></dd><dt id="CONFIGURE-OPTION-WITH-SYSTEM-TZDATA"><span class="term"><code class="option">--with-system-tzdata=<em class="replaceable"><code>DIRECTORY</code></em></code>
509        <a id="id-1.6.4.6.4.7.2.3.1.2" class="indexterm"></a>
510        </span> <a href="#CONFIGURE-OPTION-WITH-SYSTEM-TZDATA" class="id_link">#</a></dt><dd><p>
511          <span class="productname">PostgreSQL</span> includes its own time zone database,
512          which it requires for date and time operations.  This time zone
513          database is in fact compatible with the IANA time zone
514          database provided by many operating systems such as FreeBSD,
515          Linux, and Solaris, so it would be redundant to install it again.
516          When this option is used, the system-supplied time zone database
517          in <em class="replaceable"><code>DIRECTORY</code></em> is used instead of the one
518          included in the PostgreSQL source distribution.
519          <em class="replaceable"><code>DIRECTORY</code></em> must be specified as an
520          absolute path.  <code class="filename">/usr/share/zoneinfo</code> is a
521          likely directory on some operating systems.  Note that the
522          installation routine will not detect mismatching or erroneous time
523          zone data.  If you use this option, you are advised to run the
524          regression tests to verify that the time zone data you have
525          pointed to works correctly with <span class="productname">PostgreSQL</span>.
526         </p><a id="id-1.6.4.6.4.7.2.3.2.2" class="indexterm"></a><p>
527          This option is mainly aimed at binary package distributors
528          who know their target operating system well.  The main
529          advantage of using this option is that the PostgreSQL package
530          won't need to be upgraded whenever any of the many local
531          daylight-saving time rules change.  Another advantage is that
532          PostgreSQL can be cross-compiled more straightforwardly if the
533          time zone database files do not need to be built during the
534          installation.
535         </p></dd><dt id="CONFIGURE-OPTION-WITH-EXTRA-VERSION"><span class="term"><code class="option">--with-extra-version=<em class="replaceable"><code>STRING</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-EXTRA-VERSION" class="id_link">#</a></dt><dd><p>
536          Append <em class="replaceable"><code>STRING</code></em> to the PostgreSQL version number.  You
537          can use this, for example, to mark binaries built from unreleased Git
538          snapshots or containing custom patches with an extra version string,
539          such as a <code class="command">git describe</code> identifier or a
540          distribution package release number.
541         </p></dd><dt id="CONFIGURE-OPTION-DISABLE-RPATH"><span class="term"><code class="option">--disable-rpath</code></span> <a href="#CONFIGURE-OPTION-DISABLE-RPATH" class="id_link">#</a></dt><dd><p>
542          Do not mark <span class="productname">PostgreSQL</span>'s executables
543          to indicate that they should search for shared libraries in the
544          installation's library directory (see <code class="option">--libdir</code>).
545          On most platforms, this marking uses an absolute path to the
546          library directory, so that it will be unhelpful if you relocate
547          the installation later.  However, you will then need to provide
548          some other way for the executables to find the shared libraries.
549          Typically this requires configuring the operating system's
550          dynamic linker to search the library directory; see
551          <a class="xref" href="install-post.html#INSTALL-POST-SHLIBS" title="17.5.1. Shared Libraries">Section 17.5.1</a> for more detail.
552         </p></dd></dl></div></div><div class="sect3" id="CONFIGURE-OPTIONS-MISC"><div class="titlepage"><div><div><h4 class="title">17.3.3.5. Miscellaneous <a href="#CONFIGURE-OPTIONS-MISC" class="id_link">#</a></h4></div></div></div><p>
553      It's fairly common, particularly for test builds, to adjust the
554      default port number with <code class="option">--with-pgport</code>.
555      The other options in this section are recommended only for advanced
556      users.
557     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-WITH-PGPORT"><span class="term"><code class="option">--with-pgport=<em class="replaceable"><code>NUMBER</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-PGPORT" class="id_link">#</a></dt><dd><p>
558          Set <em class="replaceable"><code>NUMBER</code></em> as the default port number for
559          server and clients. The default is 5432. The port can always
560          be changed later on, but if you specify it here then both
561          server and clients will have the same default compiled in,
562          which can be very convenient.  Usually the only good reason
563          to select a non-default value is if you intend to run multiple
564          <span class="productname">PostgreSQL</span> servers on the same machine.
565         </p></dd><dt id="CONFIGURE-OPTION-WITH-KRB-SRVNAM"><span class="term"><code class="option">--with-krb-srvnam=<em class="replaceable"><code>NAME</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-KRB-SRVNAM" class="id_link">#</a></dt><dd><p>
566          The default name of the Kerberos service principal used
567          by GSSAPI.
568          <code class="literal">postgres</code> is the default. There's usually no
569          reason to change this unless you are building for a Windows
570          environment, in which case it must be set to upper case
571          <code class="literal">POSTGRES</code>.
572         </p></dd><dt id="CONFIGURE-OPTION-WITH-SEGSIZE"><span class="term"><code class="option">--with-segsize=<em class="replaceable"><code>SEGSIZE</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-SEGSIZE" class="id_link">#</a></dt><dd><p>
573          Set the <em class="firstterm">segment size</em>, in gigabytes.  Large tables are
574          divided into multiple operating-system files, each of size equal
575          to the segment size.  This avoids problems with file size limits
576          that exist on many platforms.  The default segment size, 1 gigabyte,
577          is safe on all supported platforms.  If your operating system has
578          <span class="quote">“<span class="quote">largefile</span>”</span> support (which most do, nowadays), you can use
579          a larger segment size.  This can be helpful to reduce the number of
580          file descriptors consumed when working with very large tables.
581          But be careful not to select a value larger than is supported
582          by your platform and the file systems you intend to use.  Other
583          tools you might wish to use, such as <span class="application">tar</span>, could
584          also set limits on the usable file size.
585          It is recommended, though not absolutely required, that this value
586          be a power of 2.
587          Note that changing this value breaks on-disk database compatibility,
588          meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to
589          a build with a different segment size.
590         </p></dd><dt id="CONFIGURE-OPTION-WITH-BLOCKSIZE"><span class="term"><code class="option">--with-blocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-BLOCKSIZE" class="id_link">#</a></dt><dd><p>
591          Set the <em class="firstterm">block size</em>, in kilobytes.  This is the unit
592          of storage and I/O within tables.  The default, 8 kilobytes,
593          is suitable for most situations; but other values may be useful
594          in special cases.
595          The value must be a power of 2 between 1 and 32 (kilobytes).
596          Note that changing this value breaks on-disk database compatibility,
597          meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to
598          a build with a different block size.
599         </p></dd><dt id="CONFIGURE-OPTION-WITH-WAL-BLOCKSIZE"><span class="term"><code class="option">--with-wal-blocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span> <a href="#CONFIGURE-OPTION-WITH-WAL-BLOCKSIZE" class="id_link">#</a></dt><dd><p>
600          Set the <em class="firstterm">WAL block size</em>, in kilobytes.  This is the unit
601          of storage and I/O within the WAL log.  The default, 8 kilobytes,
602          is suitable for most situations; but other values may be useful
603          in special cases.
604          The value must be a power of 2 between 1 and 64 (kilobytes).
605          Note that changing this value breaks on-disk database compatibility,
606          meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to
607          a build with a different WAL block size.
608         </p></dd></dl></div></div><div class="sect3" id="CONFIGURE-OPTIONS-DEVEL"><div class="titlepage"><div><div><h4 class="title">17.3.3.6. Developer Options <a href="#CONFIGURE-OPTIONS-DEVEL" class="id_link">#</a></h4></div></div></div><p>
609      Most of the options in this section are only of interest for
610      developing or debugging <span class="productname">PostgreSQL</span>.
611      They are not recommended for production builds, except
612      for <code class="option">--enable-debug</code>, which can be useful to enable
613      detailed bug reports in the unlucky event that you encounter a bug.
614      On platforms supporting DTrace, <code class="option">--enable-dtrace</code>
615      may also be reasonable to use in production.
616     </p><p>
617      When building an installation that will be used to develop code inside
618      the server, it is recommended to use at least the
619      options <code class="option">--enable-debug</code>
620      and <code class="option">--enable-cassert</code>.
621     </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-OPTION-ENABLE-DEBUG"><span class="term"><code class="option">--enable-debug</code></span> <a href="#CONFIGURE-OPTION-ENABLE-DEBUG" class="id_link">#</a></dt><dd><p>
622          Compiles all programs and libraries with debugging symbols.
623          This means that you can run the programs in a debugger
624          to analyze problems. This enlarges the size of the installed
625          executables considerably, and on non-GCC compilers it usually
626          also disables compiler optimization, causing slowdowns. However,
627          having the symbols available is extremely helpful for dealing
628          with any problems that might arise.  Currently, this option is
629          recommended for production installations only if you use GCC.
630          But you should always have it on if you are doing development work
631          or running a beta version.
632         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-CASSERT"><span class="term"><code class="option">--enable-cassert</code></span> <a href="#CONFIGURE-OPTION-ENABLE-CASSERT" class="id_link">#</a></dt><dd><p>
633          Enables <em class="firstterm">assertion</em> checks in the server, which test for
634          many <span class="quote">“<span class="quote">cannot happen</span>”</span> conditions.  This is invaluable for
635          code development purposes, but the tests can slow down the
636          server significantly.
637          Also, having the tests turned on won't necessarily enhance the
638          stability of your server!  The assertion checks are not categorized
639          for severity, and so what might be a relatively harmless bug will
640          still lead to server restarts if it triggers an assertion
641          failure.  This option is not recommended for production use, but
642          you should have it on for development work or when running a beta
643          version.
644         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-TAP-TESTS"><span class="term"><code class="option">--enable-tap-tests</code></span> <a href="#CONFIGURE-OPTION-ENABLE-TAP-TESTS" class="id_link">#</a></dt><dd><p>
645          Enable tests using the Perl TAP tools.  This requires a Perl
646          installation and the Perl module <code class="literal">IPC::Run</code>.
647          See <a class="xref" href="regress-tap.html" title="31.4. TAP Tests">Section 31.4</a> for more information.
648         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-DEPEND"><span class="term"><code class="option">--enable-depend</code></span> <a href="#CONFIGURE-OPTION-ENABLE-DEPEND" class="id_link">#</a></dt><dd><p>
649          Enables automatic dependency tracking.  With this option, the
650          makefiles are set up so that all affected object files will
651          be rebuilt when any header file is changed.  This is useful
652          if you are doing development work, but is just wasted overhead
653          if you intend only to compile once and install.  At present,
654          this option only works with GCC.
655         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-COVERAGE"><span class="term"><code class="option">--enable-coverage</code></span> <a href="#CONFIGURE-OPTION-ENABLE-COVERAGE" class="id_link">#</a></dt><dd><p>
656          If using GCC, all programs and libraries are compiled with
657          code coverage testing instrumentation.  When run, they
658          generate files in the build directory with code coverage
659          metrics.
660          See <a class="xref" href="regress-coverage.html" title="31.5. Test Coverage Examination">Section 31.5</a>
661          for more information. This option is for use only with GCC
662          and when doing development work.
663         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-PROFILING"><span class="term"><code class="option">--enable-profiling</code></span> <a href="#CONFIGURE-OPTION-ENABLE-PROFILING" class="id_link">#</a></dt><dd><p>
664          If using GCC, all programs and libraries are compiled so they
665          can be profiled.  On backend exit, a subdirectory will be created
666          that contains the <code class="filename">gmon.out</code> file containing
667          profile data.
668          This option is for use only with GCC and when doing development work.
669         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-DTRACE"><span class="term"><code class="option">--enable-dtrace</code></span> <a href="#CONFIGURE-OPTION-ENABLE-DTRACE" class="id_link">#</a></dt><dd><p>
670          <a id="id-1.6.4.6.4.9.4.7.2.1.1" class="indexterm"></a>
671          Compiles <span class="productname">PostgreSQL</span> with support for the
672          dynamic tracing tool DTrace.
673          See <a class="xref" href="dynamic-trace.html" title="27.5. Dynamic Tracing">Section 27.5</a> for more information.
674         </p><p>
675          To point to the <code class="command">dtrace</code> program, the
676          environment variable <code class="envar">DTRACE</code> can be set.  This
677          will often be necessary because <code class="command">dtrace</code> is
678          typically installed under <code class="filename">/usr/sbin</code>,
679          which might not be in your <code class="envar">PATH</code>.
680         </p><p>
681          Extra command-line options for the <code class="command">dtrace</code> program
682          can be specified in the environment variable
683          <code class="envar">DTRACEFLAGS</code>.  On Solaris,
684          to include DTrace support in a 64-bit binary, you must specify
685          <code class="literal">DTRACEFLAGS="-64"</code>.  For example,
686          using the GCC compiler:
687 </p><pre class="screen">
688 ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
689 </pre><p>
690          Using Sun's compiler:
691 </p><pre class="screen">
692 ./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
693 </pre><p>
694         </p></dd><dt id="CONFIGURE-OPTION-ENABLE-INJECTION-POINTS"><span class="term"><code class="option">--enable-injection-points</code></span> <a href="#CONFIGURE-OPTION-ENABLE-INJECTION-POINTS" class="id_link">#</a></dt><dd><p>
695          Compiles <span class="productname">PostgreSQL</span> with support for
696          injection points in the server. Injection points allow to run
697          user-defined code from within the server in pre-defined code paths.
698          This helps in testing and in the investigation of concurrency scenarios
699          in a controlled fashion. This option is disabled by default.  See
700          <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
701          option is intended to be used only by developers for testing.
702         </p></dd><dt id="CONFIGURE-OPTION-WITH-SEGSIZE-BLOCKS"><span class="term"><code class="option">--with-segsize-blocks=SEGSIZE_BLOCKS</code></span> <a href="#CONFIGURE-OPTION-WITH-SEGSIZE-BLOCKS" class="id_link">#</a></dt><dd><p>
703          Specify the relation segment size in blocks. If both
704          <code class="option">--with-segsize</code> and this option are specified, this
705          option wins.
706
707          This option is only for developers, to test segment related code.
708         </p></dd></dl></div></div></div><div class="sect2" id="CONFIGURE-ENVVARS"><div class="titlepage"><div><div><h3 class="title">17.3.4. <code class="filename">configure</code> Environment Variables <a href="#CONFIGURE-ENVVARS" class="id_link">#</a></h3></div></div></div><a id="id-1.6.4.6.5.2" class="indexterm"></a><p>
709      In addition to the ordinary command-line options described above,
710      <code class="filename">configure</code> responds to a number of environment
711      variables.
712      You can specify environment variables on the
713      <code class="filename">configure</code> command line, for example:
714 </p><pre class="screen">
715 <strong class="userinput"><code>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</code></strong>
716 </pre><p>
717      In this usage an environment variable is little different from a
718      command-line option.
719      You can also set such variables beforehand:
720 </p><pre class="screen">
721 <strong class="userinput"><code>export CC=/opt/bin/gcc</code></strong>
722 <strong class="userinput"><code>export CFLAGS='-O2 -pipe'</code></strong>
723 <strong class="userinput"><code>./configure</code></strong>
724 </pre><p>
725      This usage can be convenient because many programs' configuration
726      scripts respond to these variables in similar ways.
727     </p><p>
728      The most commonly used of these environment variables are
729      <code class="envar">CC</code> and <code class="envar">CFLAGS</code>.
730      If you prefer a C compiler different from the one
731      <code class="filename">configure</code> picks, you can set the
732      variable <code class="envar">CC</code> to the program of your choice.
733      By default, <code class="filename">configure</code> will pick
734      <code class="filename">gcc</code> if available, else the platform's
735      default (usually <code class="filename">cc</code>).  Similarly, you can override the
736      default compiler flags if needed with the <code class="envar">CFLAGS</code> variable.
737     </p><p>
738      Here is a list of the significant variables that can be set in
739      this manner:
740
741      </p><div class="variablelist"><dl class="variablelist"><dt id="CONFIGURE-ENVVARS-BISON"><span class="term"><code class="envar">BISON</code></span> <a href="#CONFIGURE-ENVVARS-BISON" class="id_link">#</a></dt><dd><p>
742          Bison program
743         </p></dd><dt id="CONFIGURE-ENVVARS-CC"><span class="term"><code class="envar">CC</code></span> <a href="#CONFIGURE-ENVVARS-CC" class="id_link">#</a></dt><dd><p>
744          C compiler
745         </p></dd><dt id="CONFIGURE-ENVVARS-CFLAGS"><span class="term"><code class="envar">CFLAGS</code></span> <a href="#CONFIGURE-ENVVARS-CFLAGS" class="id_link">#</a></dt><dd><p>
746          options to pass to the C compiler
747         </p></dd><dt id="CONFIGURE-ENVVARS-CLANG"><span class="term"><code class="envar">CLANG</code></span> <a href="#CONFIGURE-ENVVARS-CLANG" class="id_link">#</a></dt><dd><p>
748          path to <code class="command">clang</code> program used to process source code
749          for inlining when compiling with <code class="literal">--with-llvm</code>
750         </p></dd><dt id="CONFIGURE-ENVVARS-CPP"><span class="term"><code class="envar">CPP</code></span> <a href="#CONFIGURE-ENVVARS-CPP" class="id_link">#</a></dt><dd><p>
751          C preprocessor
752         </p></dd><dt id="CONFIGURE-ENVVARS-CPPFLAGS"><span class="term"><code class="envar">CPPFLAGS</code></span> <a href="#CONFIGURE-ENVVARS-CPPFLAGS" class="id_link">#</a></dt><dd><p>
753          options to pass to the C preprocessor
754         </p></dd><dt id="CONFIGURE-ENVVARS-CXX"><span class="term"><code class="envar">CXX</code></span> <a href="#CONFIGURE-ENVVARS-CXX" class="id_link">#</a></dt><dd><p>
755          C++ compiler
756         </p></dd><dt id="CONFIGURE-ENVVARS-CXXFLAGS"><span class="term"><code class="envar">CXXFLAGS</code></span> <a href="#CONFIGURE-ENVVARS-CXXFLAGS" class="id_link">#</a></dt><dd><p>
757          options to pass to the C++ compiler
758         </p></dd><dt id="CONFIGURE-ENVVARS-DTRACE"><span class="term"><code class="envar">DTRACE</code></span> <a href="#CONFIGURE-ENVVARS-DTRACE" class="id_link">#</a></dt><dd><p>
759          location of the <code class="command">dtrace</code> program
760         </p></dd><dt id="CONFIGURE-ENVVARS-DTRACEFLAGS"><span class="term"><code class="envar">DTRACEFLAGS</code></span> <a href="#CONFIGURE-ENVVARS-DTRACEFLAGS" class="id_link">#</a></dt><dd><p>
761          options to pass to the <code class="command">dtrace</code> program
762         </p></dd><dt id="CONFIGURE-ENVVARS-FLEX"><span class="term"><code class="envar">FLEX</code></span> <a href="#CONFIGURE-ENVVARS-FLEX" class="id_link">#</a></dt><dd><p>
763          Flex program
764         </p></dd><dt id="CONFIGURE-ENVVARS-LDFLAGS"><span class="term"><code class="envar">LDFLAGS</code></span> <a href="#CONFIGURE-ENVVARS-LDFLAGS" class="id_link">#</a></dt><dd><p>
765          options to use when linking either executables or shared libraries
766         </p></dd><dt id="CONFIGURE-ENVVARS-LDFLAGS-EX"><span class="term"><code class="envar">LDFLAGS_EX</code></span> <a href="#CONFIGURE-ENVVARS-LDFLAGS-EX" class="id_link">#</a></dt><dd><p>
767          additional options for linking executables only
768         </p></dd><dt id="CONFIGURE-ENVVARS-LDFLAGS-SL"><span class="term"><code class="envar">LDFLAGS_SL</code></span> <a href="#CONFIGURE-ENVVARS-LDFLAGS-SL" class="id_link">#</a></dt><dd><p>
769          additional options for linking shared libraries only
770         </p></dd><dt id="CONFIGURE-ENVVARS-LLVM-CONFIG"><span class="term"><code class="envar">LLVM_CONFIG</code></span> <a href="#CONFIGURE-ENVVARS-LLVM-CONFIG" class="id_link">#</a></dt><dd><p>
771          <code class="command">llvm-config</code> program used to locate the
772          <span class="productname">LLVM</span> installation
773         </p></dd><dt id="CONFIGURE-ENVVARS-MSGFMT"><span class="term"><code class="envar">MSGFMT</code></span> <a href="#CONFIGURE-ENVVARS-MSGFMT" class="id_link">#</a></dt><dd><p>
774          <code class="command">msgfmt</code> program for native language support
775         </p></dd><dt id="CONFIGURE-ENVVARS-PERL"><span class="term"><code class="envar">PERL</code></span> <a href="#CONFIGURE-ENVVARS-PERL" class="id_link">#</a></dt><dd><p>
776          Perl interpreter program.  This will be used to determine the
777          dependencies for building PL/Perl.  The default is
778          <code class="command">perl</code>.
779         </p></dd><dt id="CONFIGURE-ENVVARS-PYTHON"><span class="term"><code class="envar">PYTHON</code></span> <a href="#CONFIGURE-ENVVARS-PYTHON" class="id_link">#</a></dt><dd><p>
780          Python interpreter program.  This will be used to determine the
781          dependencies for building PL/Python.  If this is not set, the
782          following are probed in this order:
783          <code class="literal">python3 python</code>.
784         </p></dd><dt id="CONFIGURE-ENVVARS-TCLSH"><span class="term"><code class="envar">TCLSH</code></span> <a href="#CONFIGURE-ENVVARS-TCLSH" class="id_link">#</a></dt><dd><p>
785          Tcl interpreter program.  This will be used to
786          determine the dependencies for building PL/Tcl.
787          If this is not set, the following are probed in this
788          order: <code class="literal">tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85
789          tclsh8.4 tclsh84</code>.
790         </p></dd><dt id="CONFIGURE-ENVVARS-XML2-CONFIG"><span class="term"><code class="envar">XML2_CONFIG</code></span> <a href="#CONFIGURE-ENVVARS-XML2-CONFIG" class="id_link">#</a></dt><dd><p>
791          <code class="command">xml2-config</code> program used to locate the
792          libxml2 installation
793         </p></dd></dl></div><p>
794     </p><p>
795      Sometimes it is useful to add compiler flags after-the-fact to the set
796      that were chosen by <code class="filename">configure</code>.  An important example is
797      that <span class="application">gcc</span>'s <code class="option">-Werror</code> option cannot be included
798      in the <code class="envar">CFLAGS</code> passed to <code class="filename">configure</code>, because
799      it will break many of <code class="filename">configure</code>'s built-in tests.  To add
800      such flags, include them in the <code class="envar">COPT</code> environment variable
801      while running <code class="filename">make</code>.  The contents of <code class="envar">COPT</code>
802      are added to the <code class="envar">CFLAGS</code>, <code class="envar">CXXFLAGS</code>, and <code class="envar">LDFLAGS</code>
803      options set up by <code class="filename">configure</code>.  For example, you could do
804 </p><pre class="screen">
805 <strong class="userinput"><code>make COPT='-Werror'</code></strong>
806 </pre><p>
807      or
808 </p><pre class="screen">
809 <strong class="userinput"><code>export COPT='-Werror'</code></strong>
810 <strong class="userinput"><code>make</code></strong>
811 </pre><p>
812     </p><div class="note"><h3 class="title">Note</h3><p>
813       If using GCC, it is best to build with an optimization level of
814       at least <code class="option">-O1</code>, because using no optimization
815       (<code class="option">-O0</code>) disables some important compiler warnings (such
816       as the use of uninitialized variables).  However, non-zero
817       optimization levels can complicate debugging because stepping
818       through compiled code will usually not match up one-to-one with
819       source code lines.  If you get confused while trying to debug
820       optimized code, recompile the specific files of interest with
821       <code class="option">-O0</code>.  An easy way to do this is by passing an option
822       to <span class="application">make</span>: <code class="command">make PROFILE=-O0 file.o</code>.
823      </p><p>
824       The <code class="envar">COPT</code> and <code class="envar">PROFILE</code> environment variables are
825       actually handled identically by the <span class="productname">PostgreSQL</span>
826       makefiles.  Which to use is a matter of preference, but a common habit
827       among developers is to use <code class="envar">PROFILE</code> for one-time flag
828       adjustments, while <code class="envar">COPT</code> might be kept set all the time.
829      </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install-getsource.html" title="17.2. Getting the Source">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-meson.html" title="17.4. Building and Installation with Meson">Next</a></td></tr><tr><td width="40%" align="left" valign="top">17.2. Getting the Source </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.4. Building and Installation with Meson</td></tr></table></div></body></html>