Hi,
Thank you for your answers.
Le 2016-11-14 18:20, Jussi Pakkanen a écrit :
> This is not really the recommended way to behave. Rpath should not be
> set on exes installed to common dirs. The suggested way to make this
> work is to set LD_LIBRARY_PATH=/usr/local/lib so it is found.
Le 2016-11-14 20:09, Tanu Kaskinen a écrit :
> Another solution (which I find nicer than messing with environment
> variables) is to put /usr/local/lib64 to /etc/ld.so.conf or to a file
> under /etc/ld.so.conf.d/. Debian does this by default for
> /usr/local/lib, I don't know why Fedora doesn't.
In fact, I'm aware of LD_LIBRARY_PATH and /etc/ld.so.conf, and it is not
a problem for me to execute the program on my computer.
My problem is that I want to provide a source-code package that people
can easily install and execute on their computer, or even package for a
distro, with "--prefix /usr".
People should only call:
$ mkdir build
$ meson build
$ ninja -C build
# ninja -C build install
That's why I don't want to hard-code "install_rpath : '/usr/local/lib'"
in meson build files.
Moreover, I cannot hard-code this value : on my computer, it is not
/usr/local/lib, it is /usr/local/lib64.
Maybe the problem is specific to Fedora. /usr/local/bin is in the PATH,
it is strange that /usr/local/lib and /usr/local/lib64 are not searched
for.
I don't have the opportunity to test on Debian for the moment.
I agree that RPATH should not be set, provided that libraries are
installed into standard directories. The problem is that Meson decides
that /usr/local/lib64 is standard directory - which I agree with - but
at run-time it is not considered as a standard directory.
I don't want to ask people to use "--prefix /usr", because we should not
mix packages provided by the distro, and packages compiled by a user
(/usr/local is fine for that).
This is the last thing I have to fix to switch from CMake to Meson :)
I want to use things in the "standard way", and I expect them to work
"out of the box" :)
Should I just warn people, in my README, that they may need to add
/usr/local/lib or /usr/local/lib64 in /etc/ld.so.conf.d/myprog?
It does not sound very nice, but it may be the only proper solution...
Regards,
hjuvi