Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29229 Discussions

Compilation error with -fast on AMD Ryzen 9 9900X using ifx

hoshi
Beginner
635 Views

On a host with an AMD Ryzen 9 9900X CPU (Zen 5 architecture), compiling a Fortran 90 code with the -fast option raises a compilation error: "Unknown target CPU 'native'." The compilation works fine without this option.

As a workaround, I'm currently using -O3 -march=znver5 instead, which resolves the issue.

Is this a known issue for ifx on AMD Ryzen platforms, specifically with Zen 5 architecture?

 

System Information:

 

  1. CPU: AMD Ryzen 9 9900X 12-Core Processor

  2. Operating System: Ubuntu 24.04

  3. Compiler Version: ifx (IFX) 2025.2.1 20250806

 

hello.f90:

program hello_world
  implicit none
  print *, "Hello, World!"
end program hello_world
Bash:
 
ifx -fast -o hello.out hello.f90

Output:

hello.f90: error #5544: Unknown target CPU 'native'. Valid CPU targets: ...
compilation aborted for hello.f90 (code 1)

 

 

Thank you,

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
563 Views

-fast implies -xHost, which is the only -x option supporting execution on non-Intel processors.  I wrote the original code to support -xHost, using the CPUINFO instruction to look at instruction sets supported and selecting the best -march option to match that. I'm pretty sure that code was replaced some years ago with some that uses specific architecture names, and it probably hasn't been updated to account for Zen5.

It may be that the LLVM backend has its own knowledge of -march names, which is why explicitly specifying znver5 works.

View solution in original post

3 Replies
MarcGrodent
Novice
592 Views

I don't have the answer to your question. However, concerning the -march option, 'znver5' does not seem to be a valid processor name according to the compiler doc (https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-2/march.html ). I'm not sure what the compiler does if the processor name is not recognized.

0 Kudos
Steve_Lionel
Honored Contributor III
564 Views

-fast implies -xHost, which is the only -x option supporting execution on non-Intel processors.  I wrote the original code to support -xHost, using the CPUINFO instruction to look at instruction sets supported and selecting the best -march option to match that. I'm pretty sure that code was replaced some years ago with some that uses specific architecture names, and it probably hasn't been updated to account for Zen5.

It may be that the LLVM backend has its own knowledge of -march names, which is why explicitly specifying znver5 works.

hoshi
Beginner
362 Views

Thank you both for the  replies.

I will continue to use the explicit "-03 -march=znver5" workaround for now.

Your answers have been incredibly helpful. Thank you again for your insights.

 

0 Kudos
Reply