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

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:

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?

/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 it seems like this may be an ifx bug, which suggests we should not try using -xHost on fpm?

1 Like

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

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.

2 Likes

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.

1 Like

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.

2 Likes

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.

1 Like