codekingpro/portable-devtools
115k
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 16.3 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./configure5make6su7make install8adduser postgres9mkdir -p /usr/local/pgsql/data10chown postgres /usr/local/pgsql/data11su - postgres12/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data13/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start14/usr/local/pgsql/bin/createdb test15/usr/local/pgsql/bin/psql test16</pre><p>17 The long version is the rest of this18 <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.7.3.2.1.2" class="indexterm"></a><p>20 The first step of the installation procedure is to configure the21 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 a23 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 various28 system dependent variables and detect any quirks of your29 operating system, and finally will create several files in the30 build tree to record what it found.31 </p><p>32 You can also run <code class="filename">configure</code> in a directory outside33 the source tree, and then build there, if you want to keep the build34 directory separate from the original source files. This procedure is35 called a36 <a id="id-1.6.4.7.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, as46 well as all client applications and interfaces that require only a47 C compiler. All files will be installed under48 <code class="filename">/usr/local/pgsql</code> by default.49 </p><p>50 You can customize the build and installation process by supplying one51 or more command line options to <code class="filename">configure</code>.52 Typically you would customize the install location, or the set of53 optional features that are built. <code class="filename">configure</code>54 has a large number of options, which are described in55 <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 environment58 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 your68 hardware.69 </p><p>70 If you want to build everything that can be built, including the71 documentation (HTML and man pages), and the additional modules72 (<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 the78 additional modules (<code class="filename">contrib</code>), but without79 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 than85 manually, you must unset <code class="varname">MAKELEVEL</code> or set it to zero,86 for instance like this:87</p><pre class="programlisting">88build-postgresql:89 $(MAKE) -C postgresql MAKELEVEL=0 all90</pre><p>91 Failure to do that can lead to strange error messages, typically about92 missing header files.93 </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>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 regression96 tests are a test suite to verify that <span class="productname">PostgreSQL</span>97 runs on your machine in the way the developers expected it98 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 33. Regression Tests">Chapter 33</a> for104 detailed information about interpreting the test results. You can105 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 read108 <a class="xref" href="upgrading.html" title="19.6. Upgrading a PostgreSQL Cluster">Section 19.6</a>,109 which has instructions about upgrading a110 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 specified117 in <a class="xref" href="install-make.html#CONFIGURE" title="Configuration">Step 1</a>. Make sure that you have appropriate118 permissions to write into that area. Normally you need to do this119 step as root. Alternatively, you can create the target120 directories in advance and arrange for appropriate permissions to121 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 of140 <code class="literal">make install</code> to strip the executable files and141 libraries as they are installed. This will save some space. If142 you built with debugging support, stripping will effectively143 remove the debugging support, so it should only be done if144 debugging is no longer needed. <code class="literal">install-strip</code>145 tries to do a reasonable job saving space, but it does not have146 perfect knowledge of how to strip every unneeded byte from an147 executable file, so if you want to save all the disk space you148 possibly can, you will have to do manual work.149 </p><p>150 The standard installation provides all the header files needed for client151 application development as well as for server-side program152 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 and155 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">make166 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 built169 files from the source tree with the command <code class="command">make170 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 was173 distributed, use <code class="command">make distclean</code>. If you are going to174 build for several platforms within the same source tree you must do175 this and re-configure for each platform. (Alternatively, use176 a separate build tree for each platform, so that the source tree177 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 good182 idea to do <code class="command">make distclean</code> before reconfiguring and183 rebuilding. Without this, your changes in configuration choices184 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.7.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 for189 advanced use-cases such as cross-compilation, and are documented in190 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 put193 the files. The <code class="option">--prefix</code> option is sufficient for194 most cases. If you have special needs, you can customize the195 installation subdirectories with the other options described in this196 section. Beware however that changing the relative locations of the197 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 are200 not affected by this restriction.) For relocatable installs, you201 might want to use the <code class="literal">--disable-rpath</code> option202 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 actual206 files will be installed into various subdirectories; no files207 will ever be installed directly into the208 <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 a211 different prefix, <em class="replaceable"><code>EXEC-PREFIX</code></em>, than what212 <em class="replaceable"><code>PREFIX</code></em> was set to. This can be useful to213 share architecture-independent files between hosts. If you214 omit this, then <em class="replaceable"><code>EXEC-PREFIX</code></em> is set equal to215 <em class="replaceable"><code>PREFIX</code></em> and both architecture-dependent and216 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 default220 is <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/bin</code>, which221 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 loadable227 modules. The default is228 <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. The231 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 data234 files. This only sets the default for some of the following235 options. The default is236 <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 the239 installed programs. The default is240 <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em></code>. Note that this has241 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 particular244 message translation catalog files. The default is245 <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 under248 this directory, in their respective249 <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 for254 the following options. The default value for this option is255 <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 for258 <span class="productname">PostgreSQL</span> will be installed under259 this directory. The default is260 <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 install263 <span class="productname">PostgreSQL</span> into shared installation locations264 (such as <code class="filename">/usr/local/include</code>) without265 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> is267 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 the270 string <span class="quote">“<span class="quote"><code class="literal">postgres</code></span>”</span> or271 <span class="quote">“<span class="quote"><code class="literal">pgsql</code></span>”</span>. For example, if you choose272 <code class="filename">/usr/local</code> as prefix, the documentation will273 be installed in <code class="filename">/usr/local/doc/postgresql</code>,274 but if the prefix is <code class="filename">/opt/postgres</code>, then it275 will be in <code class="filename">/opt/postgres/doc</code>. The public C276 header files of the client interfaces are installed into277 <code class="varname">includedir</code> and are namespace-clean. The278 internal header files and the server header files are installed279 into private directories under <code class="varname">includedir</code>. See280 the documentation of each interface for information about how to281 access its header files. Finally, a private subdirectory will282 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 of286 various <span class="productname">PostgreSQL</span> features that are not287 built by default. Most of these are non-default only because they288 require additional software, as described in289 <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 a293 language other than English.294 <em class="replaceable"><code>LANGUAGES</code></em> is an optional space-separated295 list of codes of the languages that you want supported, for296 example <code class="literal">--enable-nls='de fr'</code>. (The intersection297 between your list and the set of actually provided298 translations will be computed automatically.) If you do not299 specify a list, then all available translations are300 installed.301 </p><p>302 To use this option, you will need an implementation of the303 <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>, which312 contains configuration information needed to build modules313 interfacing to Tcl. This file is normally found automatically314 at a well-known location, but if you want to use a different315 version of Tcl you can specify the directory in which to look316 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> based319 <acronym class="acronym">JIT</acronym> compilation<span class="phrase"> (see <a class="xref" href="jit.html" title="Chapter 32. Just-in-Time Compilation (JIT)">Chapter 32</a>)</span>. This320 requires the <span class="productname">LLVM</span> library to be installed.321 The minimum required version of <span class="productname">LLVM</span> is322 currently 3.9.323 </p><p>324 <code class="command">llvm-config</code><a id="id-1.6.4.7.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>, and then327 <code class="command">llvm-config-$major-$minor</code> for all supported328 versions, will be searched for in your <code class="envar">PATH</code>. If329 that would not yield the desired program,330 use <code class="envar">LLVM_CONFIG</code> to specify a path to the331 correct <code class="command">llvm-config</code>. For example332</p><pre class="programlisting">333./configure ... --with-llvm LLVM_CONFIG='/path/to/llvm/bin/llvm-config'334</pre><p>335 </p><p>336 <span class="productname">LLVM</span> support requires a compatible337 <code class="command">clang</code> compiler (specified, if necessary, using the338 <code class="envar">CLANG</code> environment variable), and a working C++339 compiler (specified, if necessary, using the <code class="envar">CXX</code>340 environment variable).341 </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>342 Build with <span class="productname">LZ4</span> compression support.343 </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>344 Build with <span class="productname">Zstandard</span> compression support.345 </p></dd><dt id="CONFIGURE-OPTION-WITH-SSL"><span class="term"><code class="option">--with-ssl=<em class="replaceable"><code>LIBRARY</code></em></code>346 <a id="id-1.6.4.7.4.5.3.9.1.2" class="indexterm"></a>347 </span> <a href="#CONFIGURE-OPTION-WITH-SSL" class="id_link">#</a></dt><dd><p>348 Build with support for <acronym class="acronym">SSL</acronym> (encrypted)349 connections. The only <em class="replaceable"><code>LIBRARY</code></em>350 supported is <code class="option">openssl</code>. This requires the351 <span class="productname">OpenSSL</span> package to be installed.352 <code class="filename">configure</code> will check for the required353 header files and libraries to make sure that your354 <span class="productname">OpenSSL</span> installation is sufficient355 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 required360 to be installed for GSSAPI. On many systems, the GSSAPI system (a part361 of the MIT Kerberos installation) is not installed in a location362 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 options364 <code class="option">--with-includes</code> and <code class="option">--with-libraries</code> in365 addition to this option. <code class="filename">configure</code> will check366 for the required header files and libraries to make sure that367 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.7.4.5.3.12.2.1.2" class="indexterm"></a>370 support for authentication and connection parameter lookup (see371 <span id="INSTALL-LDAP-LINKS" class="phrase"><a class="xref" href="libpq-ldap.html" title="34.18. LDAP Lookup of Connection Parameters">Section 34.18</a> and372 <a class="xref" href="auth-ldap.html" title="21.10. LDAP Authentication">Section 21.10</a></span> for more information). On Unix,373 this requires the <span class="productname">OpenLDAP</span> package to be374 installed. On Windows, the default <span class="productname">WinLDAP</span>375 library is used. <code class="filename">configure</code> will check for the required376 header files and libraries to make sure that your377 <span class="productname">OpenLDAP</span> installation is sufficient before378 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.7.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 is385 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 support388 for <span class="application">systemd</span><a id="id-1.6.4.7.4.5.3.15.2.1.2" class="indexterm"></a>389 service notifications. This improves integration if the server390 is started under <span class="application">systemd</span> but has no impact391 otherwise<span class="phrase">; see <a class="xref" href="server-start.html" title="19.3. Starting the Database Server">Section 19.3</a> for more392 information</span>. <span class="application">libsystemd</span> and the393 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> module400 (which provides functions to generate UUIDs), using the specified401 UUID library.<a id="id-1.6.4.7.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 FreeBSD405 and some other BSD-derived systems406 </p></li><li class="listitem"><p>407 <code class="option">e2fs</code> to use the UUID library created by408 the <code class="literal">e2fsprogs</code> project; this library is present in most409 Linux systems and in macOS, and can be obtained for other410 platforms as well411 </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-LIBXML"><span class="term"><code class="option">--with-libxml</code></span> <a href="#CONFIGURE-OPTION-WITH-LIBXML" class="id_link">#</a></dt><dd><p>416 Build with libxml2, enabling SQL/XML support. Libxml2 version 2.6.23 or417 later is required for this feature.418 </p><p>419 To detect the required compiler and linker options, PostgreSQL will420 query <code class="command">pkg-config</code>, if that is installed and knows421 about libxml2. Otherwise the program <code class="command">xml2-config</code>,422 which is installed by libxml2, will be used if it is found. Use423 of <code class="command">pkg-config</code> is preferred, because it can deal424 with multi-architecture installations better.425 </p><p>426 To use a libxml2 installation that is in an unusual location, you427 can set <code class="command">pkg-config</code>-related environment428 variables (see its documentation), or set the environment variable429 <code class="envar">XML2_CONFIG</code> to point to430 the <code class="command">xml2-config</code> program belonging to the libxml2431 installation, or set the variables <code class="envar">XML2_CFLAGS</code>432 and <code class="envar">XML2_LIBS</code>. (If <code class="command">pkg-config</code> is433 installed, then to override its idea of where libxml2 is you must434 either set <code class="envar">XML2_CONFIG</code> or set435 both <code class="envar">XML2_CFLAGS</code> and <code class="envar">XML2_LIBS</code> to436 nonempty strings.)437 </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>438 Build with libxslt, enabling the439 <a class="xref" href="xml2.html" title="F.50. xml2 — XPath querying and XSLT functionality">xml2</a>440 module to perform XSL transformations of XML.441 <code class="option">--with-libxml</code> must be specified as well.442 </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>443 The options described in this section allow disabling444 certain <span class="productname">PostgreSQL</span> features that are built445 by default, but which might need to be turned off if the required446 software or system features are not available. Using these options is447 not recommended unless really necessary.448 </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>449 Build without support for the450 <span class="productname">ICU</span><a id="id-1.6.4.7.4.6.3.1.2.1.2" class="indexterm"></a>451 library, disabling the use of ICU collation features<span class="phrase"> (see <a class="xref" href="collation.html" title="24.2. Collation Support">Section 24.2</a>)</span>.452 </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>453 Prevents use of the <span class="application">Readline</span> library454 (and <span class="application">libedit</span> as well). This option disables455 command-line editing and history in456 <span class="application">psql</span>.457 </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>458 Favors the use of the BSD-licensed <span class="application">libedit</span> library459 rather than GPL-licensed <span class="application">Readline</span>. This option460 is significant only if you have both libraries installed; the461 default in that case is to use <span class="application">Readline</span>.462 </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>463 <a id="id-1.6.4.7.4.6.3.4.2.1.1" class="indexterm"></a>464 Prevents use of the <span class="application">Zlib</span> library.465 This disables466 support for compressed archives in <span class="application">pg_dump</span>467 and <span class="application">pg_restore</span>.468 </p></dd><dt id="CONFIGURE-OPTION-DISABLE-SPINLOCKS"><span class="term"><code class="option">--disable-spinlocks</code></span> <a href="#CONFIGURE-OPTION-DISABLE-SPINLOCKS" class="id_link">#</a></dt><dd><p>469 Allow the build to succeed even if <span class="productname">PostgreSQL</span>470 has no CPU spinlock support for the platform. The lack of471 spinlock support will result in very poor performance; therefore,472 this option should only be used if the build aborts and473 informs you that the platform lacks spinlock support. If this474 option is required to build <span class="productname">PostgreSQL</span> on475 your platform, please report the problem to the476 <span class="productname">PostgreSQL</span> developers.477 </p></dd><dt id="CONFIGURE-OPTION-DISABLE-ATOMICS"><span class="term"><code class="option">--disable-atomics</code></span> <a href="#CONFIGURE-OPTION-DISABLE-ATOMICS" class="id_link">#</a></dt><dd><p>478 Disable use of CPU atomic operations. This option does nothing on479 platforms that lack such operations. On platforms that do have480 them, this will result in poor performance. This option is only481 useful for debugging or making performance comparisons.482 </p></dd><dt id="CONFIGURE-OPTION-DISABLE-THREAD-SAFETY"><span class="term"><code class="option">--disable-thread-safety</code></span> <a href="#CONFIGURE-OPTION-DISABLE-THREAD-SAFETY" class="id_link">#</a></dt><dd><p>483 Disable the thread-safety of client libraries. This prevents484 concurrent threads in <span class="application">libpq</span> and485 <span class="application">ECPG</span> programs from safely controlling486 their private connection handles. Use this only on platforms487 with deficient threading support.488 </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>489 <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of490 directories that will be added to the list the compiler491 searches for header files. If you have optional packages492 (such as GNU <span class="application">Readline</span>) installed in a non-standard493 location,494 you have to use this option and probably also the corresponding495 <code class="option">--with-libraries</code> option.496 </p><p>497 Example: <code class="literal">--with-includes=/opt/gnu/include:/usr/sup/include</code>.498 </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>499 <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of500 directories to search for libraries. You will probably have501 to use this option (and the corresponding502 <code class="option">--with-includes</code> option) if you have packages503 installed in non-standard locations.504 </p><p>505 Example: <code class="literal">--with-libraries=/opt/gnu/lib:/usr/sup/lib</code>.506 </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>507 <a id="id-1.6.4.7.4.7.2.3.1.2" class="indexterm"></a>508 </span> <a href="#CONFIGURE-OPTION-WITH-SYSTEM-TZDATA" class="id_link">#</a></dt><dd><p>509 <span class="productname">PostgreSQL</span> includes its own time zone database,510 which it requires for date and time operations. This time zone511 database is in fact compatible with the IANA time zone512 database provided by many operating systems such as FreeBSD,513 Linux, and Solaris, so it would be redundant to install it again.514 When this option is used, the system-supplied time zone database515 in <em class="replaceable"><code>DIRECTORY</code></em> is used instead of the one516 included in the PostgreSQL source distribution.517 <em class="replaceable"><code>DIRECTORY</code></em> must be specified as an518 absolute path. <code class="filename">/usr/share/zoneinfo</code> is a519 likely directory on some operating systems. Note that the520 installation routine will not detect mismatching or erroneous time521 zone data. If you use this option, you are advised to run the522 regression tests to verify that the time zone data you have523 pointed to works correctly with <span class="productname">PostgreSQL</span>.524 </p><a id="id-1.6.4.7.4.7.2.3.2.2" class="indexterm"></a><p>525 This option is mainly aimed at binary package distributors526 who know their target operating system well. The main527 advantage of using this option is that the PostgreSQL package528 won't need to be upgraded whenever any of the many local529 daylight-saving time rules change. Another advantage is that530 PostgreSQL can be cross-compiled more straightforwardly if the531 time zone database files do not need to be built during the532 installation.533 </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>534 Append <em class="replaceable"><code>STRING</code></em> to the PostgreSQL version number. You535 can use this, for example, to mark binaries built from unreleased Git536 snapshots or containing custom patches with an extra version string,537 such as a <code class="command">git describe</code> identifier or a538 distribution package release number.539 </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>540 Do not mark <span class="productname">PostgreSQL</span>'s executables541 to indicate that they should search for shared libraries in the542 installation's library directory (see <code class="option">--libdir</code>).543 On most platforms, this marking uses an absolute path to the544 library directory, so that it will be unhelpful if you relocate545 the installation later. However, you will then need to provide546 some other way for the executables to find the shared libraries.547 Typically this requires configuring the operating system's548 dynamic linker to search the library directory; see549 <a class="xref" href="install-post.html#INSTALL-POST-SHLIBS" title="17.5.1. Shared Libraries">Section 17.5.1</a> for more detail.550 </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>551 It's fairly common, particularly for test builds, to adjust the552 default port number with <code class="option">--with-pgport</code>.553 The other options in this section are recommended only for advanced554 users.555 </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>556 Set <em class="replaceable"><code>NUMBER</code></em> as the default port number for557 server and clients. The default is 5432. The port can always558 be changed later on, but if you specify it here then both559 server and clients will have the same default compiled in,560 which can be very convenient. Usually the only good reason561 to select a non-default value is if you intend to run multiple562 <span class="productname">PostgreSQL</span> servers on the same machine.563 </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>564 The default name of the Kerberos service principal used565 by GSSAPI.566 <code class="literal">postgres</code> is the default. There's usually no567 reason to change this unless you are building for a Windows568 environment, in which case it must be set to upper case569 <code class="literal">POSTGRES</code>.570 </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>571 Set the <em class="firstterm">segment size</em>, in gigabytes. Large tables are572 divided into multiple operating-system files, each of size equal573 to the segment size. This avoids problems with file size limits574 that exist on many platforms. The default segment size, 1 gigabyte,575 is safe on all supported platforms. If your operating system has576 <span class="quote">“<span class="quote">largefile</span>”</span> support (which most do, nowadays), you can use577 a larger segment size. This can be helpful to reduce the number of578 file descriptors consumed when working with very large tables.579 But be careful not to select a value larger than is supported580 by your platform and the file systems you intend to use. Other581 tools you might wish to use, such as <span class="application">tar</span>, could582 also set limits on the usable file size.583 It is recommended, though not absolutely required, that this value584 be a power of 2.585 Note that changing this value breaks on-disk database compatibility,586 meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to587 a build with a different segment size.588 </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>589 Set the <em class="firstterm">block size</em>, in kilobytes. This is the unit590 of storage and I/O within tables. The default, 8 kilobytes,591 is suitable for most situations; but other values may be useful592 in special cases.593 The value must be a power of 2 between 1 and 32 (kilobytes).594 Note that changing this value breaks on-disk database compatibility,595 meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to596 a build with a different block size.597 </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>598 Set the <em class="firstterm">WAL block size</em>, in kilobytes. This is the unit599 of storage and I/O within the WAL log. The default, 8 kilobytes,600 is suitable for most situations; but other values may be useful601 in special cases.602 The value must be a power of 2 between 1 and 64 (kilobytes).603 Note that changing this value breaks on-disk database compatibility,604 meaning you cannot use <code class="command">pg_upgrade</code> to upgrade to605 a build with a different WAL block size.606 </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>607 Most of the options in this section are only of interest for608 developing or debugging <span class="productname">PostgreSQL</span>.609 They are not recommended for production builds, except610 for <code class="option">--enable-debug</code>, which can be useful to enable611 detailed bug reports in the unlucky event that you encounter a bug.612 On platforms supporting DTrace, <code class="option">--enable-dtrace</code>613 may also be reasonable to use in production.614 </p><p>615 When building an installation that will be used to develop code inside616 the server, it is recommended to use at least the617 options <code class="option">--enable-debug</code>618 and <code class="option">--enable-cassert</code>.619 </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>620 Compiles all programs and libraries with debugging symbols.621 This means that you can run the programs in a debugger622 to analyze problems. This enlarges the size of the installed623 executables considerably, and on non-GCC compilers it usually624 also disables compiler optimization, causing slowdowns. However,625 having the symbols available is extremely helpful for dealing626 with any problems that might arise. Currently, this option is627 recommended for production installations only if you use GCC.628 But you should always have it on if you are doing development work629 or running a beta version.630 </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>631 Enables <em class="firstterm">assertion</em> checks in the server, which test for632 many <span class="quote">“<span class="quote">cannot happen</span>”</span> conditions. This is invaluable for633 code development purposes, but the tests can slow down the634 server significantly.635 Also, having the tests turned on won't necessarily enhance the636 stability of your server! The assertion checks are not categorized637 for severity, and so what might be a relatively harmless bug will638 still lead to server restarts if it triggers an assertion639 failure. This option is not recommended for production use, but640 you should have it on for development work or when running a beta641 version.642 </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>643 Enable tests using the Perl TAP tools. This requires a Perl644 installation and the Perl module <code class="literal">IPC::Run</code>.645 <span class="phrase">See <a class="xref" href="regress-tap.html" title="33.4. TAP Tests">Section 33.4</a> for more information.</span>646 </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>647 Enables automatic dependency tracking. With this option, the648 makefiles are set up so that all affected object files will649 be rebuilt when any header file is changed. This is useful650 if you are doing development work, but is just wasted overhead651 if you intend only to compile once and install. At present,652 this option only works with GCC.653 </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>654 If using GCC, all programs and libraries are compiled with655 code coverage testing instrumentation. When run, they656 generate files in the build directory with code coverage657 metrics.658 <span class="phrase">See <a class="xref" href="regress-coverage.html" title="33.5. Test Coverage Examination">Section 33.5</a>659 for more information.</span> This option is for use only with GCC660 and when doing development work.661 </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>662 If using GCC, all programs and libraries are compiled so they663 can be profiled. On backend exit, a subdirectory will be created664 that contains the <code class="filename">gmon.out</code> file containing665 profile data.666 This option is for use only with GCC and when doing development work.667 </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>668 <a id="id-1.6.4.7.4.9.4.7.2.1.1" class="indexterm"></a>669 Compiles <span class="productname">PostgreSQL</span> with support for the670 dynamic tracing tool DTrace.671 <span class="phrase">See <a class="xref" href="dynamic-trace.html" title="28.5. Dynamic Tracing">Section 28.5</a>672 for more information.</span>673 </p><p>674 To point to the <code class="command">dtrace</code> program, the675 environment variable <code class="envar">DTRACE</code> can be set. This676 will often be necessary because <code class="command">dtrace</code> is677 typically installed under <code class="filename">/usr/sbin</code>,678 which might not be in your <code class="envar">PATH</code>.679 </p><p>680 Extra command-line options for the <code class="command">dtrace</code> program681 can be specified in the environment variable682 <code class="envar">DTRACEFLAGS</code>. On Solaris,683 to include DTrace support in a 64-bit binary, you must specify684 <code class="literal">DTRACEFLAGS="-64"</code>. For example,685 using the GCC compiler:686</p><pre class="screen">687./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...688</pre><p>689 Using Sun's compiler:690</p><pre class="screen">691./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...692</pre><p>693 </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>694 Specify the relation segment size in blocks. If both695 <code class="option">--with-segsize</code> and this option are specified, this696 option wins.697 698 This option is only for developers, to test segment related code.699 </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.7.5.2" class="indexterm"></a><p>700 In addition to the ordinary command-line options described above,701 <code class="filename">configure</code> responds to a number of environment702 variables.703 You can specify environment variables on the704 <code class="filename">configure</code> command line, for example:705</p><pre class="screen">706<strong class="userinput"><code>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</code></strong>707</pre><p>708 In this usage an environment variable is little different from a709 command-line option.710 You can also set such variables beforehand:711</p><pre class="screen">712<strong class="userinput"><code>export CC=/opt/bin/gcc</code></strong>713<strong class="userinput"><code>export CFLAGS='-O2 -pipe'</code></strong>714<strong class="userinput"><code>./configure</code></strong>715</pre><p>716 This usage can be convenient because many programs' configuration717 scripts respond to these variables in similar ways.718 </p><p>719 The most commonly used of these environment variables are720 <code class="envar">CC</code> and <code class="envar">CFLAGS</code>.721 If you prefer a C compiler different from the one722 <code class="filename">configure</code> picks, you can set the723 variable <code class="envar">CC</code> to the program of your choice.724 By default, <code class="filename">configure</code> will pick725 <code class="filename">gcc</code> if available, else the platform's726 default (usually <code class="filename">cc</code>). Similarly, you can override the727 default compiler flags if needed with the <code class="envar">CFLAGS</code> variable.728 </p><p>729 Here is a list of the significant variables that can be set in730 this manner:731 732 </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>733 Bison program734 </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>735 C compiler736 </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>737 options to pass to the C compiler738 </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>739 path to <code class="command">clang</code> program used to process source code740 for inlining when compiling with <code class="literal">--with-llvm</code>741 </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>742 C preprocessor743 </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>744 options to pass to the C preprocessor745 </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>746 C++ compiler747 </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>748 options to pass to the C++ compiler749 </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>750 location of the <code class="command">dtrace</code> program751 </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>752 options to pass to the <code class="command">dtrace</code> program753 </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>754 Flex program755 </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>756 options to use when linking either executables or shared libraries757 </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>758 additional options for linking executables only759 </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>760 additional options for linking shared libraries only761 </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>762 <code class="command">llvm-config</code> program used to locate the763 <span class="productname">LLVM</span> installation764 </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>765 <code class="command">msgfmt</code> program for native language support766 </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>767 Perl interpreter program. This will be used to determine the768 dependencies for building PL/Perl. The default is769 <code class="command">perl</code>.770 </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>771 Python interpreter program. This will be used to determine the772 dependencies for building PL/Python. If this is not set, the773 following are probed in this order:774 <code class="literal">python3 python</code>.775 </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>776 Tcl interpreter program. This will be used to777 determine the dependencies for building PL/Tcl.778 If this is not set, the following are probed in this779 order: <code class="literal">tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85780 tclsh8.4 tclsh84</code>.781 </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>782 <code class="command">xml2-config</code> program used to locate the783 libxml2 installation784 </p></dd></dl></div><p>785 </p><p>786 Sometimes it is useful to add compiler flags after-the-fact to the set787 that were chosen by <code class="filename">configure</code>. An important example is788 that <span class="application">gcc</span>'s <code class="option">-Werror</code> option cannot be included789 in the <code class="envar">CFLAGS</code> passed to <code class="filename">configure</code>, because790 it will break many of <code class="filename">configure</code>'s built-in tests. To add791 such flags, include them in the <code class="envar">COPT</code> environment variable792 while running <code class="filename">make</code>. The contents of <code class="envar">COPT</code>793 are added to both the <code class="envar">CFLAGS</code> and <code class="envar">LDFLAGS</code>794 options set up by <code class="filename">configure</code>. For example, you could do795</p><pre class="screen">796<strong class="userinput"><code>make COPT='-Werror'</code></strong>797</pre><p>798 or799</p><pre class="screen">800<strong class="userinput"><code>export COPT='-Werror'</code></strong>801<strong class="userinput"><code>make</code></strong>802</pre><p>803 </p><div class="note"><h3 class="title">Note</h3><p>804 If using GCC, it is best to build with an optimization level of805 at least <code class="option">-O1</code>, because using no optimization806 (<code class="option">-O0</code>) disables some important compiler warnings (such807 as the use of uninitialized variables). However, non-zero808 optimization levels can complicate debugging because stepping809 through compiled code will usually not match up one-to-one with810 source code lines. If you get confused while trying to debug811 optimized code, recompile the specific files of interest with812 <code class="option">-O0</code>. An easy way to do this is by passing an option813 to <span class="application">make</span>: <code class="command">make PROFILE=-O0 file.o</code>.814 </p><p>815 The <code class="envar">COPT</code> and <code class="envar">PROFILE</code> environment variables are816 actually handled identically by the <span class="productname">PostgreSQL</span>817 makefiles. Which to use is a matter of preference, but a common habit818 among developers is to use <code class="envar">PROFILE</code> for one-time flag819 adjustments, while <code class="envar">COPT</code> might be kept set all the time.820 </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 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 17.4. Building and Installation with Meson</td></tr></table></div></body></html>