# \`ifx\` \`xHost\` flag returns "Unknown target CPU \`native\`"

**URL:** <https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420>\
**Category:** Intel\
**Created:** [September 28, 2025, 8:48am UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420 "2025-09-28T08:48:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FedericoPerini](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/federicoperini/32/1750_2.png) [@FedericoPerini](https://fortran-lang.discourse.group/u/FedericoPerini)\
**Post date:** [September 28, 2025, 8:48am UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420/1 "2025-09-28T08:48:58Z")

</div>

I am getting CI failures with `ifx 2025.1` apparently due to architecture flags while building fpm: I would like to ask you help as I don’t have an OneAPI installation on my mac setup. Compilation flags are:

```auto
flags=-O3 -xHost -unroll -O3 -fast

```

The error message says that “native” is not valid but I’m puzzled. Is that a byproduct of `-xHost`?

```sh
/tmp/ifx1952793954uITnls/ifx48QP51.i90: 
error #5544: Unknown target CPU 'native'. Valid CPU targets: alderlake amdfam10 arrowlake arrowlake-s athlon-fx athlon64 athlon64-sse3 atom barcelona bdver1 bdver2 bdver3 bdver4 
bonnell broadwell btver1 btver2 cannonlake cascadelake clearwaterforest common-avx512 
cooperlake core-avx-i core-avx2 core2 corei7 corei7-avx diamondrapids emeraldrapids goldmont 
goldmont-plus gracemont grandridge graniterapids graniterapids-d haswell icelake-client icelake-server ivybridge k8 k8-sse3 lunarlake meteorlake nehalem nocona opteron opteron-sse3 
pantherlake penryn raptorlake rocketlake sandybridge sapphirerapids sierraforest silvermont skx 
skylake skylake-avx512 slm tigerlake tremont westmere x86-64 x86-64-v2 x86-64-v3 x86-64-v4 
znver1 znver2 znver3 znver4 znver5.

compilation aborted for app/main.f90 (code 1)

```

On the [Intel Forum](https://community.intel.com/t5/Intel-Fortran-Compiler/Compilation-error-with-fast-on-AMD-Ryzen-9-9900X-using-ifx/m-p/1712303#M176803) it seems like this may be an `ifx` bug, which suggests we should not try using `-xHost` on fpm?

---

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [September 28, 2025, 9:06am UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420/2 "2025-09-28T09:06:23Z")

</div>

> [@FedericoPerini](#):
>
> ifx 2025.1

did you try upgrading the CI to use ifx 2025.2 and check ?

> [@FedericoPerini](#):
>
> On the [Intel Forum](https://community.intel.com/t5/Intel-Fortran-Compiler/Compilation-error-with-fast-on-AMD-Ryzen-9-9900X-using-ifx/m-p/1712303#M176803) it seems like this may be an `ifx` bug, which suggests we should not try using `-xHost` on fpm?

If this is the case then maybe it is a general problem with the github runners on AMD CPUs … would be a bummer if this would force to manually adapt the flags.

On my side `-xHost` works but it is an intel CPU, it would be necessary to test on a AMD CPU.

---

<div class="post-metadata">

**Author:** ![FedericoPerini](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/federicoperini/32/1750_2.png) [@FedericoPerini](https://fortran-lang.discourse.group/u/FedericoPerini)\
**Post date:** [September 28, 2025, 9:47am UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420/3 "2025-09-28T09:47:43Z")

</div>

> [@hkvzjal](#):
>
> use ifx 2025.2

Unfortunately it does not help. Yeah I believe github may pickup either an AMD or an Intel CPU for the x86\_64 platform, which is actually a good thing - the setup has to work either way.

---

<div class="post-metadata">

**Author:** ![jwmwalrus](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jwmwalrus/32/4483_2.png) [@jwmwalrus](https://fortran-lang.discourse.group/u/jwmwalrus)\
**Post date:** [September 28, 2025, 1:01pm UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420/4 "2025-09-28T13:01:46Z")

</div>

It’s usually not a good idea to set the `-fast` flag, unless you’re certain you’re going to run the executable in the exact same host it was compiled. The `ifx` man page has the note:

> NOTE: Option fast sets some aggressive optimizations that may not be appropriate for all applications. The resulting exe‐  
> cutable may not run on processor types different from the one on which you compile. You should make sure that you understand  
> the individual optimization options that are enabled by option fast.

That is, the `-fast` flag is mostly for benchmark purposes and might change substantially from one version to another.

`ifort` man page has

> On ifort, it sets the following options:
> 
> -ipo, -O3, -no-prec-div,-static, -fp-model fast=2, and -xHost

And `ifx` has

> It sets the following options:
> 
> -ipo, -O3, -static, -fp-model fast

So, you could just explicitly set the flags you want and avoid the hassle.

---

<div class="post-metadata">

**Author:** ![FedericoPerini](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/federicoperini/32/1750_2.png) [@FedericoPerini](https://fortran-lang.discourse.group/u/FedericoPerini)\
**Post date:** [September 28, 2025, 2:01pm UTC](https://fortran-lang.discourse.group/t/ifx-xhost-flag-returns-unknown-target-cpu-native/10420/5 "2025-09-28T14:01:35Z")

</div>

Thanks, that looks like a good solution. I agree avoiding `xHost` (also through `-fast`) is definitely the way to go. That said, the `native` issue definitely looks like a bug to me; I hope posting it here will be useful.
