Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of GFortran in MKL package #5258

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
23 changes: 16 additions & 7 deletions packages/m/mkl/fetch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,23 @@ function _find_package(package, opt)
table.join2(group, {"mkl_intel_thread", "mkl_core"})
end

if package:has_tool("cc", "gcc", "gxx") then
result.ldflags = "-Wl,--start-group "
for _, lib in ipairs(group) do
result.ldflags = result.ldflags .. "-l" .. lib .. " "
for _, toolkind in ipairs({"ld", "fcld"}) do
if package:has_tool(toolkind, "gcc", "gxx", "gfortran") then
local flags = {"-Wl,--start-group"}
for _, lib in ipairs(group) do
table.insert(flags, "-l" .. lib)
end
table.insert(flags, "-Wl,--end-group")
if package:has_tool(toolkind, "gcc", "gxx") then
result.ldflags = flags
result.shflags = flags
else
result.fcldflags = flags
result.fcshflags = flags
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please simplify repeat table.concat, we need not call table.concat

            if package:has_tool(toolkind, "gfortran") then
                result.fcldflags = flags
                result.fcshflags = flags
            else
                result.ldflags = flags
                result.shflags = flags
            end

else
table.join2(result.links, group)
end
result.ldflags = result.ldflags .. "-Wl,--end-group"
else
table.join2(result.links, group)
end

-- find include
Expand Down
Loading
Loading