openmpi@5 requires propagated libraries

  • Open
  • quality assurance status badge
Details
2 participants
  • Andreas Enge
  • Ludovic Courtès
Owner
unassigned
Submitted by
Andreas Enge
Severity
normal
A
A
Andreas Enge wrote on 25 Oct 11:36 +0200
(address . bug-guix@gnu.org)
Zxtmru46jfWwLzX6@jurong
Hello,

when updating openmpi from @4 to @5, my code does not link any more with the
messages:
ld: cannot find -lrdmacm: No such file or directory
ld: cannot find -lefa: No such file or directory
ld: cannot find -libverbs: No such file or directory
ld: cannot find -lpsm2: No such file or directory

Installing rdma-core and psm2 solves the problem.

Here is a way to reproduce the problem:
cd /tmp
tar xvf `guix build -S cm`
cd cm-0.4.3
guix shell --pure openmpi -D cm -- /bin/sh --norc
./configure --enable-mpi
make -j

Hm, I think the culprit is actually libfabric. It has these two packages as
inputs, and contains this in its libfabric.pc:
Libs.private: -lpsm2 -lrdmacm -libverbs -lefa -latomic -lpthread -ldl

I am not familiar with pkgconfig and do not know what distinguishes the Libs
from the Libs.private field. But the line for linking my binary contains this
in exactly this order:
/gnu/store/0f6bjfrf9kkdqh27y0bab9x9b4i8w5gi-libfabric-1.22.0/lib/libfabric.so -lrdmacm -lefa -libverbs -lpsm2

So this at least confirms the idea that something needs to be done for
libfabric. Propagate its inputs? ldd on libfabric.so shows the required
libraries
librdmacm.so.1 => /gnu/store/2d...
and so on, so I do not understand what goes wrong.

Andreas
L
L
Ludovic Courtès wrote on 25 Oct 12:31 +0200
(name . Andreas Enge)(address . andreas@enge.fr)(address . 74010@debbugs.gnu.org)
87a5es324e.fsf@gnu.org
Hello,

Andreas Enge <andreas@enge.fr> skribis:

Toggle quote (13 lines)
> when updating openmpi from @4 to @5, my code does not link any more with the
> messages:
> ld: cannot find -lrdmacm: No such file or directory
> ld: cannot find -lefa: No such file or directory
> ld: cannot find -libverbs: No such file or directory
> ld: cannot find -lpsm2: No such file or directory
>
> Installing rdma-core and psm2 solves the problem.
>
> Here is a way to reproduce the problem:
> cd /tmp
> tar xvf `guix build -S cm`

Note that ‘cm’ as currently packaged does not depend on openmpi.

Toggle quote (8 lines)
> Hm, I think the culprit is actually libfabric. It has these two packages as
> inputs, and contains this in its libfabric.pc:
> Libs.private: -lpsm2 -lrdmacm -libverbs -lefa -latomic -lpthread -ldl
>
> I am not familiar with pkgconfig and do not know what distinguishes the Libs
> from the Libs.private field. But the line for linking my binary contains this
> in exactly this order:

It looks like the culprit is not pkg-config but Libtool:

Toggle snippet (6 lines)
$ cat $(guix build openmpi@5 |grep -v debug)/lib/libmpi.la |grep ^dependency_libs
dependency_libs=' -L/gnu/store/lqgg509yb3f85ck4k6l0qp7a70bz7daa-libevent-2.1.12/lib -L/gnu/store/j9nkxb0kcx8i6fmjjlg9m5icapdnsvs8-hwloc-2.11.1-lib/lib -L/gnu/store/mqmlzbzarz2s56khlkl7xk20xlsxdf04-openpmix-4.2.8/lib -L/gnu/store/an3mrydqv3x9kzkv45jcay0jh301v06q-libpciaccess-0.16/lib -L/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib -L/gnu/store/0f6bjfrf9kkdqh27y0bab9x9b4i8w5gi-libfabric-1.22.0/lib -L/gnu/store/0qqy5010by77h33ny3gzmaqx90c93q5v-ucx-1.15.0/lib /gnu/store/1g7npkghs0b25gyk42pgcns8icy29gk3-openmpi-5.0.3/lib/libopen-pal.la /gnu/store/0f6bjfrf9kkdqh27y0bab9x9b4i8w5gi-libfabric-1.22.0/lib/libfabric.la -lrdmacm -lefa -libverbs -lpsm2 /gnu/store/zzpbp6rr43smwxzvzd4qd317z5j7qblj-gcc-11.4.0-lib/lib/libatomic.la -lpthread /gnu/store/0qqy5010by77h33ny3gzmaqx90c93q5v-ucx-1.15.0/lib/libucp.la /gnu/store/0qqy5010by77h33ny3gzmaqx90c93q5v-ucx-1.15.0/lib/libuct.la /gnu/store/0qqy5010by77h33ny3gzmaqx90c93q5v-ucx-1.15.0/lib/libucs.la /gnu/store/0qqy5010by77h33ny3gzmaqx90c93q5v-ucx-1.15.0/lib/libucm.la -lrt /gnu/store/mqmlzbzarz2s56khlkl7xk20xlsxdf04-openpmix-4.2.8/lib/libpmix.la -ldl /gnu/store/lqgg509yb3f85ck4k6l0qp7a70bz7daa-libevent-2.1.12/lib/libevent_core.la /gnu/store/lqgg509yb3f85ck4k6l0qp7a70bz7daa-libevent-2.1.12/lib/libevent_pthreads.la /gnu/store/j9nkxb0kcx8i6fmjjlg9m5icapdnsvs8-hwloc-2.11.1-lib/lib/libhwloc.la -lm /gnu/store/an3mrydqv3x9kzkv45jcay0jh301v06q-libpciaccess-0.16/lib/libpciaccess.la -lz'
$ cat $(guix build openmpi@4 |grep -v debug)/lib/libmpi.la |grep ^dependency_libs
dependency_libs=' -L/gnu/store/an3mrydqv3x9kzkv45jcay0jh301v06q-libpciaccess-0.16/lib -L/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib /gnu/store/gaip8ig4yv0hx5s60hbka6h8lkh6747y-openmpi-4.1.6/lib/libopen-rte.la /gnu/store/gaip8ig4yv0hx5s60hbka6h8lkh6747y-openmpi-4.1.6/lib/libopen-pal.la /gnu/store/j9nkxb0kcx8i6fmjjlg9m5icapdnsvs8-hwloc-2.11.1-lib/lib/libhwloc.la -lm /gnu/store/an3mrydqv3x9kzkv45jcay0jh301v06q-libpciaccess-0.16/lib/libpciaccess.la -lz /gnu/store/lqgg509yb3f85ck4k6l0qp7a70bz7daa-libevent-2.1.12/lib/libevent_core.la /gnu/store/lqgg509yb3f85ck4k6l0qp7a70bz7daa-libevent-2.1.12/lib/libevent_pthreads.la'

We need to check the build process of openmpi to see where all these
extra ‘-l’ in libmpi.la come from.

Thanks,
Ludo’.
A
A
Andreas Enge wrote on 25 Oct 12:46 +0200
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)(address . 74010@debbugs.gnu.org)
Zxt3DF82WvbGYjOF@jurong
Am Fri, Oct 25, 2024 at 12:31:29PM +0200 schrieb Ludovic Courtès:
Toggle quote (2 lines)
> Note that ‘cm’ as currently packaged does not depend on openmpi.

No, because I did not add the "--enable-mpi" configuration option.
This is just an example; I think the problem would occur with any
software using openmpi@5.

Andreas
A
A
Andreas Enge wrote on 25 Oct 13:13 +0200
(name . Ludovic Courtès)(address . ludovic.courtes@inria.fr)(address . 74010@debbugs.gnu.org)
Zxt9VoNbjGdpUNYx@jurong
Am Fri, Oct 25, 2024 at 12:31:29PM +0200 schrieb Ludovic Courtï¿œs:
Toggle quote (7 lines)
> It looks like the culprit is not pkg-config but Libtool:
> --8<---------------cut here---------------start------------->8---
> $ cat $(guix build openmpi@5 |grep -v debug)/lib/libmpi.la |grep ^dependency_libs
> dependency_libs='
> ...
> /gnu/store/0f6bjfrf9kkdqh27y0bab9x9b4i8w5gi-libfabric-1.22.0/lib/libfabric.la -lrdmacm -lefa -libverbs -lpsm2 /gnu/store/zzpbp6rr43smwxzvzd4qd317z5j7qblj-gcc-11.4.0-lib/lib/libatomic.la -lpthread

This part comes from libfabric, which has this line in
/gnu/store/0f6bjfrf9kkdqh27y0bab9x9b4i8w5gi-libfabric-1.22.0/lib/libfabric.la :
dependency_libs=' -lrdmacm -lefa -libverbs -lpsm2 /gnu/store/zzpbp6rr43smwxzvzd4qd317z5j7qblj-gcc-11.4.0-lib/lib/libatomic.la -lpthread -ldl'

But both openmpi@4 and @5 depend on libfabric, so this does not explain
the difference.

Then I do not understand why one of the libraries has an absolute path,
and the others just their name. Maybe something should be changed in
the building of libfabric?

But indeed my code using openmpi@4 does not link with libfabric, as you
noticed, and it works nevertheless.

Andreas
L
L
Ludovic Courtès wrote on 25 Oct 14:23 +0200
(name . Andreas Enge)(address . andreas@enge.fr)(address . 74010@debbugs.gnu.org)
87r0841id0.fsf@inria.fr
Andreas Enge <andreas@enge.fr> skribis:

Toggle quote (7 lines)
> Am Fri, Oct 25, 2024 at 12:31:29PM +0200 schrieb Ludovic Courtès:
>> Note that ‘cm’ as currently packaged does not depend on openmpi.
>
> No, because I did not add the "--enable-mpi" configuration option.
> This is just an example; I think the problem would occur with any
> software using openmpi@5.

Only for software using Libtool. For example, this works:

guix build intel-mpi-benchmarks --with-input=openmpi@4=openmpi@5

This particular package uses CMake, which is more common than Autotools
in this domain.

Maybe someday we’ll just remove .la files wholesale, as Debian and
others have been doing for a while.

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74010@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74010
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch