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] LightGBM package for R appears to build properly, but missing functions like getinfo #5140

Closed
aadler opened this issue Apr 10, 2022 · 8 comments

Comments

@aadler
Copy link

aadler commented Apr 10, 2022

Description

I followed the directions to build a regular R package from source using MSYS2 from the command line, and it appears to build, but is missing basic functionality like getinfo. When I build from within R using install.packages('lightgbm', type = 'source') then getinfo` appears. Please note that I did not ask for GPU but the build seems to be building gpu-related functionality anyway. I do have CUDE/NVCC 11.6 and CUDANN installed. Perhaps this is related to #5135?

Environment info

version 3.3.2.99

Installation from Command Line

Command(s) you used to install LightGBM

D:\LightGBM>Rscript build_r.R --use-msys2
* checking for file 'D:/LightGBM/lightgbm_r/DESCRIPTION' ... OK
* preparing 'lightgbm':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
* creating vignettes ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
WARNING: directory 'lightgbm/src/build' is empty
* looking to see if a 'data/datalist' file should be added
* building 'lightgbm_3.3.2.99.tar.gz'

* installing to library 'C:/R/RCurrent/R-4.2.0alpha/library'
* installing *source* package 'lightgbm' ...
** using staged installation
** libs
installing via 'install.libs.R' to C:/R/RCurrent/R-4.2.0alpha/library/00LOCK-lightgbm/00new/lightgbm
Trying to build with MSYS2
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/rtools42/x86_64-w64-mingw32.static.posix/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/rtools42/x86_64-w64-mingw32.static.posix/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- R version passed into FindLibR.cmake: 4.2.0
-- Found LibR: C:/R/RCurrent/R-4.2.0alpha
-- LIBR_EXECUTABLE: C:/R/RCurrent/R-4.2.0alpha/bin/x64/R.exe
-- LIBR_INCLUDE_DIRS: C:/R/RCurrent/R-4.2.0alpha/include
-- LIBR_CORE_LIBRARY: C:/R/RCurrent/R-4.2.0alpha/bin/x64/R.dll
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Performing Test MM_PREFETCH
-- Performing Test MM_PREFETCH - Success
-- Using _mm_prefetch
-- Performing Test MM_MALLOC
-- Performing Test MM_MALLOC - Success
-- Using _mm_malloc
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Rtemp/Rtmp4cgagr/R.INSTALL244c406b19fe/lightgbm/src/build
-- R version passed into FindLibR.cmake: 4.2.0
-- LIBR_EXECUTABLE: C:/R/RCurrent/R-4.2.0alpha/bin/x64/R.exe
-- LIBR_INCLUDE_DIRS: C:/R/RCurrent/R-4.2.0alpha/include
-- LIBR_CORE_LIBRARY: C:/R/RCurrent/R-4.2.0alpha/bin/x64/R.dll
-- Using _mm_prefetch
-- Using _mm_malloc
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Rtemp/Rtmp4cgagr/R.INSTALL244c406b19fe/lightgbm/src/build
Building lib_lightgbm
[  2%] Building CXX object CMakeFiles/lightgbm_capi_objs.dir/src/c_api.cpp.obj
[  4%] Building CXX object CMakeFiles/lightgbm_capi_objs.dir/src/lightgbm_R.cpp.obj
[  4%] Built target lightgbm_capi_objs
[  6%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/boosting/boosting.cpp.obj
[  8%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/boosting/gbdt.cpp.obj
[ 10%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/boosting/gbdt_model_text.cpp.obj
[ 12%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/boosting/gbdt_prediction.cpp.obj
[ 14%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/boosting/prediction_early_stop.cpp.obj
[ 16%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/cuda/cuda_utils.cpp.obj
[ 18%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/bin.cpp.obj
[ 20%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/config.cpp.obj
[ 22%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/config_auto.cpp.obj
[ 24%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/cuda/cuda_column_data.cpp.obj
[ 26%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/cuda/cuda_metadata.cpp.obj
[ 28%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/cuda/cuda_row_data.cpp.obj
[ 30%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/cuda/cuda_tree.cpp.obj
[ 32%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/dataset.cpp.obj
[ 34%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/dataset_loader.cpp.obj
[ 36%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/dense_bin.cpp.obj
[ 38%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/file_io.cpp.obj
[ 40%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/json11.cpp.obj
[ 42%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/metadata.cpp.obj
[ 44%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/multi_val_dense_bin.cpp.obj
[ 46%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/multi_val_sparse_bin.cpp.obj
[ 48%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/parser.cpp.obj
[ 51%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/sparse_bin.cpp.obj
[ 53%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/train_share_states.cpp.obj
[ 55%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/io/tree.cpp.obj
[ 57%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/metric/dcg_calculator.cpp.obj
[ 59%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/metric/metric.cpp.obj
[ 61%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/network/ifaddrs_patch.cpp.obj
[ 63%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/network/linker_topo.cpp.obj
[ 65%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/network/linkers_mpi.cpp.obj
[ 67%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/network/linkers_socket.cpp.obj
[ 69%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/network/network.cpp.obj
[ 71%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/objective/objective_function.cpp.obj
[ 73%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda/cuda_best_split_finder.cpp.obj
[ 75%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda/cuda_data_partition.cpp.obj
[ 77%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda/cuda_histogram_constructor.cpp.obj
[ 79%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda/cuda_leaf_splits.cpp.obj
[ 81%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda/cuda_single_gpu_tree_learner.cpp.obj
[ 83%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/cuda_tree_learner.cpp.obj
[ 85%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/data_parallel_tree_learner.cpp.obj
[ 87%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/feature_parallel_tree_learner.cpp.obj
[ 89%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/gpu_tree_learner.cpp.obj
[ 91%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/linear_tree_learner.cpp.obj
[ 93%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/serial_tree_learner.cpp.obj
[ 95%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/tree_learner.cpp.obj
[ 97%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/voting_parallel_tree_learner.cpp.obj
[ 97%] Built target lightgbm_objs
[100%] Linking CXX shared library ../lib_lightgbm.dll
[100%] Built target _lightgbm
Found library file: D:\Rtemp\Rtmp4cgagr\R.INSTALL244c406b19fe/lightgbm/src/lib_lightgbm.dll to move to C:/R/RCurrent/R-4.2.0alpha/library/00LOCK-lightgbm/00new/lightgbm/libs/x64
Removing 'build/' directory
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (lightgbm)
> library(lightgbm)
> lightgbm::getinfo
Error: 'getinfo' is not an exported object from 'namespace:lightgbm'

Installation from within R

Technically using R CMD INSTALL since the Eigen issues completely blow the buffer so I cannot capture it all from within RStudio. Even sending it to a textfile misses the explosion of Eigen issues:

Capture of most of compile

checking whether MM_PREFETCH works...yes
checking whether MM_MALLOC works...yes
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c boosting/boosting.cpp -o boosting/boosting.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c boosting/gbdt.cpp -o boosting/gbdt.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c boosting/gbdt_model_text.cpp -o boosting/gbdt_model_text.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c boosting/gbdt_prediction.cpp -o boosting/gbdt_prediction.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c boosting/prediction_early_stop.cpp -o boosting/prediction_early_stop.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/bin.cpp -o io/bin.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/config.cpp -o io/config.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/config_auto.cpp -o io/config_auto.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/dataset.cpp -o io/dataset.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/dataset_loader.cpp -o io/dataset_loader.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/file_io.cpp -o io/file_io.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/json11.cpp -o io/json11.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/metadata.cpp -o io/metadata.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/parser.cpp -o io/parser.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/train_share_states.cpp -o io/train_share_states.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c io/tree.cpp -o io/tree.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c metric/dcg_calculator.cpp -o metric/dcg_calculator.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c metric/metric.cpp -o metric/metric.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c objective/objective_function.cpp -o objective/objective_function.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c network/ifaddrs_patch.cpp -o network/ifaddrs_patch.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c network/linker_topo.cpp -o network/linker_topo.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c network/linkers_mpi.cpp -o network/linkers_mpi.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c network/linkers_socket.cpp -o network/linkers_socket.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c network/network.cpp -o network/network.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/data_parallel_tree_learner.cpp -o treelearner/data_parallel_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/feature_parallel_tree_learner.cpp -o treelearner/feature_parallel_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/gpu_tree_learner.cpp -o treelearner/gpu_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/linear_tree_learner.cpp -o treelearner/linear_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/serial_tree_learner.cpp -o treelearner/serial_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/tree_learner.cpp -o treelearner/tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c treelearner/voting_parallel_tree_learner.cpp -o treelearner/voting_parallel_tree_learner.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c c_api.cpp -o c_api.o
g++  -std=gnu++11 -I"C:/R/RCurrent/R-4.2.0alpha/include" -DNDEBUG -I./include -DEIGEN_MPL2_ONLY -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD    -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include"  -fopenmp -pthread   -O2 -Wall  -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -c lightgbm_R.cpp -o lightgbm_R.o
g++ -shared -O2 -Wall -march=native -pipe -mno-rtm -flto -ffat-lto-objects -fuse-linker-plugin -s -static-libgcc -o lightgbm.dll lightgbm-win.def boosting/boosting.o boosting/gbdt.o boosting/gbdt_model_text.o boosting/gbdt_prediction.o boosting/prediction_early_stop.o io/bin.o io/config.o io/config_auto.o io/dataset.o io/dataset_loader.o io/file_io.o io/json11.o io/metadata.o io/parser.o io/train_share_states.o io/tree.o metric/dcg_calculator.o metric/metric.o objective/objective_function.o network/ifaddrs_patch.o network/linker_topo.o network/linkers_mpi.o network/linkers_socket.o network/network.o treelearner/data_parallel_tree_learner.o treelearner/feature_parallel_tree_learner.o treelearner/gpu_tree_learner.o treelearner/linear_tree_learner.o treelearner/serial_tree_learner.o treelearner/tree_learner.o treelearner/voting_parallel_tree_learner.o c_api.o lightgbm_R.o -fopenmp -pthread -lws2_32 -lIphlpapi -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/R/RCurrent/R-4.2.0alpha/bin/x64 -lR

Capture of Install

installing to C:/R/RCurrent/R-4.2.0alpha/library/00LOCK-lightgbm/00new/lightgbm/libs/x64
** R
** data
** demo
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (lightgbm)

Call from within R

library(lightgbm)
Loading required package: R6
lightgbm::getinfo
function (dataset, ...) 
{
    UseMethod("getinfo")
}
<bytecode: 0x0000025a14b1ac90>
<environment: namespace:lightgbm>

Session Info

> sessionInfo()
R version 4.2.0 alpha (2022-04-03 r82074 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lightgbm_3.3.2.99

loaded via a namespace (and not attached):
 [1] rpart.plot_3.1.0  lattice_0.20-45   digest_0.6.29     R6_2.5.1          grid_4.2.0        jsonlite_1.8.0   
 [7] evaluate_0.15     rlang_1.0.2       cli_3.2.0         data.table_1.14.2 Matrix_1.4-1      rpart_4.1.16     
[13] PRROC_1.3.1       rmarkdown_2.13    naivebayes_0.9.7  tools_4.2.0       foreign_0.8-82    parallel_4.2.0   
[19] xfun_0.30         yaml_2.3.5        fastmap_1.1.0     compiler_4.2.0    htmltools_0.5.2   knitr_1.38 
@jameslamb
Copy link
Collaborator

getinfo() was removed from the R package in #4864, as part of #4543. It has been replaced with get_field().

get_field <- function(dataset, field_name) {
UseMethod("get_field")
}

The next planned release of LightGBM (the entire project, not only the R package), will be a new major version (v3.3.2 -> v4.0.0). As a result, the current state of the source code on the master branch here on GitHub contains many large changes, some of which are breaking changes. In particular, several breaking changes have been made to the R and Python packages to make them more consistent with other machine learning packages, and to simplify them and eliminate places where the API contained multiple ways to accomplish the same thing.

You can see a summary of the breaking changes by looking at the history of PRs with label breaking.

https://github.com/microsoft/LightGBM/pulls?q=is%3Apr+label%3Abreaking+is%3Aclosed

If you'd like to build from source for v3.3.2, you can run the following before compiling.

git fetch --tags
git checkout v3.3.2
git submodule update --recursive

If you'd like to build from source for latest master, you will likely run into some of these breaking changes.


Thank you VERY much for an excellent and detailed write-up! In the future, if you report something here and are building from a development version ending in .99, please also report a commit hash.

https://github.com/microsoft/LightGBM/blob/master/VERSION.txt is not updated on every commit, so a version like 3.3.2.99, for example, could refer to any commit since the v3.3.2 release was published.


the explosion of Eigen issues

Sorry about this :/. I've observed a ton of compilation warnings from Eigen too, and haven't found a good way to silence them yet.

Unfortunately, the authors of LightGBM don't control the Eigen source code (it is vendored in from https://gitlab.com/libeigen/eigen), and CRAN does not permit the use of compiler flags that silence warnings. R CMD check complains about flags such as -W-no-{something}

https://github.com/wch/r-source/blob/722824a89bcc9bcd6848abcb80ce4f7f21246e1b/src/library/tools/R/check.R#L3588-L3593

@jameslamb jameslamb changed the title LightGBM package for R appears to build properly, but missing functions like getinfo [R-package] LightGBM package for R appears to build properly, but missing functions like getinfo Apr 11, 2022
@jameslamb
Copy link
Collaborator

the build seems to be building gpu-related functionality anyway

Sorry, just noticed this comment. Note that lines like the following in compilation output don't actually mean that any GPU-specific functionality is being compiled.

[ 89%] Building CXX object CMakeFiles/lightgbm_objs.dir/src/treelearner/gpu_tree_learner.cpp.obj

For many parts of LightGBM's C/C++ source code, build-time definitions like -DUSE_GPU=1 are used to control whether or not anything is compiled.

For example, nothing after the following line will actually be compiled unless -DUSE_GPU=1 has been passed in to the compiler.

@aadler
Copy link
Author

aadler commented Apr 11, 2022

OK, that explains why code I wrote last year wasn't working with the cutting edge build. I'll stick with the CRAN package for CPU only. If I have some time, I'll try specifically pulling 3.3.2 and building with GPU to consider #5135.

@aadler
Copy link
Author

aadler commented Apr 11, 2022

@jameslamb FYI, calling lgb.cv using CRAN version 3.3.2 gives me a slew of Warning in getinfo.lgb.Dataset(dtrain, "label") : Calling getinfo() on a lgb.Dataset is deprecated. Use get_field() instead.. I don't think that is a user-accessible option in lgb.cv. Thanks!

@jameslamb
Copy link
Collaborator

Blegh sorry about that, maybe some internal uses of getinfo() were missed prior to the v3.3.2 release :/

I don't have a suggestion for how to ignore those warnings, other than wrapping your call to lgb.cv() in suppressWarnings(), but that's a very broad suppression that might lead to missing important updates.

Sorry for the inconvenience, it's an oversight that any such warnings were raised from uses that can't be controlled through the package's public API.

@aadler
Copy link
Author

aadler commented Apr 11, 2022

No worries, @jameslamb, I just figured you'd want to know!

@jameslamb
Copy link
Collaborator

Appreciate it, thank you so much!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants