xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.59k stars 765 forks source link

[Toolchains][Fortran] Intel Fortran Toolchain Support for the `ifx` Compiler #5296

Closed tn-072 closed 2 weeks ago

tn-072 commented 3 weeks ago

Is your feature request related to a problem? Please describe.

According to the blog of Intel, ifort (i.e. Intel® Fortran Compiler Classic) is deprecated, and Intel will not provide ifort any more after version 2025.0 release.

Intel recommends customers move to the Intel® Fortran Compiler (ifx) for continued product support, including support of the latest Intel technologies and access to the industry-leading Fortran compiler. The Intel® Fortran Compiler (ifx) is based on the Intel® Fortran Compiler Classic (ifort) frontend and runtime libraries but uses modern LLVM-based backend compiler technology. Thus, ifx gives you all the Fortran features you know and love in ifort ...

I'm trying to use xmake 2.9.3 for build Fortran programs (gfortran and ifx) on Windows, I found that when I use xmake f --toolchain=ifort, xmake will build the project using ifort compiler.


英特尔已经宣布弃用 ifort 并将在 2025.0 版本中移除,并建议开发者迁移至 ifx

目前,xmake 选择 Intel Fortran 工具链(--toolchain=ifort)后会使用 ifort 进行编译。


PS > xmake --version
xmake v2.9.3+HEAD.a5da06f37, A cross-platform build utility based on Lua
Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
                         _
    __  ___ __  __  __ _| | ______
    \ \/ / |  \/  |/ _  | |/ / __ \
     >  <  | \__/ | /_| |   <  ___/
    /_/\_\_|_|  |_|\__ \|_|\_\____|
                         by ruki, xmake.io

    👉  Manual: https://xmake.io/#/getting_started
    🙏  Donate: https://xmake.io/#/sponsor

PS > xmake show -l toolchains | Select-String "Intel"

dpcpp            Intel LLVM C++ Compiler for data parallel programming model based on Khronos SYCL
icc              Intel C/C++ Compiler
icx              Intel LLVM C/C++ Compiler
ifort            Intel Fortran Compiler

PS > xmake f --toolchain=ifort     
checking for platform ... windows
checking for architecture ... x64
checking for Intel Fortran Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2022

PS > xmake build -v
checking for ifort.exe ... \path\to\ifort
checking for the fortran compiler (fc) ... ifort.exe
checking for \path\to\ifort ... ok
checking for flags (-O2) ... ok
[ 50%]: compiling.release src\main.f90
"\path\to\ifort" -c -nologo -O2 -Fobuild\.objs\hello-fort-xmake\windows\x64\release\src\main.f90.obj src\main.f90
checking for flags (cl_sourceDependencies) ... no
checking for ifort.exe ... \path\to\ifort
checking for the fortran linker (fcld) ... ifort.exe
[ 75%]: linking.release hello-fort-xmake.exe
"\path\to\ifort" -o build\windows\x64\release\hello-fort-xmake.exe build\.objs\hello-fort-xmake\windows\x64\release\src\main.f90.obj /link -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf
[100%]: build ok, spent 0.656s

Describe the solution you'd like

Add ifx toolchain support.

PS > xmake show -l toolchains | Select-String "Intel"

dpcpp            Intel LLVM C++ Compiler for data parallel programming model based on Khronos SYCL
icc              Intel C/C++ Compiler
icx              Intel LLVM C/C++ Compiler
ifort            Intel Fortran Compiler
ifx              Intel LLVM Fortran Compiler

PS > xmake f --toolchain=ifx     
checking for platform ... windows
checking for architecture ... x64
checking for Intel LLVM Fortran Compiler (x64) ... ok
checking for Microsoft Visual Studio (x64) version ... 2022

PS > xmake build -v
checking for ifx.exe ... \path\to\ifx
checking for the fortran compiler (fc) ... ifx.exe
checking for \path\to\ifx ... ok
checking for flags (-O2) ... ok

Describe alternatives you've considered

No response

Additional context

waruqi commented 2 weeks ago

暂时没这个环境,你可以直接提个 pr 过来

Issues-translate-bot commented 2 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


We don’t have this environment for now, so you can submit a PR directly.

waruqi commented 2 weeks ago

https://github.com/xmake-io/xmake/pull/5318