[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OpenMPI rpath entries (Was: question on binary-or-shlib-defines-rpath)



Hi,

On 18/01/17 22:39, Nico Schlömer wrote:
> I'm co-maintaining the Trilinos package [1] in Debian and recently found
> a bunch of new lintian warnings of the kind
> binary-or-shlib-defines-rpath [2]. It say in the description of the warning:
> ```
> To fix this problem, look for link lines like: 
> 
> gcc test.o -o test -Wl,--rpath,/usr/local/lib
> 
> or 
> 
> gcc test.o -o test -R/usr/local/lib
> 
> and remove the -Wl,--rpath or -R argument.
> ```
> Indeed, the Trilinos installation contains many of those lines, but they
> are necessary too. When executing the test binaries (which are compiled
> in the build tree alongside the libraries), they have to find the linked
> shared libraries. Messing with the rpath is necessary.
> 
> That's not true later on when the libraries are _installed_, of course.
> For this, CMake has the switch CMAKE_SKIP_INSTALL_RPATH [3], which
> serves exactly that purpose. For some reason, lintian doesn't seem to be
> happy with that though.

The CMAKE_SKIP_INSTALL_RPATH option only affects the rpaths which CMake
itself inserts. It does not affect any rpaths manually added with other
-Wl,--rpath options. The culprit here is probably openmpi which adds all
of these rpath entries:

$ mpicc -show
[...] -Wl,-rpath -Wl,/usr//lib -Wl,-rpath
-Wl,/usr/lib/x86_64-linux-gnu/openmpi/lib [...]

Maybe it shouldn't do that. The /usr//lib one is clearly useless and the
it seems that most of the libraries from
/usr/lib/x86_64-linux-gnu/openmpi/lib are symlinked into
/usr/lib/x86_64-linux-gnu anyway.

On a separate note: does this interfere with the alternatives system
which openmpi currently has? If an rpath is used, it will override any
libraries in the default linker search path so even if the mpi
alternative is changed, many applications will still use libmpi from
/usr/lib/x86_64-linux-gnu/openmpi/lib.

Thanks,
James

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: