Bug#1107589: libopenmpi-dev: Support a cross-compatible way of discovering MPI support for C++

Helmut Grohne helmut at subdivi.de
Tue Jun 10 06:17:33 BST 2025


Package: libopenmpi-dev
Version: 5.0.7-1
User: debian-cross at lists.debian.org
Usertags: ftcbfs
X-Debbugs-Cc: debian-cross at lists.debian.org
Control: affects -1 + src:spfft cmake-data

Hi,

cross building src:spfft fails. It uses CMake to discover an MPI
implementation and attempts to use OpenMPI on 64bit architectures. The
CMake code strongly prefers using the compiler wrappers mpicc and
others. These are fundamentally incompatible with cross compilation and
everywhere else the solution has been not to use mpicc. Ideally,
FindMPI.cmake would eventually prefer pkgconf, but it is less than clear
how to get there in a backwards-compatible way. It can be made to use
pkgconf by setting -DMPI_SKIP_COMPILER_WRAPPER=ON, but then we run into
the next problem. It searches for a package named "mpi-cxx" and there is
none. libopenmpi-dev installs lots of ompi-*.pc including ompi-cxx.pc
and manages mpi-*.pc via update-alternatives. Its postinst has a comment
saying that mpi-cxx.pc was removed in OpenMPI >= 5.0.0, which is not
actually the case. What was removed is libmpi++.so and libmpi_cxx.so,
but ompi-cxx.pc continues to exist.

So at present, we're in a situation where CMake + MPI + C++ + cross
compilation does not work in any way. It works if you don't cross build
(via mpicxx) or if you don't use C++ (via mpi-c.pc). How can we move
forward here?

What is the proper way to discover MPI support for C++?

Helmut



More information about the debian-science-maintainers mailing list