PostgreSQL源碼安裝時若是相關依賴包缺失會致使編譯失敗,如下是常見的依賴包缺失問題,及解決辦法。
環境:
OS centos 5.7
DB postgresql 9.1.2
說明:使用centos能夠用yum install命令快速安裝和更新卸載,用rpm -qa|grep xxx來看某個包是否裝上。
總結:yum install -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel gcc-c++
openssl-devel cmake
1.question
checking for flags to link embedded Perl... Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
no
configure: error: could not determine flags for linking embedded Perl.
This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
installed.
solve method:
yum install perl-ExtUtils-Embed
2.question
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.
solve method:
yum install
readline-5.1-3.el5
readline-devel-5.1-3.el5
3.question
checking for inflate in -lz... no
configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.
solve method
yum install
zlib-1.2.3-4.el5
zlib-devel-1.2.3-4.el5
4.question
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL
solve method
yum install
openssl-devel-0.9.8e-20.el5_7.1.0.1.centos
openssl-0.9.8e-20.el5_7.1.0.1.centos
5.question
checking for pam_start in -lpam... no
configure: error: library 'pam' is required for PAM
solve method
yum install
pam-devel-0.99.6.2-6.el5_5.2
pam-0.99.6.2-6.el5_5.2
6.question
checking for xmlSaveToBuffer in -lxml2... no
configure: error: library 'xml2' (version >= 2.6.23) is required for XML support
solve method:
yum install
libxml2-devel-2.6.26-2.1.12.el5_7.2
libxml2-2.6.26-2.1.12.el5_7.2
7.question
checking for xsltCleanupGlobals in -lxslt... no
configure: error: library 'xslt' is required for XSLT support
solve method
yum install
libxslt-devel-1.1.17-2.el5_2.2
libxslt-1.1.17-2.el5_2.2
8.question
checking for ldap.h... no
configure: error: header file is required for LDAP
solve method
openldap-2.3.43-12.el5_7.10
openldap-devel-2.3.43-12.el5_7.10
9.question
checking for Python.h... no
configure: error: header file is required for Python
solve method
yum install python-devel
10.question
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
solve method
yum install gcc-c++