Browse Source

Fix Intel compiler flags for OpenMP (#7540)

* Fix Intel compiler flags for OpenMP

The Intel C++ Compiler Classic (`icc`) is deprecated and was discontinued 2024.
As an alternative, it is recommended that developers use the Intel OneAPI C++ compiler (`icx`).
The same is true for the Intel Fortran compiler: `ifort` is deprecated in favour of `ifx`.
See the [icc Release notes](https://www.intel.com/content/www/us/en/developer/articles/release-notes/oneapi-c-compiler-release-notes.html) for more details.

Following the name change, xmake failed to provide the correct compiler flags for OpenMP, a parallel computing library for multicore processors.
See also xmake-io/xmake#6596 for more information.

This pull request involves making minor changes to the xmake configuration for OpenMP, essentially renaming 'icc' to 'icx' and 'ifort' to 'ifx', to ensure that the Intel compiler is correctly detected and that OpenMP receives the correct compiler flags.

* keep old and new

---------

Co-authored-by: Mavoort <[email protected]>
Co-authored-by: Saikari <[email protected]>
Marcel Angenvoort 5 months ago
parent
commit
82edfbf300
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/o/openmp/xmake.lua

+ 2 - 2
packages/o/openmp/xmake.lua

@@ -50,7 +50,7 @@ package("openmp")
                     end
                 elseif package:has_tool(toolkind, "gcc", "gxx", "gfortran") then
                     result[flagname] = "-fopenmp"
-                elseif package:has_tool(toolkind, "icc", "icpc", "ifort") then
+                elseif package:has_tool(toolkind, "icc", "icpc", "ifort", "icx", "icpx", "ifx") then
                     result[flagname] = "-qopenmp"
                 elseif package:has_tool(toolkind, "icl") then
                     result[flagname] = "-Qopenmp"
@@ -66,7 +66,7 @@ package("openmp")
                     elseif package:has_tool(toolkind, "gcc", "gxx") then
                         result.ldflags = "-fopenmp"
                         result.shflags = "-fopenmp"
-                    elseif package:has_tool(toolkind, "icc", "icpc") then
+                    elseif package:has_tool(toolkind, "icc", "icpc", "icx", "icpx") then
                         result.ldflags = "-qopenmp"
                         result.shflags = "-qopenmp"
                     elseif package:has_tool(toolkind, "icl") then