Skip to content
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

[R-package] Remove CLI-only objects #3566

Merged
merged 9 commits into from
Nov 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ if(USE_MPI)
endif(USE_MPI)

file(GLOB SOURCES
src/application/*.cpp
src/boosting/*.cpp
src/io/*.cpp
src/metric/*.cpp
Expand All @@ -330,7 +329,7 @@ if(USE_CUDA)
endif(USE_CUDA)
)

add_executable(lightgbm src/main.cpp ${SOURCES})
add_executable(lightgbm src/main.cpp src/application/application.cpp ${SOURCES})
list(APPEND SOURCES "src/c_api.cpp")

# Only build the R part of the library if building for
Expand Down
1 change: 0 additions & 1 deletion R-package/src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ PKG_LIBS = \
-pthread

OBJECTS = \
application/application.o \
boosting/boosting.o \
boosting/gbdt.o \
boosting/gbdt_model_text.o \
Expand Down
1 change: 0 additions & 1 deletion R-package/src/Makevars.win.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ PKG_LIBS = \
-lIphlpapi

OBJECTS = \
application/application.o \
boosting/boosting.o \
boosting/gbdt.o \
boosting/gbdt_model_text.o \
Expand Down
6 changes: 4 additions & 2 deletions build-cran-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ cd ${TEMP_R_DIR}
rm AUTOCONF_UBUNTU_VERSION
rm recreate-configure.sh

# main.cpp is used to make the lightgbm CLI, unnecessary
# for the R package
# files only used by the lightgbm CLI aren't needed for
# the R package
rm src/application/application.cpp
rm src/include/LightGBM/application.h
rm src/main.cpp

# configure.ac and DESCRIPTION have placeholders for version
Expand Down
2 changes: 0 additions & 2 deletions src/application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

namespace LightGBM {

Common::Timer global_timer;

Application::Application(int argc, char** argv) {
LoadParameters(argc, argv);
// set number of threads for openmp
Expand Down
2 changes: 2 additions & 0 deletions src/boosting/gbdt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

namespace LightGBM {

Common::Timer global_timer;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving this define from application.cpp to this file (the first source file that needs global_timer) to try to fix these errors:

https://dev.azure.com/lightgbm-ci/lightgbm-ci/_build/results?buildId=8009&view=logs&j=5ea309bb-dea2-5bcb-538b-5c76ecf159eb&t=aa1d7e0f-3509-5697-4ef8-f247c54ed420


int LGBM_config_::current_device = lgbm_device_cpu;
int LGBM_config_::current_learner = use_cpu_learner;

Expand Down