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 GLPK package #3165

Merged
merged 9 commits into from
Jan 27, 2024
Merged

add GLPK package #3165

merged 9 commits into from
Jan 27, 2024

Conversation

jube
Copy link
Contributor

@jube jube commented Jan 24, 2024

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."

assert(package:check_cxxsnippets({test = [[
#include <glpk.h>
int main() {
return 0;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


add_versions("5.0", "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15")

add_extsources("apt::libglpk-dev")
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jube
Copy link
Contributor Author

jube commented Jan 26, 2024

I've added support for building the library for Windows.
Should I remove the macOS support as it does not build on this platform?

end

if is_plat("macosx|x86_64", "linux") then
add_deps("autoconf", "automake", "libtool", "pkg-config")
Copy link
Member

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.

Copy link
Contributor Author

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


add_versions("5.0", "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15")

add_configs("shared", {description = "Build shared binaries", default = false, type = "boolean"})
Copy link
Member

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.

Copy link
Contributor Author

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

end

on_install("macosx|x86_64", "linux", function (package)
import("package.tools.autoconf").install(package)
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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)

end)

on_install("windows", function (package)
os.cd(is_arch("x64", "x86_64") and "w64" or "w32")
Copy link
Member

Choose a reason for hiding this comment

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

package:is_arch

Copy link
Contributor Author

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)

@waruqi waruqi merged commit e269b95 into xmake-io:dev Jan 27, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants