# CPack RPM : special situation for boost.mpi library

**URL:** https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874
**Category:** Usage
**Created:** [September 3, 2023, 2:12pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874 "2023-09-03T14:12:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![MM77](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mm77/32/2002_2.png) [@MM77](https://discourse.cmake.org/u/MM77)
#### Post date: [September 3, 2023, 2:12pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/1 "2023-09-03T14:12:48Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 3, 2023, 5:31pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/2 "2023-09-03T17:31:25Z")

</div>

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.

- [Fedora MPI packaging guidelines](https://fedoraproject.org/wiki/Packaging:MPI)
- [Fedora discussion forum](https://discussion.fedoraproject.org/)

---

<div class="post-metadata">

### Author: ![MM77](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mm77/32/2002_2.png) [@MM77](https://discourse.cmake.org/u/MM77)
#### Post date: [September 3, 2023, 8:02pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/3 "2023-09-03T20:02:59Z")

</div>

yes not clear.  
I’ve asked here [Openmpi rpm : how is it spec'ed - #3 by finjulhich - Fedora Discussion](https://discussion.fedoraproject.org/t/openmpi-rpm-how-is-it-speced/88929/3)

---

<div class="post-metadata">

### Author: ![MM77](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mm77/32/2002_2.png) [@MM77](https://discourse.cmake.org/u/MM77)
#### Post date: [September 4, 2023, 9:12pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/4 "2023-09-04T21:12:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 4, 2023, 10:57pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/5 "2023-09-04T22:57:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![MM77](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mm77/32/2002_2.png) [@MM77](https://discourse.cmake.org/u/MM77)
#### Post date: [October 8, 2023, 7:02pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/6 "2023-10-08T19:02:22Z")

</div>

> [@ben.boeckel](#):
>
> nal macro configuration present when built in a Fedora environment.

@ben.boeckel

### [orion@nwra.com](mailto: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?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 10, 2023, 2:21pm UTC](https://discourse.cmake.org/t/cpack-rpm-special-situation-for-boost-mpi-library/8874/7 "2023-10-10T14:21:21Z")

</div>

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?
