summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-07 22:32:28 +0800
committerGitHub <[email protected]>2021-12-07 22:32:28 +0800
commit0944d5ac92facee9d6b41bf0f7d8b049a31eb01f (patch)
treeaab50d9f598d62eb53cadb710369b3538fbdcbe2
parent9d19f1a747c0ebf692fbeca25a78f41b7fcd55e3 (diff)
Update find_ifort.lua
-rw-r--r--xmake/modules/detect/tools/find_ifort.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/find_ifort.lua b/xmake/modules/detect/tools/find_ifort.lua
index ecdb94dfd..dfa8f254c 100644
--- a/xmake/modules/detect/tools/find_ifort.lua
+++ b/xmake/modules/detect/tools/find_ifort.lua
@@ -36,7 +36,6 @@ import("lib.detect.find_programver")
-- @endcode
--
function main(opt)
-
opt = opt or {}
if is_host("windows") then
-- find program
@@ -53,6 +52,20 @@ function main(opt)
return program, version
else
-- find program
+ if is_host("linux") then
+ local arch = os.arch() == "x86_64" and "intel64" or "ia32"
+ local dirs = {"~/intel/oneapi/compiler/latest/linux"}
+ opt.envs = opt.envs or {}
+ opt.paths = opt.paths or {}
+ local LD_LIBRARY_PATH = {}
+ for _, dir in ipairs(dirs) do
+ if os.isdir(dir) then
+ table.insert(LD_LIBRARY_PATH, path.join(dir, "compiler/lib", arch))
+ table.insert(opt.paths, path.join(dir, "bin", arch))
+ end
+ end
+ opt.envs.LD_LIBRARY_PATH = path.joinenv(LD_LIBRARY_PATH)
+ end
local program = find_program(opt.program or "ifort", opt)
-- find program version