Remove plugin, cuda related code in automake & autoconf files (#4789)

* Build plugin example with CMake.

* Remove plugin, cuda related code in automake & autoconf files.

* Fix typo in GPU doc.
This commit is contained in:
Jiaming Yuan
2019-08-18 16:54:34 -04:00
committed by GitHub
parent c358d95c44
commit ab357dd41c
17 changed files with 56 additions and 94 deletions

9
plugin/CMakeLists.txt Normal file
View File

@@ -0,0 +1,9 @@
if (PLUGIN_LZ4)
set(PLUGIN_SOURCES ${PLUGIN_SOURCES}
${xgboost_SOURCE_DIR}/plugin/lz4/sparse_page_lz4_format.cc PARENT_SCOPE)
endif (PLUGIN_LZ4)
if (PLUGIN_DENSE_PARSER)
set(PLUGINS_SOURCES ${PLUGINS_SOURCES}
${xgboost_SOURCE_DIR}/plugin/dense_parser/dense_libsvm.cc PARENT_SCOPE)
endif (PLUGIN_DENSE_PARSER)

View File

@@ -1,30 +1,19 @@
XGBoost Plugins Modules
=======================
This folder contains plugin modules to xgboost that can be optionally installed.
The plugin system helps us to extend xgboost with additional features,
and add experimental features that may not yet be ready to be included in the
main project.
To include a certain plugin, say ```plugin_a```, you only need to add the following line to the config.mk.
This folder contains plugin modules to xgboost that can be optionally installed. The
plugin system helps us to extend xgboost with additional features, and add experimental
features that may not yet be ready to be included in the main project.
```makefile
# Add plugin by including the plugin in config.mk
XGB_PLUGINS += plugin/plugin_a/plugin.mk
To include a certain plugin, say ```plugin_a```, you only need to add the following line
to `xgboost/plugin/CMakeLists.txt`
``` cmake
set(PLUGIN_SOURCES ${PLUGIN_SOURCES}
${xgboost_SOURCE_DIR}/plugin/plugin_a.cc PARENT_SCOPE)
```
along with specified source file `plugin_a.cc`.
Then rebuild libxgboost by typing ```make```, you can get a new library with the plugin enabled.
Link Static XGBoost Library with Plugins
----------------------------------------
This problem only happens when you link ```libxgboost.a```.
If you only use ```libxgboost.so```(this include python and other bindings),
you can ignore this section.
When you want to link ```libxgboost.a``` with additional plugins included,
you will need to enabled whole archive via The following option.
```bash
--whole-archive libxgboost.a --no-whole-archive
```
Then rebuild XGBoost with CMake.
Write Your Own Plugin
---------------------

View File

@@ -1,2 +0,0 @@
PLUGIN_OBJS += build_plugin/dense_parser/dense_libsvm.o
PLUGIN_LDFLAGS +=

View File

@@ -1,21 +1,19 @@
XGBoost Plugin Example
======================
This folder provides an example of xgboost plugin.
This folder provides an example of implementing xgboost plugin.
There are three steps you need to do to add a plugin to xgboost
- Create your source .cc file, implement a new extension
- In this example [custom_obj.cc](custom_obj.cc)
- Register this extension to xgboost via a registration macro
- In this example ```XGBOOST_REGISTER_OBJECTIVE``` in [this line](custom_obj.cc#L75)
- Create a [plugin.mk](plugin.mk) on this folder
To add this plugin, add the following line to ```config.mk```(template in make/config.mk).
```makefile
# Add plugin by include the plugin in config
XGB_PLUGINS += plugin/plugin_a/plugin.mk
- In this example ```XGBOOST_REGISTER_OBJECTIVE``` in [this line](custom_obj.cc#L78)
- Add a line to `xgboost/plugin/CMakeLists.txt`:
```
set(PLUGINS_SOURCES ${PLUGINS_SOURCES}
${xgboost_SOURCE_DIR}/plugin/example/custom_obj.cc PARENT_SCOPE)
```
Then you can test this plugin by using ```objective=mylogistic``` parameter.
<!-- LocalWords: XGBoost
-->

View File

@@ -1,4 +0,0 @@
# Add the object files you like to include in this plugin.
PLUGIN_OBJS += build_plugin/example/custom_obj.o
# Add additional dependent libraries this plugin might have
PLUGIN_LDFLAGS +=

View File

@@ -1,2 +0,0 @@
PLUGIN_OBJS += build_plugin/lz4/sparse_page_lz4_format.o
PLUGIN_LDFLAGS += -llz4

View File

@@ -1,3 +0,0 @@
# CUDA Accelerated Tree Construction Algorithms
[The XGBoost GPU documentation has moved here.](https://xgboost.readthedocs.io/en/latest/gpu/index.html)