Subject: bug#74010: openmpi@5 requires propagated libraries

From: Andreas Enge <[email-masked]>
Date: Fri, 25 Oct 2024 11:36:46 +0200

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