[CI] Test C API demo (#6159)
* Fix CMake install config to use dependencies * [CI] Test C API demo * Explicitly cast num_feature, to avoid warning in Linux
This commit is contained in:
committed by
GitHub
parent
bd2b1eabd0
commit
2c4dedb7a0
@@ -1,4 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(api-demo LANGUAGES C CXX VERSION 0.0.1)
|
||||
find_package(xgboost REQUIRED)
|
||||
add_executable(api-demo c-api-demo.c)
|
||||
target_link_libraries(api-demo xgboost::xgboost)
|
||||
target_link_libraries(api-demo PRIVATE xgboost::xgboost)
|
||||
|
||||
@@ -62,7 +62,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
bst_ulong num_feature = 0;
|
||||
safe_xgboost(XGBoosterGetNumFeature(booster, &num_feature));
|
||||
printf("num_feature: %llu\n", num_feature);
|
||||
printf("num_feature: %lu\n", (unsigned long)(num_feature));
|
||||
|
||||
// predict
|
||||
bst_ulong out_len = 0;
|
||||
|
||||
Reference in New Issue
Block a user