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

Locate static cbc libs on windows via CBC_ROOT #28

Closed
wants to merge 2 commits into from
Closed

Locate static cbc libs on windows via CBC_ROOT #28

wants to merge 2 commits into from

Conversation

Thell
Copy link

@Thell Thell commented Apr 8, 2023

This uses std::env to check for CBC_ROOT on windows family targets an use that path for the search path for cbc libraries as named in the coin-or Cbc releases for windows (mscvXX) builds and sets the link kind="static" for linking.

If CBC_ROOT is not found a cargo:warning is emitted instead of a panic so it won't interfere with any existing windows build work-arounds.

@TeXitoi
Copy link
Collaborator

TeXitoi commented Apr 12, 2023

I don't know windows compilation procedure. But as it is better than before and can't be worst, I'm OK to merge this.

I wait a bit if there is some review from the community. I'll merge it next week. Feel free to remind me if I forget by pinging me in this thread.

Thanks for the contribution!

@Thell Thell closed this by deleting the head repository May 4, 2023
@NickHu
Copy link

NickHu commented Jul 13, 2023

@Thell was this closed intentionally? I am quite interested in compiling for Windows with statically-linked Cbc

println!(r"cargo:rustc-link-lib=static=Osi");
println!(r"cargo:rustc-link-lib=static=OsiClp");
println!(r"cargo:rustc-link-lib=static=zlib");
()
Copy link

Choose a reason for hiding this comment

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

This line seems unnecessary

@Thell
Copy link
Author

Thell commented Jul 13, 2023

@Thell was this closed intentionally? I am quite interested in compiling for Windows with statically-linked Cbc

I was cleaning up repos in my account and thought that the pull request had the needed pieces.
I didn't think about it closing the PR because I removed my branch.

#[link(name = "CbcSolver")]
#[cfg_attr(
target_family = "windows",
link(name = "libCbcSolver", kind = "static")
Copy link

Choose a reason for hiding this comment

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

Seems to still work fine if you drop kind = "static"; should it really be forced?

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