[postgis-devel] Error in make test - libpg

Greg Troxel gdt at lexort.com
Tue Dec 18 07:47:23 PST 2018


Bruce Rindahl <bruce.rindahl at gmail.com> writes:

> Running make test.  All tests OK until loader when I ran unto this:
>
> ---- Making check in loader
> make[1]: Entering directory '/home/pi/postgis-3.0.0dev/loader'
> make -C cunit check
> make[2]: Entering directory '/home/pi/postgis-3.0.0dev/loader/cunit'
> /home/pi/postgis-3.0.0dev/loader/cunit/.libs/lt-cu_tester: error while
> loading shared libraries: libpq.so.5: cannot open shared object file: No
> such file or directory
> Makefile:80: recipe for target 'check' failed
>
> llibpq.so.5 is at /usr/local/pgsql/lib/libpq.so.5 at the standard location
> from the postgresql 11.1 install.  Suggestions?

In theory, -L/-R would be set on the link line for binaries/libraries
that need libs to 1) find them at compile time and 2) find them at
runtime using RPATH.  In practice, this is often not quite right because
if one uses the same prefix for many things bugs are covered up.

And, I have the impression some systems don't use RPATH, and instead
want some system-wide configuration of the directories that have
libraries, but I don't understand if this impression is correct or the
details.

The various config programs (foo-config scripts, and pkg-config) in
theory should be providing correct -L/-R flags for the rules of the type
of system.  But these can have bugs.

So, I would recommend that you go over the build logs and look at the
linker flags when the file that's trouble was linked, and see if
-Wl,--rpath or -R is present.  Also look at the file with objdump -x and
look for RPATH and NEEDED entries.


More information about the postgis-devel mailing list