CPack RPM : special situation for boost.mpi library

This may not precisely a cpack question, but I thought to start asking here.
I generate a binary .rpm file.

That rpm requires (by checking rpm -q --requries)

libboost_mpi.so.1.78.0()(64bit)

however, the Fedora installed packages provide

rpm -q --whatprovides “libboost_mpi.so.1.78.0()(64bit)”
no package provides libboost_mpi.so.1.78.0()(64bit)
rpm -q --whatprovides “libboost_mpi.so.1.78.0()(64bit)(openmpi-x86_64)”
boost-openmpi-1.78.0-11.fc38.x86_64

The difference is in that 2nd bracket section.
The context is that MPI is a specification for message passing parallel compute framework.
openmpi is a implementation. openmpi is installed.
boost.mpi is a C++ Boost library that can hook up to openmpi or other mpi impls.

I’m not sure how to instruct cpack?

Fedora handles this with some RPM macro magic somewhere. I think you’ll have to use and/or emulate that as needed. I wasn’t seeing it by the wiki page below, but asking of the discussion forum may find someone more familiar with the mechanisms.

yes not clear.
I’ve asked here Openmpi rpm : how is it spec'ed - #3 by finjulhich - Fedora Discussion

I’m at a loss her.
They’re saying there are rpm macros that collect the various mpi impl to generate the provides.
But I have no idea which ones.

rpmbuild --showrc on my host shows this section that matches openmpi.
13: _openmpi_load
. /etc/profile.d/modules.sh;
module load mpi/openmpi-%{_arch};
export OMPI_MCA_rmaps_base_oversubscribe=1
-13: _openmpi_unload
. /etc/profile.d/modules.sh;
module unload mpi/openmpi-%{_arch};

I’ve asked the guys who produced the packages directly

It may require building the RPM on a Fedora box or Fedora chroot/container. There may be some Fedora additional macro configuration present when built in a Fedora environment.

@ben.boeckel

orion@nwra.com

explains that
"This is handled by the rpm automatic provides generator in rpm-mpi-hooks - /usr/lib/rpm/mpi.req. It expects that you have the related mpi/ modules installed that can be loaded and define MPI_HOME and MPI_COMPILER. Then files that are installed into MPI_HOME get MPI_COMPILER inserted into the third parens. "

rpm-mpi-hooks is a rpm package that i have installed. Its description:

“RPM dependency generator hooks for MPI packages. This package should be added
as a BuildRequires to all mpi implementations (i.e. openmpi, mpich) as well as
a Requires to the their -devel packages”

There are many bits to wrap my head around here

  1. build box: where I build via cmake build, followed by cmake install / cpack to produce the .rpm files.
  2. install box: where I send the .rpm files to install

both have this “rpm-mpi-hooks” package.

Is there something to do in the CPack RPM generator to handle this case?

That is, unfortunately, beyond my RPM knowledge. AFAIK, there’s nothing special in Fedora’s .spec files to get this stuff. Maybe CPack is suppressing it somehow inadvertently?