On 05/17/2017 02:03 PM, Tom Lane wrote: > Adrian Klaver <adrian.klaver@xxxxxxxxxxx> writes: >> I could build repmgr against Postgres source and on Ubuntu install of >> EDB Postgres. The issue seems to be a combination of RH and EDB Postgres >> installation. To me it looks like ld is finding >> /lib64/libldap_r-2.4.so.2 library before the /opt/PostgreSQL/9.6/lib/ >> one. > > IIRC this is determined ultimately by /etc/ld.so.conf, but there's > a layer of caching that might be giving trouble. See "man 8 ld.so" > and also "man 8 ldconfig". Looking at the output of "ldconfig -p" > might be informative. Learned a lot, though not the answer. I do this: PATH=/opt/PostgreSQL/9.6/bin:$PATH make USE_PGXS=1 clean all I get: /usr/lib64/libldap_r-2.4.so.2: undefined reference to `ber_sockbuf_io_udp' Looking at files: ldd /usr/lib64/libldap_r-2.4.so.2 linux-vdso.so.1 => (0x00007ffce3553000) liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007f279cd52000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f279cb38000) libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f279c91a000) libssl3.so => /lib64/libssl3.so (0x00007f279c6d7000) libsmime3.so => /lib64/libsmime3.so (0x00007f279c4b0000) libnss3.so => /lib64/libnss3.so (0x00007f279c189000) libnssutil3.so => /lib64/libnssutil3.so (0x00007f279bf5d000) libplds4.so => /lib64/libplds4.so (0x00007f279bd59000) libplc4.so => /lib64/libplc4.so (0x00007f279bb53000) libnspr4.so => /lib64/libnspr4.so (0x00007f279b915000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f279b6f9000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f279b4f4000) libc.so.6 => /lib64/libc.so.6 (0x00007f279b133000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f279aefc000) libz.so.1 => /lib64/libz.so.1 (0x00007f279ace5000) librt.so.1 => /lib64/librt.so.1 (0x00007f279aadd000) /lib64/ld-linux-x86-64.so.2 (0x00007f279d1c5000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f279a8d9000) nm -D /usr/lib64/libldap_r-2.4.so.2 | grep ber_sockbuf_io_udp U ber_sockbuf_io_udp nm -D /usr/lib64/liblber-2.4.so.2 | grep ber_sockbuf_io_udp 000000000020e020 D ber_sockbuf_io_udp This is repeated for libldap_r-2.4.so.2 and liblber-2.4.so.2 in /lib64/ ldd /opt/PostgreSQL/9.6/lib/libldap_r-2.4.so.2 linux-vdso.so.1 => (0x00007ffcf5bfc000) liblber-2.4.so.2 => /opt/PostgreSQL/9.6/lib/liblber-2.4.so.2 (0x00007f60f0e86000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f60f0c64000) libsasl2.so.3 => /opt/PostgreSQL/9.6/lib/libsasl2.so.3 (0x00007f60f0a42000) libssl.so.1.0.0 => /opt/PostgreSQL/9.6/lib/libssl.so.1.0.0 (0x00007f60f07d3000) libcrypto.so.1.0.0 => /opt/PostgreSQL/9.6/lib/libcrypto.so.1.0.0 (0x00007f60f039c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f60f0180000) libc.so.6 => /lib64/libc.so.6 (0x00007f60efdbf000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f60efbba000) /lib64/ld-linux-x86-64.so.2 (0x00007f60f12f9000) nm -D /opt/PostgreSQL/9.6/lib/libldap_r-2.4.so.2 | grep ber_sockbuf_io_udp nm -D /opt/PostgreSQL/9.6/lib/liblber-2.4.so.2 | grep ber_sockbuf_io_udp If I do: export LD_LIBRARY_PATH=/opt/PostgreSQL/9.6/lib PATH=/opt/PostgreSQL/9.6/bin:$PATH make USE_PGXS=1 clean all I get the same error: /usr/lib64/libldap_r-2.4.so.2: undefined reference to `ber_sockbuf_io_udp' ldd /usr/lib64/libldap_r-2.4.so.2 linux-vdso.so.1 => (0x00007ffe49f72000) liblber-2.4.so.2 => /opt/PostgreSQL/9.6/lib/liblber-2.4.so.2 (0x00007f8fc35e0000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f8fc33be000) libsasl2.so.3 => /opt/PostgreSQL/9.6/lib/libsasl2.so.3 (0x00007f8fc319c000) libssl3.so => /lib64/libssl3.so (0x00007f8fc2f59000) libsmime3.so => /lib64/libsmime3.so (0x00007f8fc2d31000) libnss3.so => /lib64/libnss3.so (0x00007f8fc2a0b000) libnssutil3.so => /lib64/libnssutil3.so (0x00007f8fc27df000) libplds4.so => /lib64/libplds4.so (0x00007f8fc25da000) libplc4.so => /lib64/libplc4.so (0x00007f8fc23d5000) libnspr4.so => /lib64/libnspr4.so (0x00007f8fc2197000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8fc1f7a000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f8fc1d76000) libc.so.6 => /lib64/libc.so.6 (0x00007f8fc19b5000) libz.so.1 => /opt/PostgreSQL/9.6/lib/libz.so.1 (0x00007f8fc1798000) librt.so.1 => /lib64/librt.so.1 (0x00007f8fc1590000) /lib64/ld-linux-x86-64.so.2 (0x00007f8fc3a4d000) nm -D /usr/lib64/libldap_r-2.4.so.2 | grep ber_sockbuf_io_udp U ber_sockbuf_io_udp nm -D /usr/lib64/liblber-2.4.so.2 | grep ber_sockbuf_io_udp 000000000020e020 D ber_sockbuf_io_udp /usr/lib64/libldap_r-2.4.so.2 is a symlink: ls -al /usr/lib64/libldap_r-2.4.so.2 lrwxrwxrwx. 1 root root 23 May 18 10:04 /usr/lib64/libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.3 If I remove that link then I can compile. Have no idea why. > > regards, tom lane > -- Adrian Klaver adrian.klaver@xxxxxxxxxxx -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general