# FindMPI Intel ILP64 does not include the correct .mod file on Windows/ifx

**URL:** https://discourse.cmake.org/t/findmpi-intel-ilp64-does-not-include-the-correct-mod-file-on-windows-ifx/15204
**Category:** Usage
**Created:** [September 30, 2025, 9:10am UTC](https://discourse.cmake.org/t/findmpi-intel-ilp64-does-not-include-the-correct-mod-file-on-windows-ifx/15204 "2025-09-30T09:10:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Istvan\_L](https://discourse.cmake.org/user_avatar/discourse.cmake.org/istvan_l/32/5837_2.png) [@Istvan\_L](https://discourse.cmake.org/u/Istvan_L)
#### Post date: [September 30, 2025, 9:10am UTC](https://discourse.cmake.org/t/findmpi-intel-ilp64-does-not-include-the-correct-mod-file-on-windows-ifx/15204/1 "2025-09-30T09:10:09Z")

</div>

Hello, i’m trying to use Intel MPI in a CMakefile (\>= 4.1)

with the 64-bit default integer size ( -ilp64 / -i8 / -integer-size:64 )

I wrote

```auto
set(MPI_Fortran_COMPILER_FLAGS "-i8")

find_package(MPI REQUIRED)

```

On Windows, Intel OneAPI MPI 2021.10 environment was set up by the setvars.bat.

find\_package correctly detects the libraries

MPI\_Fortran\_LIBRARIES = C:/Program Files (x86)/Intel/oneAPI/mpi/2021.10.0/lib/libmpi\_ilp64.lib;C:/Program Files (x86)/Intel/oneAPI/mpi/2021.10.0/lib/release/impi.lib

this is correct, it is important that libmpi\_ilp64.lib comes before impi.lib

However, the module INCLUDE directory is not set up to the ILP64 folder, which means the Fortran compiler will load the mpi.mod belonging to 32-bit integer sizes, which results in a mismatch (and crash)

As a workaround i set something like

```auto
list(GET MPI_Fortran_INCLUDE_DIRS 0 inc)
include_directories(BEFORE ${inc}/ilp64)

```

additionally, the executable is linked as

add\_executable(hello\_mpi ${SOURCES\_HELLO} )

target\_link\_libraries(hello\_mpi MPI::MPI\_Fortran)  
set\_property(TARGET hello\_mpi PROPERTY LINKER\_LANGUAGE Fortran)

I use the ifx fortran compiler.

Is this something that can be fixed inside FindMPI, or I’m using it wrongly?  
Thank you!  
Istvan
