why is ldconfig needed after installation

2014-05-25 Thread Peter Johansson

Hi libtoolers,

I just installed a library with libtool (via automake generated rules) 
and when trying to use the lib I get this:


error while loading shared libraries: libyat.so.9

which is going away if I issue

sudo ldconfig /us/local/lib

My question is why is that even needed, as I thought libtool already did 
that. No?



I've noticed the message at installation
---8
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
 during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
 during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
---8

So I've followed the last bit there and added a file 
'/etc/ld.so.conf.d/local.conf' that contains '/usr/local/lib' to make 
the runtime linker aware of '/usr/local/lib'. Yet I need to do a 
ldconfig manually every time I install something. Am I missing something 
or doing something wrong? This is on RHEL6.


Cheers,
Peter

This is on RHEL6 and I've added

--
Peter Johansson


___
https://lists.gnu.org/mailman/listinfo/libtool


Re: why is ldconfig needed after installation

2014-05-25 Thread Russ Allbery
Peter Johansson troj...@gmail.com writes:

 I just installed a library with libtool (via automake generated rules)
 and when trying to use the lib I get this:

 error while loading shared libraries: libyat.so.9

 which is going away if I issue

 sudo ldconfig /us/local/lib

 My question is why is that even needed, as I thought libtool already did
 that. No?

ldconfig has to be run because the dynamic linker maintains a cache of
available libraries that has to be updated.  libtool does this when run
with libtool --mode=finish on the installation directory.  I'm not sure if
it does this when it thinks the directory isn't listed in the system
library search path, though.

-- 
Russ Allbery (ea...@eyrie.org)  http://www.eyrie.org/~eagle/

___
https://lists.gnu.org/mailman/listinfo/libtool