Help using FindMPI in cross compile environment

Dear cmake community,

I’m trying to setup cross compilation (host x86, target arm64) with openmpi as a depdendency. I’d only need libmpi and libmpi_cxx currently. I wanted to link the arm64 ubuntu distribution of openmpi-dev and the distributed compiler wrapper cannot run in the host env in this case.

I was wondering if there’s a way to manually provide the include/lib paths, flags, and version numbers to FindMPI.cmake without going through the compiler wrapper and still run all the try_compile’s in that routine.

I am aware that there’s a standard cross compilation flow from openmpi that involves re-compiling the lib and generating a perl compiler wrapper, but just wondering if I could avoid doing that in this case.

Would really appreciate any suggestions.

You can set MPI_SKIP_COMPILER_WRAPPER to OFF to disable usage of the compiler wrappers.

Cc: @chuckatkins