-
-
Notifications
You must be signed in to change notification settings - Fork 398
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 GLPK package #3165
add GLPK package #3165
Conversation
assert(package:check_cxxsnippets({test = [[ | ||
#include <glpk.h> | ||
int main() { | ||
return 0; |
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.
Please add some api call to link.
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.
Done
packages/g/glpk/xmake.lua
Outdated
|
||
add_versions("5.0", "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15") | ||
|
||
add_extsources("apt::libglpk-dev") |
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.
if is_plat("linux") then
add_extsources("apt::libglpk-dev")
end
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.
Done
I've added support for building the library for Windows. |
packages/g/glpk/xmake.lua
Outdated
end | ||
|
||
if is_plat("macosx|x86_64", "linux") then | ||
add_deps("autoconf", "automake", "libtool", "pkg-config") |
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.
if ./configure file exists, we need not add these deps. they are only for ./autogen.sh to generate configure.
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.
OK, I removed these lines
packages/g/glpk/xmake.lua
Outdated
|
||
add_versions("5.0", "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15") | ||
|
||
add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean"}) |
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.
? if this library only support static library, we should set readonly = true
, otherwise please remove it.
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.
OK, I also removed this line
packages/g/glpk/xmake.lua
Outdated
end | ||
|
||
on_install("macosx|x86_64", "linux", function (package) | ||
import("package.tools.autoconf").install(package) |
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.
please add static/shared configs
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.
The configure script provides both --enable-shared
and --enable-static
and both are set to yes. Should I disable one of these two according to static/shared configs?
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.
local configs = {}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
import("package.tools.autoconf").install(package, configs)
packages/g/glpk/xmake.lua
Outdated
end) | ||
|
||
on_install("windows", function (package) | ||
os.cd(is_arch("x64", "x86_64") and "w64" or "w32") |
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.
package:is_arch
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.
I simplified this line, as the Makefiles are the same in both directories (I put a comment in the file)
This PR adds the GLPK package. "The GLPK (GNU Linear Programming Kit) package is intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems."