diff options
| author | ruki <[email protected]> | 2021-12-08 23:08:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-12-08 23:08:41 +0800 |
| commit | 42c73afaf38ab2645944c8bccd4e24aedba62d7e (patch) | |
| tree | 9ea696f7fc3f7735b1c504d6fb25e212506d24eb /xmake/modules | |
| parent | dedcd548ec31ad936128b272c705f8f30fb01eb2 (diff) | |
improve ifort toolchain
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/detect/sdks/find_ifortenv.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_ifortenv.lua b/xmake/modules/detect/sdks/find_ifortenv.lua index f45bda0d5..3aca40524 100644 --- a/xmake/modules/detect/sdks/find_ifortenv.lua +++ b/xmake/modules/detect/sdks/find_ifortenv.lua @@ -124,10 +124,14 @@ function _find_intel_on_linux(opt) return {sdkdir = sdkdir, bindir = bindir, libdir = path.join(sdkdir, "lib")} end - if is_host("linux") then - local arch = os.arch() == "x86_64" and "intel64" or "ia32" - local host = is_host("macosx") and "macos" or "linux" - local paths = {"~/intel/oneapi/compiler/latest/" .. host .. "/bin/" .. arch} + -- find it from oneapi sdk directory + local oneapi_rootdirs = {"~/intel/oneapi/compiler", "/opt/intel/oneapi/compiler"} + local arch = os.arch() == "x86_64" and "intel64" or "ia32" + paths = {} + for _, rootdir in ipairs(oneapi_rootdirs) do + table.insert(paths, path.join(rootdir, "*", is_host("macosx") and "mac" or "linux", "bin", arch)) + end + if #paths > 0 then local ifort = find_file("ifort", paths) if ifort then local bindir = path.directory(ifort) |
