# Help using FindMPI in cross compile environment

**URL:** https://discourse.cmake.org/t/help-using-findmpi-in-cross-compile-environment/4433
**Category:** Code
**Created:** [November 5, 2021, 8:11pm UTC](https://discourse.cmake.org/t/help-using-findmpi-in-cross-compile-environment/4433 "2021-11-05T20:11:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Simon\_Song](https://discourse.cmake.org/user_avatar/discourse.cmake.org/simon_song/32/1945_2.png) [@Simon\_Song](https://discourse.cmake.org/u/Simon_Song)
#### Post date: [November 5, 2021, 8:11pm UTC](https://discourse.cmake.org/t/help-using-findmpi-in-cross-compile-environment/4433/1 "2021-11-05T20:11:56Z")

</div>

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.

---

<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: [November 6, 2021, 1:47am UTC](https://discourse.cmake.org/t/help-using-findmpi-in-cross-compile-environment/4433/2 "2021-11-06T01:47:13Z")

</div>

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

Cc: @chuckatkins
