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

Support shared library in system path. #6362

Merged
merged 1 commit into from
Nov 10, 2020
Merged

Conversation

trivialfis
Copy link
Member

@trivialfis trivialfis commented Nov 10, 2020

Another attempt on #6292 . Differences:

  • sysconfig.get_config_var('LIBDIR') in Patch libpath.py to be compatible with FreeBSD #6292 is not used here as I think sys.prefix + 'lib' should be sufficient although I haven't tested it on freebsd. sys.prefix can be altered by virtualenv while sysconfig is invariant.
  • setup.py is changed to omit building or copying libxgboost.so when the user option --use-system-libxgboost is specified. So the Python package will not contain a redundant shared object. Combined with the ordering of candidate paths in find_lib, correct libxgboost.so should be loaded.

Closes #6291
Closes #5705

@codecov-io
Copy link

codecov-io commented Nov 10, 2020

Codecov Report

Merging #6362 (a4d9dc2) into master (519cee1) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6362      +/-   ##
==========================================
+ Coverage   81.31%   81.37%   +0.06%     
==========================================
  Files          12       12              
  Lines        3425     3437      +12     
==========================================
+ Hits         2785     2797      +12     
  Misses        640      640              
Impacted Files Coverage Δ
python-package/xgboost/libpath.py 55.55% <ø> (ø)
python-package/xgboost/training.py 96.52% <0.00%> (+0.03%) ⬆️
python-package/xgboost/callback.py 93.15% <0.00%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 519cee1...a4d9dc2. Read the comment docs.

Copy link
Collaborator

@hcho3 hcho3 left a comment

Choose a reason for hiding this comment

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

Approving for now. On a closer look, sysconfig.get_config_var('LIBDIR') should be equivalent to os.path.join(sys.prefix, 'lib').

@trivialfis trivialfis merged commit e65e3cf into dmlc:master Nov 10, 2020
@trivialfis trivialfis deleted the syspath branch November 10, 2020 08:04
@trivialfis trivialfis mentioned this pull request Nov 24, 2020
14 tasks
olarende-tink pushed a commit to tink-ab/xgboost that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants