From 0944d5ac92facee9d6b41bf0f7d8b049a31eb01f Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 7 Dec 2021 22:32:28 +0800 Subject: Update find_ifort.lua --- xmake/modules/detect/tools/find_ifort.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1