Openmpi rpm : how is it spec'ed

I develop a application and use CMake and with CPack produce rpms of my binaries.
These rpms require (by checking rpm -qp --requires on my rpms)

libboost_mpi.so.1.78.0()(64bit)

however, the Fedora installed packages (boost mpi) 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, ie the specific choice of openmpi.

My application builds and runs successfully. There must be some magic in the .spec for boost-mpi rpms (though I couldn’t find here Packaging:MPI - Fedora Project Wiki) to have those Capabilities like that.

I’m not sure how to instruct cpack to explicit add openmpi?

rds,

You can also use dnf to perform the search in a broader way:

$ dnf provides "*libboost_mpi*"

boost-mpich-1.78.0-11.fc38.x86_64 : Run-time component of Boost.MPI library
Repo        : fedora
Matched from:
Provide    : libboost_mpi.so.1.78.0()(64bit)(mpich-x86_64)

Thanks. The question though is what in the spec file add third argument between brackets.
for me (openmpi-x86_64)
and for you (mpich-x86_64)

in the way I create the rpm with Cmake Cpack, I’ll need to know that,

If you were to use the command dnf provides */libboost_mpi.so.1.78.0 you would find that is provided by the boost-openmpi or the boost-mpich package. Being too detailed in what you ask for can at times present a road block.

It is implemented in the rpm macros that are used when the rpm is build using rpmbuild.

There is a scan of the files being packaged to auto generate provides and requires for the rpm.

@barryascott could you please point to that logic in the spec code?
I need to get cmake cpack rpm generator to do the same

The logic is not in the .spec file itself, it is somewhere in the rpm macros and the commands the macros run.

I think rpmbuild --showrc shows you all the rpm macros.