由于准备做 oracle_fdw 实验, 今天打算重新安装 PostgreSQL 9.1, 所以计划将 PostgreSQL 配置成没有安装 ldap 的模式, 但在编译过程中遇到了错误,以下是详细信息。
环境信息
PostgreSQL: Postgresql 9.1
OS : Red Hat Enterprise Linux Server release 5.5 (Tikanga)
硬件: 笔记本上的虚拟机
安装 PostgreSQL
执行 configure 配置 PostgreSQL
1
|
./configure --prefix=/opt/pgsql9.1 --with-pgport=1923 --with-segsize=8 --with-wal-segsize=64 --with-wal-blocksize=64 --with-perl --with-python --with-openssl --with-pam --with-libxml --with-libxslt --enable-thread-safety without-ldap
|
备注: 这个配置脚本不安装 ldap 模块,增加了 “–without-ldap” 参数,其它的配置以前经常用到,都正常。
然后执行 gmake world
进行编译, 这步遇到错误,错误信息如下,只贴出后面的主要信息G。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
utils/time/tqual.o utils/time/snapmgr.o utils/fmgrtab.o ../../src/timezone/localtime.o ../../src/timezone/strftime.o ../../src/timezone/pgtz.o ../../src/port/libpgport_srv.a -lxslt -lxml2 -lpam -lssl -lcrypto -lcrypt -ldl -lm -o postgres libpq/auth.o: In function `InitializeLDAPConnection auth.c:(.text+0x2c4): undefined reference to `ldap_init auth.c:(.text+0x2e7): undefined reference to `ldap_set_option auth.c:(.text+0x329): undefined reference to `ldap_start_tls_s auth.c:(.text+0x339): undefined reference to `ldap_unbind auth.c:(.text+0x37e): undefined reference to `ldap_unbind libpq/auth.o: In function `CheckLDAPAuth auth.c:(.text+0x163a): undefined reference to `ldap_simple_bind_s auth.c:(.text+0x1647): undefined reference to `ldap_unbind auth.c:(.text+0x1690): undefined reference to `ldap_simple_bind_s auth.c:(.text+0x174c): undefined reference to `ldap_search_s auth.c:(.text+0x1768): undefined reference to `ldap_count_entries auth.c:(.text+0x1783): undefined reference to `ldap_first_entry auth.c:(.text+0x1792): undefined reference to `ldap_get_dn auth.c:(.text+0x17c3): undefined reference to `ldap_memfree auth.c:(.text+0x17ce): undefined reference to `ldap_msgfree auth.c:(.text+0x17d9): undefined reference to `ldap_unbind_s auth.c:(.text+0x1929): undefined reference to `ldap_get_option auth.c:(.text+0x1964): undefined reference to `ldap_err2string auth.c:(.text+0x19c2): undefined reference to `ldap_get_option auth.c:(.text+0x19fd): undefined reference to `ldap_err2string auth.c:(.text+0x1a42): undefined reference to `ldap_msgfree auth.c:(.text+0x1a5e): undefined reference to `ldap_count_entries auth.c:(.text+0x1b0a): undefined reference to `ldap_count_entries collect2: ld 返回 1 gmake[2]: * [postgres] 错误 1 gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/src/backend gmake[1]: * [all-backend-recurse] 错误 2 gmake[1]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/src gmake: * [world-src-recurse] 错误 2
|
备注:遇到这种问题非常无语,通常在编译过程中报错都是由于操作系统包没打全,但这个 ERROR 应该不是这原因,后来网上查了些资料,有人说在由于以前执行过安装 ldap模块的 configure
命令,会产生 很多临时文件,所以再次执行不安装 ldap 模块的 configure
命令时会报错,解决方法是在 configure
之前先执行 make distclean
命令。
执行 Make Distclean
make distclean
命令是将先前configure
生成的文件全部删除掉,包括Makefile。在 configure
操作前先执行了下 make distclean
, 之后编译就没报错了。
重新编译
gamke world
终于执行成功,下面是部分日志信息
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
gmake -C unaccent all gmake[2]: Entering directory `/opt/soft_bak/postgresql-9.1.0/contrib/unaccent gmake[2]: Nothing to be done for `all gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/contrib/unaccent gmake -C vacuumlo all gmake[2]: Entering directory `/opt/soft_bak/postgresql-9.1.0/contrib/vacuumlo gmake[2]: Nothing to be done for `all gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/contrib/vacuumlo gmake -C sslinfo all gmake[2]: Entering directory `/opt/soft_bak/postgresql-9.1.0/contrib/sslinfo gmake[2]: Nothing to be done for `all gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/contrib/sslinfo gmake -C xml2 all gmake[2]: Entering directory `/opt/soft_bak/postgresql-9.1.0/contrib/xml2 gmake[2]: Nothing to be done for `all gmake[2]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/contrib/xml2 gmake[1]: Leaving directory `/opt/soft_bak/postgresql-9.1.0/contrib PostgreSQL, contrib, and documentation successfully made. Ready to install.
|
备注:接下来安装 PostgreSQL ,建库就很顺利了,这里不再详述。
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/database/236430.html