[Pkg-cmake-team] Bug#943312: cmake: FindMPI.cmake does not work during cross compilation
helmut at subdivi.de
Wed Oct 23 08:47:57 BST 2019
Tags: patch upstream
User: debian-cross at lists.debian.org
Control: affects -1 + src:flann src:hyphy src:liggghts src:sopt
FindMPI.cmake uses compiler wrappers such as mpicc to discover the
relevant compiler and linker flags. During cross compilation, these
compiler wrappers do not work and they will not be supported on Debian.
Beyond breaking cross compilation, you cannot easily combine multiple
compiler wrappers (e.g. ccache/distcc/mpicc). It is best to avoid
compiler wrappers entirely and for MPI, this is well supported as all
major implementations ship pkg-config files since ages. I am asking to
stop using mpicc and switch over to pkg-config.
Unfortunately, FindMPI.cmake exposes MPI_*_COMPILER and a number of
downstreams use these wrappers that cannot be used during cross
compilation. Every downstream that wants to be cross buildable must stop
using them and I've filed a relevant patch for liggghts. Avoiding
MPI_*_COMPILER is easy enough in the majority of cases, because
FindMPI.cmake also provides the relevant flags in via other variables.
Still, we must maintain backwards compatibility and thus continue
supplying MPI_*_COMPILER when it is available (i.e. during native
The attached patch thus tries the wrappers first before falling back to
pkg-config. I've tested it with flann, hyphy, liggghts and sopt. Of
these, flann and sopt are fixed by this patch. hyphy and liggghts need
further patches, which are submitted separately. Please consider
applying the attached patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2911 bytes
Desc: not available
More information about the Pkg-cmake-team