-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[xgboost] Add open-source library xgboost to vcpkg #38743
base: master
Are you sure you want to change the base?
Conversation
c486a54
to
83b902b
Compare
file(REMOVE_RECURSE "${SOURCE_PATH}/dmlc-core") | ||
file(RENAME "${DMLC_CORE_SRC}" "${SOURCE_PATH}/dmlc-core") | ||
|
||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a windows-only limitation?
If yes, please guard with if(VCPKG_TARGET_IS_WINDOWS)
.
IMO it is also better (and common practice) to put this to the op of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is windows-only limitation. My build was on windows, without this vcpkg_check_linkage
the vcpkg build will fail, and it failed because build was looking for "dmlc-core/dmlc.lib" during the link process, but only "dmlc-core/dmlc.dll" was generated in previous build process.
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any executables to be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dg0yt thank you for the review. Not sure if I understand, what executables you were referring to? This code snippet was added based on the post-build check's warnings and its fix suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the directory was created, I suspect that it was created to install either exectuables or DLLs.
In the case of executables, this approach would create inconsistent behavior for static vs dynamic. vcpk_copy_tools(... AUTO_CLEAN)
would give consistent behavior.
In the case of DLLs, they must either be necessary, or they indicate insufficient control of library linkage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dg0yt the generated files under "${CURRENT_PACKAGES_DIR}/bin" and "${CURRENT_PACKAGES_DIR}/debug/bin" are two files: xgboost.exe and xgboost.dll.
I replaced the above code with vcpk_copy_tools
but I see the same warning and the same suggestion to remove the bin and debug/bin folders:
vcpkg_copy_tools( TOOL_NAMES xgboost SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" AUTO_CLEAN )
warning: If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | |
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | |
endif() | |
vcpkg_copy_tools(TOOL_NAMES xgboost AUTO_CLEAN) |
must handles this, really.
Not sure, if it helps, but here is our overlay port of xgboost of version v2.0.3 We are using it to build our application getML on Linux. |
The x86 and arm64 logs seem to indicate problems with intrinsics IIUC. And uwp doesn't offer some of the windows API. Probably these triplets need to be excluded from
|
@dg0yt Currently, XGBoost sets the MSVC link flags ( |
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
) | |
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT) | |
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
OPTIONS | |
-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT} | |
) |
You just have to use the options it offers. |
Got it. Would it be a problem for you if XGBoost would start using |
Nothing which couldn't be solved. |
Add open-source library xgboost to vcpkg
xgboost github repo: https://github.com/dmlc/xgboost/
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.vcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.