ok
Direktori : /opt/alt/postgresql11/usr/share/doc/alt-postgresql11-9.2.24/html/ |
Current File : //opt/alt/postgresql11/usr/share/doc/alt-postgresql11-9.2.24/html/install-windows-full.html |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Building with Visual C++ or the Microsoft Windows SDK</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REV="MADE" HREF="mailto:pgsql-docs@postgresql.org"><LINK REL="HOME" TITLE="PostgreSQL 9.2.24 Documentation" HREF="index.html"><LINK REL="UP" TITLE="Installation from Source Code on Windows" HREF="install-windows.html"><LINK REL="PREVIOUS" TITLE="Installation from Source Code on Windows" HREF="install-windows.html"><LINK REL="NEXT" TITLE="Building libpq with Visual C++ or Borland C++" HREF="install-windows-libpq.html"><LINK REL="STYLESHEET" TYPE="text/css" HREF="stylesheet.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"><META NAME="creation" CONTENT="2017-11-06T22:43:11"></HEAD ><BODY CLASS="SECT1" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="5" ALIGN="center" VALIGN="bottom" ><A HREF="index.html" >PostgreSQL 9.2.24 Documentation</A ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A TITLE="Installation from Source Code on Windows" HREF="install-windows.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="10%" ALIGN="left" VALIGN="top" ><A HREF="install-windows.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="60%" ALIGN="center" VALIGN="bottom" >Chapter 16. Installation from Source Code on <SPAN CLASS="PRODUCTNAME" >Windows</SPAN ></TD ><TD WIDTH="20%" ALIGN="right" VALIGN="top" ><A TITLE="Building libpq with Visual C++ or Borland C++" HREF="install-windows-libpq.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="INSTALL-WINDOWS-FULL" >16.1. Building with <SPAN CLASS="PRODUCTNAME" >Visual C++</SPAN > or the <SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN ></A ></H1 ><P > PostgreSQL can be built using the Visual C++ compiler suite from Microsoft. These compilers can be either from <SPAN CLASS="PRODUCTNAME" >Visual Studio</SPAN >, <SPAN CLASS="PRODUCTNAME" >Visual Studio Express</SPAN > or some versions of the <SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN >. If you do not already have a <SPAN CLASS="PRODUCTNAME" >Visual Studio</SPAN > environment set up, the easiest ways are to use the compilers in the <SPAN CLASS="PRODUCTNAME" >Windows SDK 7.1</SPAN > or those from <SPAN CLASS="PRODUCTNAME" >Visual Studio Express 2012 for Windows Desktop</SPAN >, which are both free downloads from Microsoft. </P ><P > PostgreSQL is known to support compilation using the compilers shipped with <SPAN CLASS="PRODUCTNAME" >Visual Studio 2005</SPAN > to <SPAN CLASS="PRODUCTNAME" >Visual Studio 2012</SPAN > (including Express editions), as well as standalone Windows SDK releases 6.0 to 7.1. 64-bit PostgreSQL builds are only supported with <SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN > version 6.0a to 7.1 or <SPAN CLASS="PRODUCTNAME" >Visual Studio 2008</SPAN > and above. </P ><P > The tools for building using <SPAN CLASS="PRODUCTNAME" >Visual C++</SPAN >, are in the <TT CLASS="FILENAME" >src/tools/msvc</TT > directory. When building, make sure there are no tools from <SPAN CLASS="PRODUCTNAME" >MinGW</SPAN > or <SPAN CLASS="PRODUCTNAME" >Cygwin</SPAN > present in your system PATH. Also, make sure you have all the required Visual C++ tools available in the PATH. In <SPAN CLASS="PRODUCTNAME" >Visual Studio</SPAN >, start the <SPAN CLASS="APPLICATION" >Visual Studio Command Prompt</SPAN >. If you wish to build a 64-bit version, you must use the 64-bit version of the command, and vice versa. In the <SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN >, start the <SPAN CLASS="APPLICATION" >CMD shell</SPAN > listed under the SDK on the Start Menu. In recent SDK versions you can change the targeted CPU architecture by using the <TT CLASS="COMMAND" >setenv</TT > command. All commands should be run from the <TT CLASS="FILENAME" >src\tools\msvc</TT > directory. </P ><P > Before you build, you may need to edit the file <TT CLASS="FILENAME" >config.pl</TT > to reflect any configuration options you want to change, or the paths to any third party libraries to use. The complete configuration is determined by first reading and parsing the file <TT CLASS="FILENAME" >config_default.pl</TT >, and then apply any changes from <TT CLASS="FILENAME" >config.pl</TT >. For example, to specify the location of your <SPAN CLASS="PRODUCTNAME" >Python</SPAN > installation, put the following in <TT CLASS="FILENAME" >config.pl</TT >: </P><PRE CLASS="PROGRAMLISTING" >$config->{python} = 'c:\python26';</PRE ><P> You only need to specify those parameters that are different from what's in <TT CLASS="FILENAME" >config_default.pl</TT >. </P ><P > If you need to set any other environment variables, create a file called <TT CLASS="FILENAME" >buildenv.pl</TT > and put the required commands there. For example, to add the path for bison when it's not in the PATH, create a file containing: </P><PRE CLASS="PROGRAMLISTING" >$ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin';</PRE ><P> </P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26020" >16.1.1. Requirements</A ></H2 ><P > The following additional products are required to build <SPAN CLASS="PRODUCTNAME" >PostgreSQL</SPAN >. Use the <TT CLASS="FILENAME" >config.pl</TT > file to specify which directories the libraries are available in. <P ></P ></P><DIV CLASS="VARIABLELIST" ><DL ><DT ><SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN ></DT ><DD ><P > If your build environment doesn't ship with a supported version of the <SPAN CLASS="PRODUCTNAME" >Microsoft Windows SDK</SPAN > it is recommended that you upgrade to the latest version (currently version 7.1), available for download from <A HREF="https://www.microsoft.com/download" TARGET="_top" >https://www.microsoft.com/download</A >. </P ><P > You must always include the <SPAN CLASS="APPLICATION" >Windows Headers and Libraries</SPAN > part of the SDK. If you install a <SPAN CLASS="PRODUCTNAME" >Windows SDK</SPAN > including the <SPAN CLASS="APPLICATION" >Visual C++ Compilers</SPAN >, you don't need <SPAN CLASS="PRODUCTNAME" >Visual Studio</SPAN > to build. Note that as of Version 8.0a the Windows SDK no longer ships with a complete command-line build environment. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >ActiveState Perl</SPAN ></DT ><DD ><P > ActiveState Perl is required to run the build generation scripts. MinGW or Cygwin Perl will not work. It must also be present in the PATH. Binaries can be downloaded from <A HREF="http://www.activestate.com" TARGET="_top" >http://www.activestate.com</A > (Note: version 5.8.3 or later is required, the free Standard Distribution is sufficient). </P ></DD ></DL ></DIV ><P> </P ><P > The following additional products are not required to get started, but are required to build the complete package. Use the <TT CLASS="FILENAME" >config.pl</TT > file to specify which directories the libraries are available in. <P ></P ></P><DIV CLASS="VARIABLELIST" ><DL ><DT ><SPAN CLASS="PRODUCTNAME" >ActiveState TCL</SPAN ></DT ><DD ><P > Required for building <SPAN CLASS="APPLICATION" >PL/TCL</SPAN > (Note: version 8.4 is required, the free Standard Distribution is sufficient). </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >Bison</SPAN > and <SPAN CLASS="PRODUCTNAME" >Flex</SPAN ></DT ><DD ><P > Bison and Flex are required to build from Git, but not required when building from a release file. Note that only Bison 1.875 or versions 2.2 and later will work. Also, Flex version 2.5.31 or later is required. Bison can be downloaded from <A HREF="http://gnuwin32.sourceforge.net" TARGET="_top" >http://gnuwin32.sourceforge.net</A >. Flex can be downloaded from <A HREF="http://www.postgresql.org/ftp/misc/winflex/" TARGET="_top" >http://www.postgresql.org/ftp/misc/winflex/</A >. If you are using <SPAN CLASS="PRODUCTNAME" >msysGit</SPAN > for accessing the PostgreSQL <SPAN CLASS="PRODUCTNAME" >Git</SPAN > repository you probably already have recent versions of bison and flex in your <SPAN CLASS="PRODUCTNAME" >Git</SPAN > binary directory. </P ><DIV CLASS="NOTE" ><BLOCKQUOTE CLASS="NOTE" ><P ><B >Note: </B > The Bison distribution from GnuWin32 appears to have a bug that causes Bison to malfunction when installed in a directory with spaces in the name, such as the default location on English installations <TT CLASS="FILENAME" >C:\Program Files\GnuWin32</TT >. Consider installing into <TT CLASS="FILENAME" >C:\GnuWin32</TT > instead. </P ></BLOCKQUOTE ></DIV ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >Diff</SPAN ></DT ><DD ><P > Diff is required to run the regression tests, and can be downloaded from <A HREF="http://gnuwin32.sourceforge.net" TARGET="_top" >http://gnuwin32.sourceforge.net</A >. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >Gettext</SPAN ></DT ><DD ><P > Gettext is required to build with NLS support, and can be downloaded from <A HREF="http://gnuwin32.sourceforge.net" TARGET="_top" >http://gnuwin32.sourceforge.net</A >. Note that binaries, dependencies and developer files are all needed. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >MIT Kerberos</SPAN ></DT ><DD ><P > Required for Kerberos authentication support. MIT Kerberos can be downloaded from <A HREF="http://web.mit.edu/Kerberos/dist/index.html" TARGET="_top" >http://web.mit.edu/Kerberos/dist/index.html</A >. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >libxml2</SPAN > and <SPAN CLASS="PRODUCTNAME" >libxslt</SPAN ></DT ><DD ><P > Required for XML support. Binaries can be downloaded from <A HREF="http://zlatkovic.com/pub/libxml" TARGET="_top" >http://zlatkovic.com/pub/libxml</A > or source from <A HREF="http://xmlsoft.org" TARGET="_top" >http://xmlsoft.org</A >. Note that libxml2 requires iconv, which is available from the same download location. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >openssl</SPAN ></DT ><DD ><P > Required for SSL support. Binaries can be downloaded from <A HREF="http://www.slproweb.com/products/Win32OpenSSL.html" TARGET="_top" >http://www.slproweb.com/products/Win32OpenSSL.html</A > or source from <A HREF="http://www.openssl.org" TARGET="_top" >http://www.openssl.org</A >. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >ossp-uuid</SPAN ></DT ><DD ><P > Required for UUID-OSSP support (contrib only). Source can be downloaded from <A HREF="http://www.ossp.org/pkg/lib/uuid/" TARGET="_top" >http://www.ossp.org/pkg/lib/uuid/</A >. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >Python</SPAN ></DT ><DD ><P > Required for building <SPAN CLASS="APPLICATION" >PL/Python</SPAN >. Binaries can be downloaded from <A HREF="http://www.python.org" TARGET="_top" >http://www.python.org</A >. </P ></DD ><DT ><SPAN CLASS="PRODUCTNAME" >zlib</SPAN ></DT ><DD ><P > Required for compression support in <SPAN CLASS="APPLICATION" >pg_dump</SPAN > and <SPAN CLASS="APPLICATION" >pg_restore</SPAN >. Binaries can be downloaded from <A HREF="http://www.zlib.net" TARGET="_top" >http://www.zlib.net</A >. </P ></DD ></DL ></DIV ><P> </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26122" >16.1.2. Special Considerations for 64-bit Windows</A ></H2 ><P > PostgreSQL will only build for the x64 architecture on 64-bit Windows, there is no support for Itanium processors. </P ><P > Mixing 32- and 64-bit versions in the same build tree is not supported. The build system will automatically detect if it's running in a 32- or 64-bit environment, and build PostgreSQL accordingly. For this reason, it is important to start the correct command prompt before building. </P ><P > To use a server-side third party library such as <SPAN CLASS="PRODUCTNAME" >python</SPAN > or <SPAN CLASS="PRODUCTNAME" >openssl</SPAN >, this library <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >must</I ></SPAN > also be 64-bit. There is no support for loading a 32-bit library in a 64-bit server. Several of the third party libraries that PostgreSQL supports may only be available in 32-bit versions, in which case they cannot be used with 64-bit PostgreSQL. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26130" >16.1.3. Building</A ></H2 ><P > To build all of PostgreSQL in release configuration (the default), run the command: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >build</KBD ></PRE ><P> To build all of PostgreSQL in debug configuration, run the command: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >build DEBUG</KBD ></PRE ><P> To build just a single project, for example psql, run the commands: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >build psql</KBD > <KBD CLASS="USERINPUT" >build DEBUG psql</KBD ></PRE ><P> To change the default build configuration to debug, put the following in the <TT CLASS="FILENAME" >buildenv.pl</TT > file: </P><PRE CLASS="PROGRAMLISTING" >$ENV{CONFIG}="Debug";</PRE ><P> </P ><P > It is also possible to build from inside the Visual Studio GUI. In this case, you need to run: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >perl mkvcbuild.pl</KBD ></PRE ><P> from the command prompt, and then open the generated <TT CLASS="FILENAME" >pgsql.sln</TT > (in the root directory of the source tree) in Visual Studio. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26146" >16.1.4. Cleaning and Installing</A ></H2 ><P > Most of the time, the automatic dependency tracking in Visual Studio will handle changed files. But if there have been large changes, you may need to clean the installation. To do this, simply run the <TT CLASS="FILENAME" >clean.bat</TT > command, which will automatically clean out all generated files. You can also run it with the <TT CLASS="PARAMETER" >dist</TT > parameter, in which case it will behave like <KBD CLASS="USERINPUT" >make distclean</KBD > and remove the flex/bison output files as well. </P ><P > By default, all files are written into a subdirectory of the <TT CLASS="FILENAME" >debug</TT > or <TT CLASS="FILENAME" >release</TT > directories. To install these files using the standard layout, and also generate the files required to initialize and use the database, run the command: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >install c:\destination\directory</KBD ></PRE ><P> </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26157" >16.1.5. Running the Regression Tests</A ></H2 ><P > To run the regression tests, make sure you have completed the build of all required parts first. Also, make sure that the DLLs required to load all parts of the system (such as the Perl and Python DLLs for the procedural languages) are present in the system path. If they are not, set it through the <TT CLASS="FILENAME" >buildenv.pl</TT > file. To run the tests, run one of the following commands from the <TT CLASS="FILENAME" >src\tools\msvc</TT > directory: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >vcregress check</KBD > <KBD CLASS="USERINPUT" >vcregress installcheck</KBD > <KBD CLASS="USERINPUT" >vcregress plcheck</KBD > <KBD CLASS="USERINPUT" >vcregress contribcheck</KBD ></PRE ><P> To change the schedule used (default is parallel), append it to the command line like: </P><PRE CLASS="SCREEN" ><KBD CLASS="USERINPUT" >vcregress check serial</KBD ></PRE ><P> For more information about the regression tests, see <A HREF="regress.html" >Chapter 30</A >. </P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="AEN26170" >16.1.6. Building the Documentation</A ></H2 ><P > Building the PostgreSQL documentation in HTML format requires several tools and files. Create a root directory for all these files, and store them in the subdirectories in the list below. <P ></P ></P><DIV CLASS="VARIABLELIST" ><DL ><DT >OpenJade 1.3.1-2</DT ><DD ><P > Download from <A HREF="http://sourceforge.net/projects/openjade/files/openjade/1.3.1/openjade-1_3_1-2-bin.zip/download" TARGET="_top" >http://sourceforge.net/projects/openjade/files/openjade/1.3.1/openjade-1_3_1-2-bin.zip/download</A > and uncompress in the subdirectory <TT CLASS="FILENAME" >openjade-1.3.1</TT >. </P ></DD ><DT >DocBook DTD 4.2</DT ><DD ><P > Download from <A HREF="http://www.oasis-open.org/docbook/sgml/4.2/docbook-4.2.zip" TARGET="_top" >http://www.oasis-open.org/docbook/sgml/4.2/docbook-4.2.zip</A > and uncompress in the subdirectory <TT CLASS="FILENAME" >docbook</TT >. </P ></DD ><DT >DocBook DSSSL 1.79</DT ><DD ><P > Download from <A HREF="http://sourceforge.net/projects/docbook/files/docbook-dsssl/1.79/docbook-dsssl-1.79.zip/download" TARGET="_top" >http://sourceforge.net/projects/docbook/files/docbook-dsssl/1.79/docbook-dsssl-1.79.zip/download</A > and uncompress in the subdirectory <TT CLASS="FILENAME" >docbook-dsssl-1.79</TT >. </P ></DD ><DT >ISO character entities</DT ><DD ><P > Download from <A HREF="http://www.oasis-open.org/cover/ISOEnts.zip" TARGET="_top" >http://www.oasis-open.org/cover/ISOEnts.zip</A > and uncompress in the subdirectory <TT CLASS="FILENAME" >docbook</TT >. </P ></DD ></DL ></DIV ><P> Edit the <TT CLASS="FILENAME" >buildenv.pl</TT > file, and add a variable for the location of the root directory, for example: </P><PRE CLASS="PROGRAMLISTING" >$ENV{DOCROOT}='c:\docbook';</PRE ><P> To build the documentation, run the command <TT CLASS="FILENAME" >builddoc.bat</TT >. Note that this will actually run the build twice, in order to generate the indexes. The generated HTML files will be in <TT CLASS="FILENAME" >doc\src\sgml</TT >. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="install-windows.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="install-windows-libpq.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Installation from Source Code on <SPAN CLASS="PRODUCTNAME" >Windows</SPAN ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="install-windows.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Building <SPAN CLASS="APPLICATION" >libpq</SPAN > with <SPAN CLASS="PRODUCTNAME" >Visual C++</SPAN > or <SPAN CLASS="PRODUCTNAME" >Borland C++</SPAN ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >