Skip to content

Conversation

@jakirkham
Copy link
Contributor

@jakirkham jakirkham commented Jul 27, 2024

Fixes #5386
Fixes conda-forge/xgboost-feedstock#51

When searching for libxgboost on Windows, this adds Library\mingw-w64 to the search path after other paths

This currently is done as a patch in conda-forge. Given this is just checking one more location (and after checking the usual ones), though it made sense to go ahead and upstream this one

sys_prefix / "Library" / "bin",
sys_prefix / "Library" / "lib",
sys_prefix / "Library" / "mingw-w64",
sys_prefix / "Library" / "mingw-w64" / "bin",
Copy link
Member

Choose a reason for hiding this comment

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

Could you please share under which condition libxgboost is on the bin path? Also, is mingw ever used for compiling the Python package? Asking since mingw has/had a broken Unix socket implementation, hence distributed computing is disabled there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Conda-forge uses Visual Studio to build the Python package. See the logs at https://github.com/conda-forge/xgboost-feedstock/runs/27951580159.

@jakirkham I am inclined to exclude this patch from the upstream because the use of mingw-w64 appears to be a convention specific to Conda-forge and not generally applicable to all users.

Copy link
Member

Choose a reason for hiding this comment

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

If conda forge uses visual studio, maybe we can simply drop the patch from conda forge as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, Conda-forge needs this patch. Libraries are installed under the mingw-w64 directory. I tried removing it and got errors.

Copy link
Member

Choose a reason for hiding this comment

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

In the bin directory?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. The patch is a product of trial and error. I had to add it to get conda-forge/xgboost-feedstock#132 working.

Copy link
Member

Choose a reason for hiding this comment

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

That's unexpected. Thank you for sharing. I'm fine with merging it then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you both! 🙏

@hcho3 hcho3 merged commit d4b82f5 into dmlc:master Jul 29, 2024
hcho3 pushed a commit to hcho3/xgboost that referenced this pull request Jul 29, 2024
hcho3 added a commit that referenced this pull request Jul 30, 2024
Co-authored-by: jakirkham <jakirkham@gmail.com>
@jakirkham jakirkham deleted the upstream_mingw-w64_patch branch July 30, 2024 19:15
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.

Upstream search path logic for libxgboost Allow python/R bindings to use an external libxgboost

3 participants