|
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!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>16.4. Installation Procedure</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 V1.79.1" /><link rel="prev" href="install-getsource.html" title="16.3. Getting the Source" /><link rel="next" href="install-post.html" title="16.5. Post-Installation Setup" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">16.4. Installation Procedure</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="install-getsource.html" title="16.3. Getting the Source">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="installation.html" title="Chapter 16. Installation from Source Code">Up</a></td><th width="60%" align="center">Chapter 16. Installation from Source Code</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="install-post.html" title="16.5. Post-Installation Setup">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="INSTALL-PROCEDURE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">16.4. Installation Procedure</h2></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.3.8.2.1.2" class="indexterm"></a><p>
- The first step of the installation procedure is to configure the
- source tree for your system and choose the options you would like.
- This is done by running the <code class="filename">configure</code> script. For a
- default installation simply enter:
- </p><pre class="screen">
- <strong class="userinput"><code>./configure</code></strong>
- </pre><p>
- This script will run a number of tests to determine values for various
- system dependent variables and detect any quirks of your
- operating system, and finally will create several files in the
- build tree to record what it found. You can also run
- <code class="filename">configure</code> in a directory outside the source
- tree, if you want to keep the build directory separate. This
- procedure is also called a
- <a id="id-1.6.3.8.2.1.3.4" class="indexterm"></a><em class="firstterm">VPATH</em>
- build. Here's how:
- </p><pre class="screen">
- <strong class="userinput"><code>mkdir build_dir</code></strong>
- <strong class="userinput"><code>cd build_dir</code></strong>
- <strong class="userinput"><code>/path/to/source/tree/configure [options go here]</code></strong>
- <strong class="userinput"><code>make</code></strong>
- </pre><p>
- </p><p>
- The default configuration will build the server and utilities, as
- well as all client applications and interfaces that require only a
- C compiler. All files will be installed under
- <code class="filename">/usr/local/pgsql</code> by default.
- </p><p>
- You can customize the build and installation process by supplying one
- or more of the following command line options to
- <code class="filename">configure</code>:
-
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--prefix=<em class="replaceable"><code>PREFIX</code></em></code></span></dt><dd><p>
- Install all files under the directory <em class="replaceable"><code>PREFIX</code></em>
- instead of <code class="filename">/usr/local/pgsql</code>. The actual
- files will be installed into various subdirectories; no files
- will ever be installed directly into the
- <em class="replaceable"><code>PREFIX</code></em> directory.
- </p><p>
- If you have special needs, you can also customize the
- individual subdirectories with the following options. However,
- if you leave these with their defaults, the installation will be
- relocatable, meaning you can move the directory after
- installation. (The <code class="literal">man</code> and <code class="literal">doc</code>
- locations are not affected by this.)
- </p><p>
- For relocatable installs, you might want to use
- <code class="filename">configure</code>'s <code class="literal">--disable-rpath</code>
- option. Also, you will need to tell the operating system how
- to find the shared libraries.
- </p></dd><dt><span class="term"><code class="option">--exec-prefix=<em class="replaceable"><code>EXEC-PREFIX</code></em></code></span></dt><dd><p>
- You can install architecture-dependent files under a
- different prefix, <em class="replaceable"><code>EXEC-PREFIX</code></em>, than what
- <em class="replaceable"><code>PREFIX</code></em> was set to. This can be useful to
- share architecture-independent files between hosts. If you
- omit this, then <em class="replaceable"><code>EXEC-PREFIX</code></em> is set equal to
- <em class="replaceable"><code>PREFIX</code></em> and both architecture-dependent and
- independent files will be installed under the same tree,
- which is probably what you want.
- </p></dd><dt><span class="term"><code class="option">--bindir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Specifies the directory for executable programs. The default
- is <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/bin</code>, which
- normally means <code class="filename">/usr/local/pgsql/bin</code>.
- </p></dd><dt><span class="term"><code class="option">--sysconfdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the directory for various configuration files,
- <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/etc</code> by default.
- </p></dd><dt><span class="term"><code class="option">--libdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the location to install libraries and dynamically loadable
- modules. The default is
- <code class="filename"><em class="replaceable"><code>EXEC-PREFIX</code></em>/lib</code>.
- </p></dd><dt><span class="term"><code class="option">--includedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the directory for installing C and C++ header files. The
- default is <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/include</code>.
- </p></dd><dt><span class="term"><code class="option">--datarootdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the root directory for various types of read-only data
- files. This only sets the default for some of the following
- options. The default is
- <code class="filename"><em class="replaceable"><code>PREFIX</code></em>/share</code>.
- </p></dd><dt><span class="term"><code class="option">--datadir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the directory for read-only data files used by the
- installed programs. The default is
- <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em></code>. Note that this has
- nothing to do with where your database files will be placed.
- </p></dd><dt><span class="term"><code class="option">--localedir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the directory for installing locale data, in particular
- message translation catalog files. The default is
- <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/locale</code>.
- </p></dd><dt><span class="term"><code class="option">--mandir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- The man pages that come with <span class="productname">PostgreSQL</span> will be installed under
- this directory, in their respective
- <code class="filename">man<em class="replaceable"><code>x</code></em></code> subdirectories.
- The default is <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/man</code>.
- </p></dd><dt><span class="term"><code class="option">--docdir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Sets the root directory for installing documentation files,
- except <span class="quote">“<span class="quote">man</span>”</span> pages. This only sets the default for
- the following options. The default value for this option is
- <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em>/doc/postgresql</code>.
- </p></dd><dt><span class="term"><code class="option">--htmldir=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- The HTML-formatted documentation for
- <span class="productname">PostgreSQL</span> will be installed under
- this directory. The default is
- <code class="filename"><em class="replaceable"><code>DATAROOTDIR</code></em></code>.
- </p></dd></dl></div><p>
-
- </p><div class="note"><h3 class="title">Note</h3><p>
- Care has been taken to make it possible to install
- <span class="productname">PostgreSQL</span> into shared installation locations
- (such as <code class="filename">/usr/local/include</code>) without
- interfering with the namespace of the rest of the system. First,
- the string <span class="quote">“<span class="quote"><code class="literal">/postgresql</code></span>”</span> is
- automatically appended to <code class="varname">datadir</code>,
- <code class="varname">sysconfdir</code>, and <code class="varname">docdir</code>,
- unless the fully expanded directory name already contains the
- string <span class="quote">“<span class="quote"><code class="literal">postgres</code></span>”</span> or
- <span class="quote">“<span class="quote"><code class="literal">pgsql</code></span>”</span>. For example, if you choose
- <code class="filename">/usr/local</code> as prefix, the documentation will
- be installed in <code class="filename">/usr/local/doc/postgresql</code>,
- but if the prefix is <code class="filename">/opt/postgres</code>, then it
- will be in <code class="filename">/opt/postgres/doc</code>. The public C
- header files of the client interfaces are installed into
- <code class="varname">includedir</code> and are namespace-clean. The
- internal header files and the server header files are installed
- into private directories under <code class="varname">includedir</code>. See
- the documentation of each interface for information about how to
- access its header files. Finally, a private subdirectory will
- also be created, if appropriate, under <code class="varname">libdir</code>
- for dynamically loadable modules.
- </p></div><p>
- </p><p>
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--with-extra-version=<em class="replaceable"><code>STRING</code></em></code></span></dt><dd><p>
- Append <em class="replaceable"><code>STRING</code></em> to the PostgreSQL version number. You
- can use this, for example, to mark binaries built from unreleased Git
- snapshots or containing custom patches with an extra version string
- such as a <code class="command">git describe</code> identifier or a
- distribution package release number.
- </p></dd><dt><span class="term"><code class="option">--with-includes=<em class="replaceable"><code>DIRECTORIES</code></em></code></span></dt><dd><p>
- <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
- directories that will be added to the list the compiler
- searches for header files. If you have optional packages
- (such as GNU <span class="application">Readline</span>) installed in a non-standard
- location,
- you have to use this option and probably also the corresponding
- <code class="option">--with-libraries</code> option.
- </p><p>
- Example: <code class="literal">--with-includes=/opt/gnu/include:/usr/sup/include</code>.
- </p></dd><dt><span class="term"><code class="option">--with-libraries=<em class="replaceable"><code>DIRECTORIES</code></em></code></span></dt><dd><p>
- <em class="replaceable"><code>DIRECTORIES</code></em> is a colon-separated list of
- directories to search for libraries. You will probably have
- to use this option (and the corresponding
- <code class="option">--with-includes</code> option) if you have packages
- installed in non-standard locations.
- </p><p>
- Example: <code class="literal">--with-libraries=/opt/gnu/lib:/usr/sup/lib</code>.
- </p></dd><dt><span class="term"><code class="option">--enable-nls[<span class="optional">=<em class="replaceable"><code>LANGUAGES</code></em></span>]</code></span></dt><dd><p>
- Enables Native Language Support (<acronym class="acronym">NLS</acronym>),
- that is, the ability to display a program's messages in a
- language other than English.
- <em class="replaceable"><code>LANGUAGES</code></em> is an optional space-separated
- list of codes of the languages that you want supported, for
- example <code class="literal">--enable-nls='de fr'</code>. (The intersection
- between your list and the set of actually provided
- translations will be computed automatically.) If you do not
- specify a list, then all available translations are
- installed.
- </p><p>
- To use this option, you will need an implementation of the
- <span class="application">Gettext</span> API; see above.
- </p></dd><dt><span class="term"><code class="option">--with-pgport=<em class="replaceable"><code>NUMBER</code></em></code></span></dt><dd><p>
- Set <em class="replaceable"><code>NUMBER</code></em> as the default port number for
- server and clients. The default is 5432. The port can always
- be changed later on, but if you specify it here then both
- server and clients will have the same default compiled in,
- which can be very convenient. Usually the only good reason
- to select a non-default value is if you intend to run multiple
- <span class="productname">PostgreSQL</span> servers on the same machine.
- </p></dd><dt><span class="term"><code class="option">--with-perl</code></span></dt><dd><p>
- Build the <span class="application">PL/Perl</span> server-side language.
- </p></dd><dt><span class="term"><code class="option">--with-python</code></span></dt><dd><p>
- Build the <span class="application">PL/Python</span> server-side language.
- </p></dd><dt><span class="term"><code class="option">--with-tcl</code></span></dt><dd><p>
- Build the <span class="application">PL/Tcl</span> server-side language.
- </p></dd><dt><span class="term"><code class="option">--with-tclconfig=<em class="replaceable"><code>DIRECTORY</code></em></code></span></dt><dd><p>
- Tcl installs the file <code class="filename">tclConfig.sh</code>, which
- contains configuration information needed to build modules
- interfacing to Tcl. This file is normally found automatically
- at a well-known location, but if you want to use a different
- version of Tcl you can specify the directory in which to look
- for it.
- </p></dd><dt><span class="term"><code class="option">--with-gssapi</code></span></dt><dd><p>
- Build with support for GSSAPI authentication. On many
- systems, the GSSAPI (usually a part of the Kerberos installation)
- system is not installed in a location
- that is searched by default (e.g., <code class="filename">/usr/include</code>,
- <code class="filename">/usr/lib</code>), so you must use the options
- <code class="option">--with-includes</code> and <code class="option">--with-libraries</code> in
- addition to this option. <code class="filename">configure</code> will check
- for the required header files and libraries to make sure that
- your GSSAPI installation is sufficient before proceeding.
- </p></dd><dt><span class="term"><code class="option">--with-krb-srvnam=<em class="replaceable"><code>NAME</code></em></code></span></dt><dd><p>
- The default name of the Kerberos service principal used
- by GSSAPI.
- <code class="literal">postgres</code> is the default. There's usually no
- reason to change this unless you have a Windows environment,
- in which case it must be set to upper case
- <code class="literal">POSTGRES</code>.
- </p></dd><dt id="CONFIGURE-WITH-LLVM"><span class="term"><code class="option">--with-llvm</code></span></dt><dd><p>
- Build with support for <span class="productname">LLVM</span> based
- <acronym class="acronym">JIT</acronym> compilation<span class="phrase"> (see <a class="xref" href="jit.html" title="Chapter 31. Just-in-Time Compilation (JIT)">Chapter 31</a>)</span>. This
- requires the <span class="productname">LLVM</span> library to be installed.
- The minimum required version of <span class="productname">LLVM</span> is
- currently 3.9.
- </p><p>
- <code class="command">llvm-config</code><a id="id-1.6.3.8.2.1.6.1.12.2.2.2" class="indexterm"></a>
- will be used to find the required compilation options.
- <code class="command">llvm-config</code>, and then
- <code class="command">llvm-config-$major-$minor</code> for all supported
- versions, will be searched on <code class="envar">PATH</code>. If that would not
- yield the correct binary, use <code class="envar">LLVM_CONFIG</code> to specify a
- path to the correct <code class="command">llvm-config</code>. For example
- </p><pre class="programlisting">
- ./configure ... --with-llvm LLVM_CONFIG='/path/to/llvm/bin/llvm-config'
- </pre><p>
- </p><p>
- <span class="productname">LLVM</span> support requires a compatible
- <code class="command">clang</code> compiler (specified, if necessary, using the
- <code class="envar">CLANG</code> environment variable), and a working C++
- compiler (specified, if necessary, using the <code class="envar">CXX</code>
- environment variable).
- </p></dd><dt><span class="term"><code class="option">--with-icu</code></span></dt><dd><p>
- Build with support for
- the <span class="productname">ICU</span><a id="id-1.6.3.8.2.1.6.1.13.2.1.2" class="indexterm"></a>
- library. This requires the <span class="productname">ICU4C</span> package
- to be installed. The minimum required version
- of <span class="productname">ICU4C</span> is currently 4.2.
- </p><p>
- By default,
- <span class="productname">pkg-config</span><a id="id-1.6.3.8.2.1.6.1.13.2.2.2" class="indexterm"></a>
- will be used to find the required compilation options. This is
- supported for <span class="productname">ICU4C</span> version 4.6 and later.
- For older versions, or if <span class="productname">pkg-config</span> is
- not available, the variables <code class="envar">ICU_CFLAGS</code>
- and <code class="envar">ICU_LIBS</code> can be specified
- to <code class="filename">configure</code>, like in this example:
- </p><pre class="programlisting">
- ./configure ... --with-icu ICU_CFLAGS='-I/some/where/include' ICU_LIBS='-L/some/where/lib -licui18n -licuuc -licudata'
- </pre><p>
- (If <span class="productname">ICU4C</span> is in the default search path
- for the compiler, then you still need to specify a nonempty string in
- order to avoid use of <span class="productname">pkg-config</span>, for
- example, <code class="literal">ICU_CFLAGS=' '</code>.)
- </p></dd><dt><span class="term"><code class="option">--with-openssl</code>
- <a id="id-1.6.3.8.2.1.6.1.14.1.2" class="indexterm"></a>
- </span></dt><dd><p>
- Build with support for <acronym class="acronym">SSL</acronym> (encrypted)
- connections. This requires the <span class="productname">OpenSSL</span>
- package to be installed. <code class="filename">configure</code> will check
- for the required header files and libraries to make sure that
- your <span class="productname">OpenSSL</span> installation is sufficient
- before proceeding.
- </p></dd><dt><span class="term"><code class="option">--with-pam</code></span></dt><dd><p>
- Build with <acronym class="acronym">PAM</acronym><a id="id-1.6.3.8.2.1.6.1.15.2.1.2" class="indexterm"></a>
- (Pluggable Authentication Modules) support.
- </p></dd><dt><span class="term"><code class="option">--with-bsd-auth</code></span></dt><dd><p>
- Build with BSD Authentication support.
- (The BSD Authentication framework is
- currently only available on OpenBSD.)
- </p></dd><dt><span class="term"><code class="option">--with-ldap</code></span></dt><dd><p>
- Build with <acronym class="acronym">LDAP</acronym><a id="id-1.6.3.8.2.1.6.1.17.2.1.2" class="indexterm"></a>
- support for authentication and connection parameter lookup (see
- <span id="INSTALL-LDAP-LINKS" class="phrase"><a class="xref" href="libpq-ldap.html" title="33.17. LDAP Lookup of Connection Parameters">Section 33.17</a> and
- <a class="xref" href="auth-ldap.html" title="20.10. LDAP Authentication">Section 20.10</a></span> for more information). On Unix,
- this requires the <span class="productname">OpenLDAP</span> package to be
- installed. On Windows, the default <span class="productname">WinLDAP</span>
- library is used. <code class="filename">configure</code> will check for the required
- header files and libraries to make sure that your
- <span class="productname">OpenLDAP</span> installation is sufficient before
- proceeding.
- </p></dd><dt><span class="term"><code class="option">--with-systemd</code></span></dt><dd><p>
- Build with support
- for <span class="application">systemd</span><a id="id-1.6.3.8.2.1.6.1.18.2.1.2" class="indexterm"></a>
- service notifications. This improves integration if the server binary
- is started under <span class="application">systemd</span> but has no impact
- otherwise<span class="phrase">; see <a class="xref" href="server-start.html" title="18.3. Starting the Database Server">Section 18.3</a> for more
- information</span>. <span class="application">libsystemd</span> and the
- associated header files need to be installed to be able to use this
- option.
- </p></dd><dt><span class="term"><code class="option">--without-readline</code></span></dt><dd><p>
- Prevents use of the <span class="application">Readline</span> library
- (and <span class="application">libedit</span> as well). This option disables
- command-line editing and history in
- <span class="application">psql</span>, so it is not recommended.
- </p></dd><dt><span class="term"><code class="option">--with-libedit-preferred</code></span></dt><dd><p>
- Favors the use of the BSD-licensed <span class="application">libedit</span> library
- rather than GPL-licensed <span class="application">Readline</span>. This option
- is significant only if you have both libraries installed; the
- default in that case is to use <span class="application">Readline</span>.
- </p></dd><dt><span class="term"><code class="option">--with-bonjour</code></span></dt><dd><p>
- Build with Bonjour support. This requires Bonjour support
- in your operating system. Recommended on macOS.
- </p></dd><dt><span class="term"><code class="option">--with-uuid=<em class="replaceable"><code>LIBRARY</code></em></code></span></dt><dd><p>
- Build the <a class="xref" href="uuid-ossp.html" title="F.44. uuid-ossp">uuid-ossp</a> module
- (which provides functions to generate UUIDs), using the specified
- UUID library.<a id="id-1.6.3.8.2.1.6.1.22.2.1.2" class="indexterm"></a>
- <em class="replaceable"><code>LIBRARY</code></em> must be one of:
- </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
- <code class="option">bsd</code> to use the UUID functions found in FreeBSD, NetBSD,
- and some other BSD-derived systems
- </p></li><li class="listitem"><p>
- <code class="option">e2fs</code> to use the UUID library created by
- the <code class="literal">e2fsprogs</code> project; this library is present in most
- Linux systems and in macOS, and can be obtained for other
- platforms as well
- </p></li><li class="listitem"><p>
- <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>
- </p></li></ul></div></dd><dt><span class="term"><code class="option">--with-ossp-uuid</code></span></dt><dd><p>
- Obsolete equivalent of <code class="literal">--with-uuid=ossp</code>.
- </p></dd><dt><span class="term"><code class="option">--with-libxml</code></span></dt><dd><p>
- Build with libxml2, enabling SQL/XML support. Libxml2 version 2.6.23 or
- later is required for this feature.
- </p><p>
- To detect the required compiler and linker options, PostgreSQL will
- query <code class="command">pkg-config</code>, if that is installed and knows
- about libxml2. Otherwise the program <code class="command">xml2-config</code>,
- which is installed by libxml2, will be used if it is found. Use
- of <code class="command">pkg-config</code> is preferred, because it can deal
- with multi-architecture installations better.
- </p><p>
- To use a libxml2 installation that is in an unusual location, you
- can set <code class="command">pkg-config</code>-related environment
- variables (see its documentation), or set the environment variable
- <code class="envar">XML2_CONFIG</code> to point to
- the <code class="command">xml2-config</code> program belonging to the libxml2
- installation, or set the variables <code class="envar">XML2_CFLAGS</code>
- and <code class="envar">XML2_LIBS</code>. (If <code class="command">pkg-config</code> is
- installed, then to override its idea of where libxml2 is you must
- either set <code class="envar">XML2_CONFIG</code> or set
- both <code class="envar">XML2_CFLAGS</code> and <code class="envar">XML2_LIBS</code> to
- nonempty strings.)
- </p></dd><dt><span class="term"><code class="option">--with-libxslt</code></span></dt><dd><p>
- Use libxslt when building the
- <a class="xref" href="xml2.html" title="F.45. xml2">xml2</a>
- module. <span class="application">xml2</span> relies on this library
- to perform XSL transformations of XML.
- </p></dd><dt><span class="term"><code class="option">--disable-float4-byval</code></span></dt><dd><p>
- Disable passing float4 values <span class="quote">“<span class="quote">by value</span>”</span>, causing them
- to be passed <span class="quote">“<span class="quote">by reference</span>”</span> instead. This option costs
- performance, but may be needed for compatibility with old
- user-defined functions that are written in C and use the
- <span class="quote">“<span class="quote">version 0</span>”</span> calling convention. A better long-term
- solution is to update any such functions to use the
- <span class="quote">“<span class="quote">version 1</span>”</span> calling convention.
- </p></dd><dt><span class="term"><code class="option">--disable-float8-byval</code></span></dt><dd><p>
- Disable passing float8 values <span class="quote">“<span class="quote">by value</span>”</span>, causing them
- to be passed <span class="quote">“<span class="quote">by reference</span>”</span> instead. This option costs
- performance, but may be needed for compatibility with old
- user-defined functions that are written in C and use the
- <span class="quote">“<span class="quote">version 0</span>”</span> calling convention. A better long-term
- solution is to update any such functions to use the
- <span class="quote">“<span class="quote">version 1</span>”</span> calling convention.
- Note that this option affects not only float8, but also int8 and some
- related types such as timestamp.
- On 32-bit platforms, <code class="option">--disable-float8-byval</code> is the default
- and it is not allowed to select <code class="option">--enable-float8-byval</code>.
- </p></dd><dt><span class="term"><code class="option">--with-segsize=<em class="replaceable"><code>SEGSIZE</code></em></code></span></dt><dd><p>
- Set the <em class="firstterm">segment size</em>, in gigabytes. Large tables are
- divided into multiple operating-system files, each of size equal
- to the segment size. This avoids problems with file size limits
- that exist on many platforms. The default segment size, 1 gigabyte,
- is safe on all supported platforms. If your operating system has
- <span class="quote">“<span class="quote">largefile</span>”</span> support (which most do, nowadays), you can use
- a larger segment size. This can be helpful to reduce the number of
- file descriptors consumed when working with very large tables.
- But be careful not to select a value larger than is supported
- by your platform and the file systems you intend to use. Other
- tools you might wish to use, such as <span class="application">tar</span>, could
- also set limits on the usable file size.
- It is recommended, though not absolutely required, that this value
- be a power of 2.
- Note that changing this value requires an initdb.
- </p></dd><dt><span class="term"><code class="option">--with-blocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span></dt><dd><p>
- Set the <em class="firstterm">block size</em>, in kilobytes. This is the unit
- of storage and I/O within tables. The default, 8 kilobytes,
- is suitable for most situations; but other values may be useful
- in special cases.
- The value must be a power of 2 between 1 and 32 (kilobytes).
- Note that changing this value requires an initdb.
- </p></dd><dt><span class="term"><code class="option">--with-wal-blocksize=<em class="replaceable"><code>BLOCKSIZE</code></em></code></span></dt><dd><p>
- Set the <em class="firstterm">WAL block size</em>, in kilobytes. This is the unit
- of storage and I/O within the WAL log. The default, 8 kilobytes,
- is suitable for most situations; but other values may be useful
- in special cases.
- The value must be a power of 2 between 1 and 64 (kilobytes).
- Note that changing this value requires an initdb.
- </p></dd><dt><span class="term"><code class="option">--disable-spinlocks</code></span></dt><dd><p>
- Allow the build to succeed even if <span class="productname">PostgreSQL</span>
- has no CPU spinlock support for the platform. The lack of
- spinlock support will result in poor performance; therefore,
- this option should only be used if the build aborts and
- informs you that the platform lacks spinlock support. If this
- option is required to build <span class="productname">PostgreSQL</span> on
- your platform, please report the problem to the
- <span class="productname">PostgreSQL</span> developers.
- </p></dd><dt><span class="term"><code class="option">--disable-thread-safety</code></span></dt><dd><p>
- Disable the thread-safety of client libraries. This prevents
- concurrent threads in <span class="application">libpq</span> and
- <span class="application">ECPG</span> programs from safely controlling
- their private connection handles.
- </p></dd><dt><span class="term"><code class="option">--with-system-tzdata=<em class="replaceable"><code>DIRECTORY</code></em></code>
- <a id="id-1.6.3.8.2.1.6.1.33.1.2" class="indexterm"></a>
- </span></dt><dd><p>
- <span class="productname">PostgreSQL</span> includes its own time zone database,
- which it requires for date and time operations. This time zone
- database is in fact compatible with the IANA time zone
- database provided by many operating systems such as FreeBSD,
- Linux, and Solaris, so it would be redundant to install it again.
- When this option is used, the system-supplied time zone database
- in <em class="replaceable"><code>DIRECTORY</code></em> is used instead of the one
- included in the PostgreSQL source distribution.
- <em class="replaceable"><code>DIRECTORY</code></em> must be specified as an
- absolute path. <code class="filename">/usr/share/zoneinfo</code> is a
- likely directory on some operating systems. Note that the
- installation routine will not detect mismatching or erroneous time
- zone data. If you use this option, you are advised to run the
- regression tests to verify that the time zone data you have
- pointed to works correctly with <span class="productname">PostgreSQL</span>.
- </p><a id="id-1.6.3.8.2.1.6.1.33.2.2" class="indexterm"></a><p>
- This option is mainly aimed at binary package distributors
- who know their target operating system well. The main
- advantage of using this option is that the PostgreSQL package
- won't need to be upgraded whenever any of the many local
- daylight-saving time rules change. Another advantage is that
- PostgreSQL can be cross-compiled more straightforwardly if the
- time zone database files do not need to be built during the
- installation.
- </p></dd><dt><span class="term"><code class="option">--without-zlib</code></span></dt><dd><p>
- <a id="id-1.6.3.8.2.1.6.1.34.2.1.1" class="indexterm"></a>
- Prevents use of the <span class="application">Zlib</span> library. This disables
- support for compressed archives in <span class="application">pg_dump</span>
- and <span class="application">pg_restore</span>.
- This option is only intended for those rare systems where this
- library is not available.
- </p></dd><dt><span class="term"><code class="option">--enable-debug</code></span></dt><dd><p>
- Compiles all programs and libraries with debugging symbols.
- This means that you can run the programs in a debugger
- to analyze problems. This enlarges the size of the installed
- executables considerably, and on non-GCC compilers it usually
- also disables compiler optimization, causing slowdowns. However,
- having the symbols available is extremely helpful for dealing
- with any problems that might arise. Currently, this option is
- recommended for production installations only if you use GCC.
- But you should always have it on if you are doing development work
- or running a beta version.
- </p></dd><dt><span class="term"><code class="option">--enable-coverage</code></span></dt><dd><p>
- If using GCC, all programs and libraries are compiled with
- code coverage testing instrumentation. When run, they
- generate files in the build directory with code coverage
- metrics.
- <span class="phrase">See <a class="xref" href="regress-coverage.html" title="32.5. Test Coverage Examination">Section 32.5</a>
- for more information.</span> This option is for use only with GCC
- and when doing development work.
- </p></dd><dt><span class="term"><code class="option">--enable-profiling</code></span></dt><dd><p>
- If using GCC, all programs and libraries are compiled so they
- can be profiled. On backend exit, a subdirectory will be created
- that contains the <code class="filename">gmon.out</code> file for use in profiling.
- This option is for use only with GCC and when doing development work.
- </p></dd><dt><span class="term"><code class="option">--enable-cassert</code></span></dt><dd><p>
- Enables <em class="firstterm">assertion</em> checks in the server, which test for
- many <span class="quote">“<span class="quote">cannot happen</span>”</span> conditions. This is invaluable for
- code development purposes, but the tests can slow down the
- server significantly.
- Also, having the tests turned on won't necessarily enhance the
- stability of your server! The assertion checks are not categorized
- for severity, and so what might be a relatively harmless bug will
- still lead to server restarts if it triggers an assertion
- failure. This option is not recommended for production use, but
- you should have it on for development work or when running a beta
- version.
- </p></dd><dt><span class="term"><code class="option">--enable-depend</code></span></dt><dd><p>
- Enables automatic dependency tracking. With this option, the
- makefiles are set up so that all affected object files will
- be rebuilt when any header file is changed. This is useful
- if you are doing development work, but is just wasted overhead
- if you intend only to compile once and install. At present,
- this option only works with GCC.
- </p></dd><dt><span class="term"><code class="option">--enable-dtrace</code></span></dt><dd><p>
- <a id="id-1.6.3.8.2.1.6.1.40.2.1.1" class="indexterm"></a>
- Compiles <span class="productname">PostgreSQL</span> with support for the
- dynamic tracing tool DTrace.
- <span class="phrase">See <a class="xref" href="dynamic-trace.html" title="27.5. Dynamic Tracing">Section 27.5</a>
- for more information.</span>
- </p><p>
- To point to the <code class="command">dtrace</code> program, the
- environment variable <code class="envar">DTRACE</code> can be set. This
- will often be necessary because <code class="command">dtrace</code> is
- typically installed under <code class="filename">/usr/sbin</code>,
- which might not be in the path.
- </p><p>
- Extra command-line options for the <code class="command">dtrace</code> program
- can be specified in the environment variable
- <code class="envar">DTRACEFLAGS</code>. On Solaris,
- to include DTrace support in a 64-bit binary, you must specify
- <code class="literal">DTRACEFLAGS="-64"</code> to configure. For example,
- using the GCC compiler:
- </p><pre class="screen">
- ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
- </pre><p>
- Using Sun's compiler:
- </p><pre class="screen">
- ./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...
- </pre><p>
- </p></dd><dt><span class="term"><code class="option">--enable-tap-tests</code></span></dt><dd><p>
- Enable tests using the Perl TAP tools. This requires a Perl
- installation and the Perl module <code class="literal">IPC::Run</code>.
- <span class="phrase">See <a class="xref" href="regress-tap.html" title="32.4. TAP Tests">Section 32.4</a> for more information.</span>
- </p></dd></dl></div><p>
- </p><p>
- If you prefer a C compiler different from the one
- <code class="filename">configure</code> picks, you can set the
- environment variable <code class="envar">CC</code> to the program of your choice.
- By default, <code class="filename">configure</code> will pick
- <code class="filename">gcc</code> if available, else the platform's
- default (usually <code class="filename">cc</code>). Similarly, you can override the
- default compiler flags if needed with the <code class="envar">CFLAGS</code> variable.
- </p><p>
- You can specify environment variables on the
- <code class="filename">configure</code> command line, for example:
- </p><pre class="screen">
- <strong class="userinput"><code>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</code></strong>
- </pre><p>
- </p><p>
- Here is a list of the significant variables that can be set in
- this manner:
-
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">BISON</code></span></dt><dd><p>
- Bison program
- </p></dd><dt><span class="term"><code class="envar">CC</code></span></dt><dd><p>
- C compiler
- </p></dd><dt><span class="term"><code class="envar">CFLAGS</code></span></dt><dd><p>
- options to pass to the C compiler
- </p></dd><dt><span class="term"><code class="envar">CLANG</code></span></dt><dd><p>
- path to <code class="command">clang</code> program used to process source code
- for inlining when compiling with <code class="literal">--with-llvm</code>
- </p></dd><dt><span class="term"><code class="envar">CPP</code></span></dt><dd><p>
- C preprocessor
- </p></dd><dt><span class="term"><code class="envar">CPPFLAGS</code></span></dt><dd><p>
- options to pass to the C preprocessor
- </p></dd><dt><span class="term"><code class="envar">CXX</code></span></dt><dd><p>
- C++ compiler
- </p></dd><dt><span class="term"><code class="envar">CXXFLAGS</code></span></dt><dd><p>
- options to pass to the C++ compiler
- </p></dd><dt><span class="term"><code class="envar">DTRACE</code></span></dt><dd><p>
- location of the <code class="command">dtrace</code> program
- </p></dd><dt><span class="term"><code class="envar">DTRACEFLAGS</code></span></dt><dd><p>
- options to pass to the <code class="command">dtrace</code> program
- </p></dd><dt><span class="term"><code class="envar">FLEX</code></span></dt><dd><p>
- Flex program
- </p></dd><dt><span class="term"><code class="envar">LDFLAGS</code></span></dt><dd><p>
- options to use when linking either executables or shared libraries
- </p></dd><dt><span class="term"><code class="envar">LDFLAGS_EX</code></span></dt><dd><p>
- additional options for linking executables only
- </p></dd><dt><span class="term"><code class="envar">LDFLAGS_SL</code></span></dt><dd><p>
- additional options for linking shared libraries only
- </p></dd><dt><span class="term"><code class="envar">LLVM_CONFIG</code></span></dt><dd><p>
- <code class="command">llvm-config</code> program used to locate the
- <span class="productname">LLVM</span> installation.
- </p></dd><dt><span class="term"><code class="envar">MSGFMT</code></span></dt><dd><p>
- <code class="command">msgfmt</code> program for native language support
- </p></dd><dt><span class="term"><code class="envar">PERL</code></span></dt><dd><p>
- Perl interpreter program. This will be used to determine the
- dependencies for building PL/Perl. The default is
- <code class="command">perl</code>.
- </p></dd><dt><span class="term"><code class="envar">PYTHON</code></span></dt><dd><p>
- Python interpreter program. This will be used to
- determine the dependencies for building PL/Python. Also,
- whether Python 2 or 3 is specified here (or otherwise
- implicitly chosen) determines which variant of the PL/Python
- language becomes available. See
- <a class="xref" href="plpython-python23.html" title="45.1. Python 2 vs. Python 3">Section 45.1</a>
- for more information. If this is not set, the following are probed
- in this order: <code class="literal">python python3 python2</code>.
- </p></dd><dt><span class="term"><code class="envar">TCLSH</code></span></dt><dd><p>
- Tcl interpreter program. This will be used to
- determine the dependencies for building PL/Tcl, and it will
- be substituted into Tcl scripts.
- </p></dd><dt><span class="term"><code class="envar">XML2_CONFIG</code></span></dt><dd><p>
- <code class="command">xml2-config</code> program used to locate the
- libxml2 installation
- </p></dd></dl></div><p>
- </p><p>
- Sometimes it is useful to add compiler flags after-the-fact to the set
- that were chosen by <code class="filename">configure</code>. An important example is
- that <span class="application">gcc</span>'s <code class="option">-Werror</code> option cannot be included
- in the <code class="envar">CFLAGS</code> passed to <code class="filename">configure</code>, because
- it will break many of <code class="filename">configure</code>'s built-in tests. To add
- such flags, include them in the <code class="envar">COPT</code> environment variable
- while running <code class="filename">make</code>. The contents of <code class="envar">COPT</code>
- are added to both the <code class="envar">CFLAGS</code> and <code class="envar">LDFLAGS</code>
- options set up by <code class="filename">configure</code>. For example, you could do
- </p><pre class="screen">
- <strong class="userinput"><code>make COPT='-Werror'</code></strong>
- </pre><p>
- or
- </p><pre class="screen">
- <strong class="userinput"><code>export COPT='-Werror'</code></strong>
- <strong class="userinput"><code>make</code></strong>
- </pre><p>
- </p><div class="note"><h3 class="title">Note</h3><p>
- When developing code inside the server, it is recommended to
- use the configure options <code class="option">--enable-cassert</code> (which
- turns on many run-time error checks) and <code class="option">--enable-debug</code>
- (which improves the usefulness of debugging tools).
- </p><p>
- If using GCC, it is best to build with an optimization level of
- at least <code class="option">-O1</code>, because using no optimization
- (<code class="option">-O0</code>) disables some important compiler warnings (such
- as the use of uninitialized variables). However, non-zero
- optimization levels can complicate debugging because stepping
- through compiled code will usually not match up one-to-one with
- source code lines. If you get confused while trying to debug
- optimized code, recompile the specific files of interest with
- <code class="option">-O0</code>. An easy way to do this is by passing an option
- to <span class="application">make</span>: <code class="command">make PROFILE=-O0 file.o</code>.
- </p><p>
- The <code class="envar">COPT</code> and <code class="envar">PROFILE</code> environment variables are
- actually handled identically by the <span class="productname">PostgreSQL</span>
- makefiles. Which to use is a matter of preference, but a common habit
- among developers is to use <code class="envar">PROFILE</code> for one-time flag
- adjustments, while <code class="envar">COPT</code> might be kept set all the time.
- </p></div></li><li class="step" id="BUILD"><p class="title"><strong>Build</strong></p><p>
- To start the build, type either of:
- </p><pre class="screen">
- <strong class="userinput"><code>make</code></strong>
- <strong class="userinput"><code>make all</code></strong>
- </pre><p>
- (Remember to use <acronym class="acronym">GNU</acronym> <span class="application">make</span>.)
- The build will take a few minutes depending on your
- hardware. The last line displayed should be:
- </p><pre class="screen">
- All of PostgreSQL successfully made. Ready to install.
- </pre><p>
- </p><p>
- If you want to build everything that can be built, including the
- documentation (HTML and man pages), and the additional modules
- (<code class="filename">contrib</code>), type instead:
- </p><pre class="screen">
- <strong class="userinput"><code>make world</code></strong>
- </pre><p>
- The last line displayed should be:
- </p><pre class="screen">
- PostgreSQL, contrib, and documentation successfully made. Ready to install.
- </pre><p>
- </p><p>
- If you want to invoke the build from another makefile rather than
- manually, you must unset <code class="varname">MAKELEVEL</code> or set it to zero,
- for instance like this:
- </p><pre class="programlisting">
- build-postgresql:
- $(MAKE) -C postgresql MAKELEVEL=0 all
- </pre><p>
- Failure to do that can lead to strange error messages, typically about
- missing header files.
- </p></li><li class="step"><p class="title"><strong>Regression Tests</strong></p><a id="id-1.6.3.8.2.3.2" class="indexterm"></a><p>
- If you want to test the newly built server before you install it,
- you can run the regression tests at this point. The regression
- tests are a test suite to verify that <span class="productname">PostgreSQL</span>
- runs on your machine in the way the developers expected it
- to. Type:
- </p><pre class="screen">
- <strong class="userinput"><code>make check</code></strong>
- </pre><p>
- (This won't work as root; do it as an unprivileged user.)
- See <a class="xref" href="regress.html" title="Chapter 32. Regression Tests">Chapter 32</a> for
- detailed information about interpreting the test results. You can
- repeat this test at any later time by issuing the same command.
- </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>
- If you are upgrading an existing system be sure to read
- <a class="xref" href="upgrading.html" title="18.6. Upgrading a PostgreSQL Cluster">Section 18.6</a>,
- which has instructions about upgrading a
- cluster.
- </p></div><p>
- To install <span class="productname">PostgreSQL</span> enter:
- </p><pre class="screen">
- <strong class="userinput"><code>make install</code></strong>
- </pre><p>
- This will install files into the directories that were specified
- in <a class="xref" href="install-procedure.html#CONFIGURE" title="Configuration">Step 1</a>. Make sure that you have appropriate
- permissions to write into that area. Normally you need to do this
- step as root. Alternatively, you can create the target
- directories in advance and arrange for appropriate permissions to
- be granted.
- </p><p>
- To install the documentation (HTML and man pages), enter:
- </p><pre class="screen">
- <strong class="userinput"><code>make install-docs</code></strong>
- </pre><p>
- </p><p>
- If you built the world above, type instead:
- </p><pre class="screen">
- <strong class="userinput"><code>make install-world</code></strong>
- </pre><p>
- This also installs the documentation.
- </p><p>
- You can use <code class="literal">make install-strip</code> instead of
- <code class="literal">make install</code> to strip the executable files and
- libraries as they are installed. This will save some space. If
- you built with debugging support, stripping will effectively
- remove the debugging support, so it should only be done if
- debugging is no longer needed. <code class="literal">install-strip</code>
- tries to do a reasonable job saving space, but it does not have
- perfect knowledge of how to strip every unneeded byte from an
- executable file, so if you want to save all the disk space you
- possibly can, you will have to do manual work.
- </p><p>
- The standard installation provides all the header files needed for client
- application development as well as for server-side program
- development, such as custom functions or data types written in C.
- (Prior to <span class="productname">PostgreSQL</span> 8.0, a separate <code class="literal">make
- install-all-headers</code> command was needed for the latter, but this
- step has been folded into the standard install.)
- </p><p><strong>Client-only installation: </strong>
- If you want to install only the client applications and
- interface libraries, then you can use these commands:
- </p><pre class="screen">
- <strong class="userinput"><code>make -C src/bin install</code></strong>
- <strong class="userinput"><code>make -C src/include install</code></strong>
- <strong class="userinput"><code>make -C src/interfaces install</code></strong>
- <strong class="userinput"><code>make -C doc install</code></strong>
- </pre><p>
- <code class="filename">src/bin</code> has a few binaries for server-only use,
- but they are small.
- </p></li></ol></div><p><strong>Uninstallation: </strong>
- To undo the installation use the command <code class="command">make
- uninstall</code>. However, this will not remove any created directories.
- </p><p><strong>Cleaning: </strong>
- After the installation you can free disk space by removing the built
- files from the source tree with the command <code class="command">make
- clean</code>. This will preserve the files made by the <code class="command">configure</code>
- program, so that you can rebuild everything with <code class="command">make</code>
- later on. To reset the source tree to the state in which it was
- distributed, use <code class="command">make distclean</code>. If you are going to
- build for several platforms within the same source tree you must do
- this and re-configure for each platform. (Alternatively, use
- a separate build tree for each platform, so that the source tree
- remains unmodified.)
- </p><p>
- If you perform a build and then discover that your <code class="command">configure</code>
- options were wrong, or if you change anything that <code class="command">configure</code>
- investigates (for example, software upgrades), then it's a good
- idea to do <code class="command">make distclean</code> before reconfiguring and
- rebuilding. Without this, your changes in configuration choices
- might not propagate everywhere they need to.
- </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install-getsource.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="installation.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="install-post.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">16.3. Getting the Source </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 16.5. Post-Installation Setup</td></tr></table></div></body></html>
|