-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
base: dev
Are you sure you want to change the base?
Changes from 6 commits
6362643
c76aa5c
532d08d
5c6d269
adb9d01
154419a
1b75df6
e1846a6
e55dc93
039c45b
3c77ada
02faa26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import("lib.detect.find_path") | ||
import("lib.detect.find_library") | ||
|
||
-- add_configs("runtime", {description = "Set MKL runtime for gcc/clang like compilers.", default = "default", type = "string", values = {"default", "custom"}}) | ||
|
||
function _find_package(package, opt) | ||
local rdir = (package:is_arch("x64", "x86_64") and "intel64" or "ia32") | ||
local suffix = (package:config("interface") == 32 and "lp64" or "ilp64") | ||
|
@@ -45,14 +47,27 @@ 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 .. " " | ||
end | ||
result.ldflags = result.ldflags .. "-Wl,--end-group" | ||
else | ||
table.join2(result.links, group) | ||
for _, toolkind in ipairs({"ld", "fcld"}) do | ||
-- if package:config("runtime") == "default" then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove comment |
||
if (package:has_tool(toolkind, "gcc", "gxx") or package:has_tool(toolkind, "gfortran")) then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
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 = table.concat(flags, " ") | ||
result.shflags = table.concat(flags, " ") | ||
else | ||
-- result.fcldflags = table.concat(flags, " ") | ||
-- result.fcshflags = table.concat(flags, " ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove comment |
||
result.fcldflags = table.concat(flags, " ") | ||
result.fcshflags = table.concat(flags, " ") | ||
end | ||
else | ||
table.join2(result.links, group) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
-- end | ||
end | ||
|
||
-- find include | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused comments