Deprecate the command line interface. (#9485)
--------- Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
parent
38a3e1b858
commit
e6cf7a1278
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_DENSE_PARSER=ON -GNinja
|
cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_DENSE_PARSER=ON -GNinja -DBUILD_DEPRECATED_CLI=ON
|
||||||
ninja -v
|
ninja -v
|
||||||
- name: Run gtest binary
|
- name: Run gtest binary
|
||||||
run: |
|
run: |
|
||||||
@ -56,7 +56,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_OPENMP=OFF
|
cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_OPENMP=OFF -DBUILD_DEPRECATED_CLI=ON
|
||||||
ninja -v
|
ninja -v
|
||||||
- name: Run gtest binary
|
- name: Run gtest binary
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
6
.github/workflows/python_tests.yml
vendored
6
.github/workflows/python_tests.yml
vendored
@ -143,7 +143,7 @@ jobs:
|
|||||||
# Set prefix, to use OpenMP library from Conda env
|
# Set prefix, to use OpenMP library from Conda env
|
||||||
# See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
|
# See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
|
||||||
# to learn why we don't use libomp from Homebrew.
|
# to learn why we don't use libomp from Homebrew.
|
||||||
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
|
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
- name: Install Python package
|
- name: Install Python package
|
||||||
@ -190,7 +190,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build_msvc
|
mkdir build_msvc
|
||||||
cd build_msvc
|
cd build_msvc
|
||||||
cmake .. -G"Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -A x64 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON
|
cmake .. -G"Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -A x64 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DBUILD_DEPRECATED_CLI=ON
|
||||||
cmake --build . --config Release --parallel $(nproc)
|
cmake --build . --config Release --parallel $(nproc)
|
||||||
|
|
||||||
- name: Install Python package
|
- name: Install Python package
|
||||||
@ -234,7 +234,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
|
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
- name: Install Python package
|
- name: Install Python package
|
||||||
|
|||||||
@ -45,6 +45,7 @@ set_default_configuration_release()
|
|||||||
option(BUILD_C_DOC "Build documentation for C APIs using Doxygen." OFF)
|
option(BUILD_C_DOC "Build documentation for C APIs using Doxygen." OFF)
|
||||||
option(USE_OPENMP "Build with OpenMP support." ON)
|
option(USE_OPENMP "Build with OpenMP support." ON)
|
||||||
option(BUILD_STATIC_LIB "Build static library" OFF)
|
option(BUILD_STATIC_LIB "Build static library" OFF)
|
||||||
|
option(BUILD_DEPRECATED_CLI "Build the deprecated command line interface" OFF)
|
||||||
option(FORCE_SHARED_CRT "Build with dynamic CRT on Windows (/MD)" OFF)
|
option(FORCE_SHARED_CRT "Build with dynamic CRT on Windows (/MD)" OFF)
|
||||||
option(RABIT_BUILD_MPI "Build MPI" OFF)
|
option(RABIT_BUILD_MPI "Build MPI" OFF)
|
||||||
## Bindings
|
## Bindings
|
||||||
@ -273,19 +274,30 @@ target_include_directories(xgboost
|
|||||||
#-- End shared library
|
#-- End shared library
|
||||||
|
|
||||||
#-- CLI for xgboost
|
#-- CLI for xgboost
|
||||||
add_executable(runxgboost ${xgboost_SOURCE_DIR}/src/cli_main.cc)
|
if (BUILD_DEPRECATED_CLI)
|
||||||
target_link_libraries(runxgboost PRIVATE objxgboost)
|
add_executable(runxgboost ${xgboost_SOURCE_DIR}/src/cli_main.cc)
|
||||||
target_include_directories(runxgboost
|
target_link_libraries(runxgboost PRIVATE objxgboost)
|
||||||
PRIVATE
|
target_include_directories(runxgboost
|
||||||
${xgboost_SOURCE_DIR}/include
|
PRIVATE
|
||||||
${xgboost_SOURCE_DIR}/dmlc-core/include
|
${xgboost_SOURCE_DIR}/include
|
||||||
${xgboost_SOURCE_DIR}/rabit/include
|
${xgboost_SOURCE_DIR}/dmlc-core/include
|
||||||
)
|
${xgboost_SOURCE_DIR}/rabit/include
|
||||||
set_target_properties(runxgboost PROPERTIES OUTPUT_NAME xgboost)
|
)
|
||||||
|
set_target_properties(runxgboost PROPERTIES OUTPUT_NAME xgboost)
|
||||||
|
xgboost_target_properties(runxgboost)
|
||||||
|
xgboost_target_link_libraries(runxgboost)
|
||||||
|
xgboost_target_defs(runxgboost)
|
||||||
|
|
||||||
|
if (KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
|
||||||
|
set_output_directory(runxgboost ${xgboost_BINARY_DIR})
|
||||||
|
else ()
|
||||||
|
set_output_directory(runxgboost ${xgboost_SOURCE_DIR})
|
||||||
|
endif (KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
|
||||||
|
endif (BUILD_DEPRECATED_CLI)
|
||||||
#-- End CLI for xgboost
|
#-- End CLI for xgboost
|
||||||
|
|
||||||
# Common setup for all targets
|
# Common setup for all targets
|
||||||
foreach(target xgboost objxgboost dmlc runxgboost)
|
foreach(target xgboost objxgboost dmlc)
|
||||||
xgboost_target_properties(${target})
|
xgboost_target_properties(${target})
|
||||||
xgboost_target_link_libraries(${target})
|
xgboost_target_link_libraries(${target})
|
||||||
xgboost_target_defs(${target})
|
xgboost_target_defs(${target})
|
||||||
@ -298,14 +310,15 @@ if (JVM_BINDINGS)
|
|||||||
endif (JVM_BINDINGS)
|
endif (JVM_BINDINGS)
|
||||||
|
|
||||||
if (KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
|
if (KEEP_BUILD_ARTIFACTS_IN_BINARY_DIR)
|
||||||
set_output_directory(runxgboost ${xgboost_BINARY_DIR})
|
|
||||||
set_output_directory(xgboost ${xgboost_BINARY_DIR}/lib)
|
set_output_directory(xgboost ${xgboost_BINARY_DIR}/lib)
|
||||||
else ()
|
else ()
|
||||||
set_output_directory(runxgboost ${xgboost_SOURCE_DIR})
|
|
||||||
set_output_directory(xgboost ${xgboost_SOURCE_DIR}/lib)
|
set_output_directory(xgboost ${xgboost_SOURCE_DIR}/lib)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Ensure these two targets do not build simultaneously, as they produce outputs with conflicting names
|
# Ensure these two targets do not build simultaneously, as they produce outputs with conflicting names
|
||||||
add_dependencies(xgboost runxgboost)
|
if (BUILD_DEPRECATED_CLI)
|
||||||
|
add_dependencies(xgboost runxgboost)
|
||||||
|
endif (BUILD_DEPRECATED_CLI)
|
||||||
|
|
||||||
#-- Installing XGBoost
|
#-- Installing XGBoost
|
||||||
if (R_LIB)
|
if (R_LIB)
|
||||||
@ -341,9 +354,17 @@ install(DIRECTORY ${xgboost_SOURCE_DIR}/include/xgboost
|
|||||||
#
|
#
|
||||||
# https://github.com/dmlc/xgboost/issues/6085
|
# https://github.com/dmlc/xgboost/issues/6085
|
||||||
if (BUILD_STATIC_LIB)
|
if (BUILD_STATIC_LIB)
|
||||||
set(INSTALL_TARGETS xgboost runxgboost objxgboost dmlc)
|
if (BUILD_DEPRECATED_CLI)
|
||||||
|
set(INSTALL_TARGETS xgboost runxgboost objxgboost dmlc)
|
||||||
|
else()
|
||||||
|
set(INSTALL_TARGETS xgboost objxgboost dmlc)
|
||||||
|
endif (BUILD_DEPRECATED_CLI)
|
||||||
else (BUILD_STATIC_LIB)
|
else (BUILD_STATIC_LIB)
|
||||||
set(INSTALL_TARGETS xgboost runxgboost)
|
if (BUILD_DEPRECATED_CLI)
|
||||||
|
set(INSTALL_TARGETS xgboost runxgboost)
|
||||||
|
else(BUILD_DEPRECATED_CLI)
|
||||||
|
set(INSTALL_TARGETS xgboost)
|
||||||
|
endif (BUILD_DEPRECATED_CLI)
|
||||||
endif (BUILD_STATIC_LIB)
|
endif (BUILD_STATIC_LIB)
|
||||||
|
|
||||||
install(TARGETS ${INSTALL_TARGETS}
|
install(TARGETS ${INSTALL_TARGETS}
|
||||||
@ -393,13 +414,15 @@ if (GOOGLE_TEST)
|
|||||||
${xgboost_SOURCE_DIR}/tests/cli/machine.conf.in
|
${xgboost_SOURCE_DIR}/tests/cli/machine.conf.in
|
||||||
${xgboost_BINARY_DIR}/tests/cli/machine.conf
|
${xgboost_BINARY_DIR}/tests/cli/machine.conf
|
||||||
@ONLY)
|
@ONLY)
|
||||||
add_test(
|
if (BUILD_DEPRECATED_CLI)
|
||||||
NAME TestXGBoostCLI
|
add_test(
|
||||||
COMMAND runxgboost ${xgboost_BINARY_DIR}/tests/cli/machine.conf
|
NAME TestXGBoostCLI
|
||||||
WORKING_DIRECTORY ${xgboost_BINARY_DIR})
|
COMMAND runxgboost ${xgboost_BINARY_DIR}/tests/cli/machine.conf
|
||||||
set_tests_properties(TestXGBoostCLI
|
WORKING_DIRECTORY ${xgboost_BINARY_DIR})
|
||||||
PROPERTIES
|
set_tests_properties(TestXGBoostCLI
|
||||||
PASS_REGULAR_EXPRESSION ".*test-rmse:0.087.*")
|
PROPERTIES
|
||||||
|
PASS_REGULAR_EXPRESSION ".*test-rmse:0.087.*")
|
||||||
|
endif (BUILD_DEPRECATED_CLI)
|
||||||
endif (GOOGLE_TEST)
|
endif (GOOGLE_TEST)
|
||||||
|
|
||||||
# For MSVC: Call msvc_use_static_runtime() once again to completely
|
# For MSVC: Call msvc_use_static_runtime() once again to completely
|
||||||
|
|||||||
4
demo/CLI/README.rst
Normal file
4
demo/CLI/README.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
XGBoost Command Line Interface Walkthrough
|
||||||
|
==========================================
|
||||||
|
|
||||||
|
Please note that the command line interface is deprecated in 2.1.0, use other language bindings instead. For a list of available bindings, see https://xgboost.readthedocs.io/en/stable/
|
||||||
@ -514,7 +514,9 @@ class CLI {
|
|||||||
};
|
};
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
|
LOG(WARNING)
|
||||||
|
<< "The command line interface is deprecated and will be removed in future releases.";
|
||||||
try {
|
try {
|
||||||
xgboost::CLI cli(argc, argv);
|
xgboost::CLI cli(argc, argv);
|
||||||
return cli.Run();
|
return cli.Run();
|
||||||
|
|||||||
@ -13,7 +13,7 @@ if ( $is_release_branch -eq 0 ) {
|
|||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. -G"Visual Studio 17 2022" -A x64 -DUSE_CUDA=ON -DCMAKE_VERBOSE_MAKEFILE=ON `
|
cmake .. -G"Visual Studio 17 2022" -A x64 -DUSE_CUDA=ON -DCMAKE_VERBOSE_MAKEFILE=ON `
|
||||||
-DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON ${arch_flag}
|
-DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DBUILD_DEPRECATED_CLI=ON ${arch_flag}
|
||||||
$msbuild = -join @(
|
$msbuild = -join @(
|
||||||
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current"
|
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current"
|
||||||
"\\Bin\\MSBuild.exe"
|
"\\Bin\\MSBuild.exe"
|
||||||
|
|||||||
@ -19,7 +19,6 @@ cmake .. -GNinja -DUSE_CUDA=ON -DR_LIB=ON
|
|||||||
ninja
|
ninja
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm xgboost
|
|
||||||
# This super wacky hack is found in cmake/RPackageInstall.cmake.in and
|
# This super wacky hack is found in cmake/RPackageInstall.cmake.in and
|
||||||
# cmake/RPackageInstallTargetSetup.cmake. This hack lets us bypass the normal build process of R
|
# cmake/RPackageInstallTargetSetup.cmake. This hack lets us bypass the normal build process of R
|
||||||
# and have R use xgboost.so that we've already built.
|
# and have R use xgboost.so that we've already built.
|
||||||
|
|||||||
@ -22,7 +22,6 @@ cmake .. -G"Visual Studio 17 2022" -A x64 -DUSE_CUDA=ON -DR_LIB=ON -DLIBR_HOME="
|
|||||||
cmake --build . --config Release --parallel
|
cmake --build . --config Release --parallel
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm xgboost
|
|
||||||
# This super wacky hack is found in cmake/RPackageInstall.cmake.in and
|
# This super wacky hack is found in cmake/RPackageInstall.cmake.in and
|
||||||
# cmake/RPackageInstallTargetSetup.cmake. This hack lets us bypass the normal build process of R
|
# cmake/RPackageInstallTargetSetup.cmake. This hack lets us bypass the normal build process of R
|
||||||
# and have R use xgboost.dll that we've already built.
|
# and have R use xgboost.dll that we've already built.
|
||||||
|
|||||||
@ -24,7 +24,7 @@ fi
|
|||||||
rm -rf build
|
rm -rf build
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake .. ${cmake_args} -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_ALL_WARNINGS=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -GNinja ${cmake_prefix_flag} -DHIDE_CXX_SYMBOLS=ON
|
cmake .. ${cmake_args} -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_ALL_WARNINGS=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -GNinja ${cmake_prefix_flag} -DHIDE_CXX_SYMBOLS=ON -DBUILD_DEPRECATED_CLI=ON
|
||||||
ninja clean
|
ninja clean
|
||||||
time ninja -v
|
time ninja -v
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user