Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May need to manually call ldconfig after make install #40

Open
guillerodriguez opened this issue Mar 28, 2017 · 2 comments
Open

May need to manually call ldconfig after make install #40

guillerodriguez opened this issue Mar 28, 2017 · 2 comments

Comments

@guillerodriguez
Copy link
Contributor

guillerodriguez commented Mar 28, 2017

On fresh installs of Ubuntu 14.04 and Ubuntu 16.04, building and installing libpagekite does not update the ld cache.

$ pagekitec
pagekitec: error while loading shared libraries: libpagekite.so.1: cannot open shared object file: No such file or directory
$ ls /usr/local/lib/libpagekite.so*
/usr/local/lib/libpagekite.so    /usr/local/lib/libpagekite.so.1.0.0
/usr/local/lib/libpagekite.so.1
$ sudo ldconfig
$ pagekitec
This is pagekitec.c from libpagekite 0.91.170301C.
[...]

Manually running ldconfig after make install fixes the problem.

This is apparently due to the Makefile calling libtool -n which builds symlinks as needed but skips updating the cache.

References:

I don't know if it is reasonable to try to fix this but perhaps it would be a good idea to document it (for example print a message from make install)

@BjarniRunar
Copy link
Collaborator

Good catch. I wonder, is there any harm in calling ldconfig for the user? Is that ever a bad thing?

@guillerodriguez
Copy link
Contributor Author

That (always calling ldconfig) is suggested here: esnet/iperf#153 (comment)

Always calling ldconfig has two problems:

  1. Installing as non-root user (e.g. installing to a private dir). If invoked as a non-root user, ldconfig will complain because it does not have sufficient permissions. See: ldconfig needed in make install? esnet/iperf#153 (comment)

  2. This woud fail on Mac OS X where ldconfig is not used. See: ldconfig needed in make install? esnet/iperf#153 (comment)

Having said that: I guess you could always try to call ldconfig with stderr sent to /dev/null. If the user is root and we're not on Mac OS X, it will work as intended. If the user is not root or we're on Mac OS X, nothing breaks either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants