Skip to content

Commit

Permalink
Add open-source library XGBOOST to vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
DadanielZ committed May 16, 2024
1 parent 815d93b commit 83b902b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
47 changes: 47 additions & 0 deletions ports/xgboost/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO dmlc/xgboost
REF v${VERSION}
SHA512 4465f383df70ee415faaeb745459bfc413f71bff0d02e59e67173975188bed911044dbea1a456550496f8c5a7c0b50002275b6be72c87386a6118485e1e41829
HEAD_REF master
)

# Set the expected path of the dmlc-core directory inside the xgboost source directory
vcpkg_from_github(
OUT_SOURCE_PATH DMLC_CORE_SRC
REPO dmlc/dmlc-core
REF 81db539486ce6525b31b971545edffee2754aced
SHA512 9b288fd1ceeef0015e80b0296b0d4015238d4cc1b7c36ba840d3eabce87508e62ed5b4fe61504f569dadcc414882903211fadf54aa0e162a896b03d7ca05e975
HEAD_REF master
)

# Custom CMake script to move dmlc-core to the correct location
file(REMOVE_RECURSE "${SOURCE_PATH}/dmlc-core")
file(RENAME "${DMLC_CORE_SRC}" "${SOURCE_PATH}/dmlc-core")

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

# Configure and build dmlc-core first
# vcpkg_cmake_configure(
# SOURCE_PATH "${SOURCE_PATH}/dmlc-core"
# )

# vcpkg_cmake_install()

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_cmake_install()

# Adjustments to address the warnings
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME xgboost CONFIG_PATH "lib/cmake")

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

21 changes: 21 additions & 0 deletions ports/xgboost/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "xgboost",
"version": "1.7.6",
"description": [
"XGBoost is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable. It implements machine learning algorithms under the Gradient Boosting framework.",
"XGBoost provides a parallel tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way.",
"The same code runs on major distributed environment (Kubernetes, Hadoop, SGE, Dask, Spark, PySpark) and can solve problems beyond billions of examples."
],
"homepage": "https://github.com/dmlc/xgboost",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9480,6 +9480,10 @@
"baseline": "0.3.0",
"port-version": 3
},
"xgboost": {
"baseline": "1.7.6",
"port-version": 0
},
"xlnt": {
"baseline": "1.5.0",
"port-version": 4
Expand Down
9 changes: 9 additions & 0 deletions versions/x-/xgboost.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "91c2544c4e0b9935c1f06ea49f696529d58f7795",
"version": "1.7.6",
"port-version": 0
}
]
}

0 comments on commit 83b902b

Please sign in to comment.