microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.71k stars 3.83k forks source link

[R-Package] CRAN issues #629

Closed Laurae2 closed 3 years ago

Laurae2 commented 7 years ago

Environment info

Operating System: Windows 8.1 Pro CPU: i7-4600U R version: 3.4

To make a release on CRAN, we will need first to fix all the errors / warnings / notes. Currently testing on Windows, but we will also need to test on Linux. If some of them cannot be fixed, we will need to have an explanation for each of those which will not be fixed by us. @guolinke

Maybe time to add some vignettes @coforfe if you want to work on them.

00install.out:

* installing *source* package 'lightgbm' ...
** libs
installing via 'install.libs.R' to C:/tmp/RtmpG2NQSv/lightgbm.Rcheck/lightgbm
Warning in file.copy("./../../include", "./", overwrite = TRUE, recursive = TRUE) :
  problem copying .\..\..\include to .\include: No such file or directory
Error in eval(ei, envir) : Cannot find folder LightGBM/include
* removing 'C:/tmp/RtmpG2NQSv/lightgbm.Rcheck/lightgbm'

Windows (fake) CRAN log:

R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(devtools)
> library(roxygen2) # devtools::install_github("klutometis/roxygen")
> setwd("C:/LightGBM/R-package")
> devtools::check()
Updating lightgbm documentation
Loading lightgbm
Re-compiling lightgbm
"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:\LightGBM\R-package"  \
  --library="C:\tmp\RtmpG2NQSv\devtools_install_19fa019043416" --no-R --no-data --no-help --no-demo --no-inst --no-docs --no-exec --no-multiarch  \
  --no-test-load --preclean 

* installing *source* package 'lightgbm' ...
** libs
installing via 'install.libs.R' to C:/tmp/RtmpG2NQSv/devtools_install_19fa019043416/lightgbm
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.11.25303.0
-- The CXX compiler identification is MSVC 19.11.25303.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Community/VC/Tools/MSVC/14.11.25301/bin/HostX86/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Community/VC/Tools/MSVC/14.11.25301/bin/HostX86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Community/VC/Tools/MSVC/14.11.25301/bin/HostX86/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Community/VC/Tools/MSVC/14.11.25301/bin/HostX86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP C flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: /openmp  
-- Configuring done
-- Generating done
-- Build files have been written to: C:/LightGBM/R-package/src/build
Microsoft (R) Build Engine version 15.3.118.39484
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 16/06/2017 07:00:42 PM.
Project "C:\LightGBM\R-package\src\build\_lightgbm.vcxproj" on node 1 (default targets).
Project "C:\LightGBM\R-package\src\build\_lightgbm.vcxproj" (1) is building "C:\LightGBM\R-package\src\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "x64\Release\ZERO_CHECK\".
  Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because C:/LightGBM/R-package/src/build/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
  Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\LightGBM\R-package\src\build\ZERO_CHECK.vcxproj" (default targets).
PrepareForBuild:
  Creating directory "_lightgbm.dir\Release\".
  Creating directory "C:\LightGBM\R-package\src\Release\".
  Creating directory "_lightgbm.dir\Release\_lightgbm.tlog\".
InitializeBuildStatus:
  Creating "_lightgbm.dir\Release\_lightgbm.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Building Custom Rule C:/LightGBM/R-package/src/CMakeLists.txt
  CMake does not need to re-run because C:/LightGBM/R-package/src/build/CMakeFiles/generate.stamp is up-to-date.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\VC\Tools\MSVC\14.11.25301\bin\HostX86\x64\CL.exe /c /I"C:\LightGBM\R-package\src\include" /nologo /W4 /WX- /diagnostics:classic /O2 /Ob2 /Oi /Ot /Oy /GL /D WIN32 /D _WINDOWS /D NDEBUG /D USE_SOCKET /D "CMAKE_INTDIR=\"Release\"" /D _lightgbm_EXPORTS /D _WINDLL /D _MBCS /UNDEBUG /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /openmp /Fo"_lightgbm.dir\Release\\" /Fd"_lightgbm.dir\Release\vc141.pdb" /Gd /TP /errorReport:queue   -pedantic -g -O0 "C:\LightGBM\R-package\src\src\c_api.cpp" "C:\LightGBM\R-package\src\src\lightgbm_R.cpp" "C:\LightGBM\R-package\src\src\application\application.cpp" "C:\LightGBM\R-package\src\src\boosting\boosting.cpp" "C:\LightGBM\R-package\src\src\boosting\gbdt.cpp" "C:\LightGBM\R-package\src\src\boosting\gbdt_prediction.cpp" "C:\LightGBM\R-package\src\src\boosting\prediction_early_stop.cpp" "C:\LightGBM\R-package\src\src\io\bin.cpp" "C:\LightGBM\R-package\src\src\io\config.cpp" "C:\LightGBM\R-package\src\src\io\dataset.cpp" "C:\LightGBM\R-package\src\src\io\dataset_loader.cpp" "C:\LightGBM\R-package\src\src\io\metadata.cpp" "C:\LightGBM\R-package\src\src\io\parser.cpp" "C:\LightGBM\R-package\src\src\io\tree.cpp" "C:\LightGBM\R-package\src\src\metric\dcg_calculator.cpp" "C:\LightGBM\R-package\src\src\metric\metric.cpp" "C:\LightGBM\R-package\src\src\objective\objective_function.cpp" "C:\LightGBM\R-package\src\src\network\linker_topo.cpp" "C:\LightGBM\R-package\src\src\network\linkers_mpi.cpp" "C:\LightGBM\R-package\src\src\network\linkers_socket.cpp" "C:\LightGBM\R-package\src\src\network\network.cpp" "C:\LightGBM\R-package\src\src\treelearner\data_parallel_tree_learner.cpp" "C:\LightGBM\R-package\src\src\treelearner\feature_parallel_tree_learner.cpp" "C:\LightGBM\R-package\src\src\treelearner\gpu_tree_learner.cpp" "C:\LightGBM\R-package\src\src\treelearner\serial_tree_learner.cpp" "C:\LightGBM\R-package\src\src\treelearner\tree_learner.cpp" "C:\LightGBM\R-package\src\src\treelearner\voting_parallel_tree_learner.cpp"
cl : Command line warning D9025: overriding '/DNDEBUG' with '/UNDEBUG' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
  c_api.cpp
cl : Command line warning D9002: ignoring unknown option '-pedantic' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
cl : Command line warning D9002: ignoring unknown option '-g' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
cl : Command line warning D9002: ignoring unknown option '-O0' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
  lightgbm_R.cpp
  application.cpp
  boosting.cpp
  gbdt.cpp
  gbdt_prediction.cpp
  prediction_early_stop.cpp
  bin.cpp
  config.cpp
  dataset.cpp
  dataset_loader.cpp
  metadata.cpp
  parser.cpp
  tree.cpp
  dcg_calculator.cpp
  metric.cpp
  objective_function.cpp
  linker_topo.cpp
  linkers_mpi.cpp
  linkers_socket.cpp
  Compiling...
  network.cpp
  data_parallel_tree_learner.cpp
  feature_parallel_tree_learner.cpp
  gpu_tree_learner.cpp
  serial_tree_learner.cpp
  tree_learner.cpp
  voting_parallel_tree_learner.cpp
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\Preview\Community\VC\Tools\MSVC\14.11.25301\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\LightGBM\R-package\src\Release\lib_lightgbm.dll" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/LightGBM/R-package/src/Release/lib_lightgbm.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/LightGBM/R-package/src/Release/lib_lightgbm.lib" /MACHINE:X64   /machine:x64 /DLL _lightgbm.dir\Release\c_api.obj
  _lightgbm.dir\Release\lightgbm_R.obj
  _lightgbm.dir\Release\application.obj
  _lightgbm.dir\Release\boosting.obj
  _lightgbm.dir\Release\gbdt.obj
  _lightgbm.dir\Release\gbdt_prediction.obj
  _lightgbm.dir\Release\prediction_early_stop.obj
  _lightgbm.dir\Release\bin.obj
  _lightgbm.dir\Release\config.obj
  _lightgbm.dir\Release\dataset.obj
  _lightgbm.dir\Release\dataset_loader.obj
  _lightgbm.dir\Release\metadata.obj
  _lightgbm.dir\Release\parser.obj
  _lightgbm.dir\Release\tree.obj
  _lightgbm.dir\Release\dcg_calculator.obj
  _lightgbm.dir\Release\metric.obj
  _lightgbm.dir\Release\objective_function.obj
  _lightgbm.dir\Release\linker_topo.obj
  _lightgbm.dir\Release\linkers_mpi.obj
  _lightgbm.dir\Release\linkers_socket.obj
  _lightgbm.dir\Release\network.obj
  _lightgbm.dir\Release\data_parallel_tree_learner.obj
  _lightgbm.dir\Release\feature_parallel_tree_learner.obj
  _lightgbm.dir\Release\gpu_tree_learner.obj
  _lightgbm.dir\Release\serial_tree_learner.obj
  _lightgbm.dir\Release\tree_learner.obj
  _lightgbm.dir\Release\voting_parallel_tree_learner.obj
  c_api.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
     Creating library C:/LightGBM/R-package/src/Release/lib_lightgbm.lib and object C:/LightGBM/R-package/src/Release/lib_lightgbm.exp
  Generating code
  Finished generating code
  _lightgbm.vcxproj -> C:\LightGBM\R-package\src\Release\lib_lightgbm.dll
FinalizeBuildStatus:
  Deleting file "_lightgbm.dir\Release\_lightgbm.tlog\unsuccessfulbuild".
  Touching "_lightgbm.dir\Release\_lightgbm.tlog\_lightgbm.lastbuildstate".
Done Building Project "C:\LightGBM\R-package\src\build\_lightgbm.vcxproj" (default targets).

Build succeeded.

"C:\LightGBM\R-package\src\build\_lightgbm.vcxproj" (default target) (1) ->
(ClCompile target) -> 
  cl : Command line warning D9025: overriding '/DNDEBUG' with '/UNDEBUG' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
  cl : Command line warning D9002: ignoring unknown option '-pedantic' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
  cl : Command line warning D9002: ignoring unknown option '-g' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]
  cl : Command line warning D9002: ignoring unknown option '-O0' [C:\LightGBM\R-package\src\build\_lightgbm.vcxproj]

    4 Warning(s)
    0 Error(s)

Time Elapsed 00:00:44.73
Found library file: C:/LightGBM/R-package/src/Release/lib_lightgbm.dll to move to C:/tmp/RtmpG2NQSv/devtools_install_19fa019043416/lightgbm/libs/x64* DONE (lightgbm)
Loading required package: R6
Writing NAMESPACE
Writing predict.lgb.Booster.Rd
Setting env vars -------------------------------------------------------------------------------------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building lightgbm ------------------------------------------------------------------------------------------------------------------------------------------
"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD build "C:\LightGBM\R-package" --no-resave-data  \
  --no-manual 

* checking for file 'C:\LightGBM\R-package/DESCRIPTION' ... OK
* preparing 'lightgbm':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory 'lightgbm/src/build/CMakeFiles/3.8.0/CompilerIdC/tmp'
Removed empty directory 'lightgbm/src/build/CMakeFiles/3.8.0/CompilerIdCXX/tmp'
Removed empty directory 'lightgbm/src/build/CMakeFiles/CMakeTmp'
* looking to see if a 'data/datalist' file should be added
* building 'lightgbm_0.2.tar.gz'
Warning in utils::tar(filepath, pkgname, compression = "gzip", compression_level = 9L,  :
  storing paths of more than 100 bytes is not portable:
  'lightgbm/src/build/CMakeFiles/3.8.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate'

Setting env vars -------------------------------------------------------------------------------------------------------------------------------------------
_R_CHECK_CRAN_INCOMING_ : FALSE
_R_CHECK_FORCE_SUGGESTS_: FALSE
Checking lightgbm ------------------------------------------------------------------------------------------------------------------------------------------
"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD check "C:\tmp\RtmpG2NQSv/lightgbm_0.2.tar.gz" --as-cran  \
  --timings --no-manual 

* using log directory 'C:/tmp/RtmpG2NQSv/lightgbm.Rcheck'
* using R version 3.4.0 (2017-04-21)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using options '--no-manual --as-cran'
* checking for file 'lightgbm/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'lightgbm' version '0.2'
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... WARNING
Subdirectory 'src' contains:
  CMakeLists.txt
These are unlikely file names for src files.

In addition to the above warning(s), found the following notes:

Found the following apparent object files/libraries:
  src/Release/lib_lightgbm.dll
  src/build/CMakeFiles/3.8.0/CompilerIdC/Debug/CMakeCCompilerId.obj
  src/build/CMakeFiles/3.8.0/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj
  src/build/_lightgbm.dir/Release/application.obj
  src/build/_lightgbm.dir/Release/bin.obj
  src/build/_lightgbm.dir/Release/boosting.obj
  src/build/_lightgbm.dir/Release/c_api.obj
  src/build/_lightgbm.dir/Release/config.obj
  src/build/_lightgbm.dir/Release/data_parallel_tree_learner.obj
  src/build/_lightgbm.dir/Release/dataset.obj
  src/build/_lightgbm.dir/Release/dataset_loader.obj
  src/build/_lightgbm.dir/Release/dcg_calculator.obj
  src/build/_lightgbm.dir/Release/feature_parallel_tree_learner.obj
  src/build/_lightgbm.dir/Release/gbdt.obj
  src/build/_lightgbm.dir/Release/gbdt_prediction.obj
  src/build/_lightgbm.dir/Release/gpu_tree_learner.obj
  src/build/_lightgbm.dir/Release/lightgbm_R.obj
  src/build/_lightgbm.dir/Release/linker_topo.obj
  src/build/_lightgbm.dir/Release/linkers_mpi.obj
  src/build/_lightgbm.dir/Release/linkers_socket.obj
  src/build/_lightgbm.dir/Release/metadata.obj
  src/build/_lightgbm.dir/Release/metric.obj
  src/build/_lightgbm.dir/Release/network.obj
  src/build/_lightgbm.dir/Release/objective_function.obj
  src/build/_lightgbm.dir/Release/parser.obj
  src/build/_lightgbm.dir/Release/prediction_early_stop.obj
  src/build/_lightgbm.dir/Release/serial_tree_learner.obj
  src/build/_lightgbm.dir/Release/tree.obj
  src/build/_lightgbm.dir/Release/tree_learner.obj
  src/build/_lightgbm.dir/Release/voting_parallel_tree_learner.obj
Object files/libraries should not be included in a source package.
* checking if there is a namespace ... OK
* checking for executable files ... WARNING
Found the following executable files:
  src/Release/lib_lightgbm.dll
  src/build/CMakeFiles/3.8.0/CMakeDetermineCompilerABI_C.bin
  src/build/CMakeFiles/3.8.0/CMakeDetermineCompilerABI_CXX.bin
  src/build/CMakeFiles/3.8.0/CompilerIdC/CompilerIdC.exe
  src/build/CMakeFiles/3.8.0/CompilerIdCXX/CompilerIdCXX.exe
  src/build/CMakeFiles/FindOpenMP/ompver_C.bin
  src/build/CMakeFiles/FindOpenMP/ompver_CXX.bin
  src/build/CMakeFiles/feature_tests.bin
Source packages should not contain undeclared executable files.
See section 'Package structure' in the 'Writing R Extensions' manual.
* checking for hidden files and directories ... OK
* checking for portable file names ... NOTE
Found the following non-portable file path:
  lightgbm/src/build/CMakeFiles/3.8.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate

Tarballs are only required to store paths of up to 100 bytes and cannot
store those of more than 256 bytes, with restrictions including to 100
bytes for the final component.
See section 'Package structure' in the 'Writing R Extensions' manual.
* checking whether package 'lightgbm' can be installed ...Warning: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/Rcmd.exe" INSTALL -l "C:/tmp/RtmpG2NQSv/lightgbm.Rcheck" --no-html --no-multiarch "C:\tmp\RTMPG2~1\LIGHTG~1.RCH\00_PKG~1\lightgbm"' had status 1
 ERROR
Installation failed.
See 'C:/tmp/RtmpG2NQSv/lightgbm.Rcheck/00install.out' for details.
* DONE

Status: 1 ERROR, 2 WARNINGs, 1 NOTE
See
  'C:/tmp/RtmpG2NQSv/lightgbm.Rcheck/00check.log'
for details.

R CMD check results
1 error  | 2 warnings | 1 note 
checking whether package 'lightgbm' can be installed ... ERROR
Installation failed.
See 'C:/tmp/RtmpG2NQSv/lightgbm.Rcheck/00install.out' for details.

checking if this is a source package ... WARNING
Subdirectory 'src' contains:
  CMakeLists.txt
These are unlikely file names for src files.

In addition to the above warning(s), found the following notes:

Found the following apparent object files/libraries:
  src/Release/lib_lightgbm.dll
  src/build/CMakeFiles/3.8.0/CompilerIdC/Debug/CMakeCCompilerId.obj
... 19 lines ...
  src/build/_lightgbm.dir/Release/metadata.obj
  src/build/_lightgbm.dir/Release/metric.obj
  src/build/_lightgbm.dir/Release/network.obj
  src/build/_lightgbm.dir/Release/objective_function.obj
  src/build/_lightgbm.dir/Release/parser.obj
  src/build/_lightgbm.dir/Release/prediction_early_stop.obj
  src/build/_lightgbm.dir/Release/serial_tree_learner.obj
  src/build/_lightgbm.dir/Release/tree.obj
  src/build/_lightgbm.dir/Release/tree_learner.obj
  src/build/_lightgbm.dir/Release/voting_parallel_tree_learner.obj
Object files/libraries should not be included in a source package.

checking for executable files ... WARNING
Found the following executable files:
  src/Release/lib_lightgbm.dll
  src/build/CMakeFiles/3.8.0/CMakeDetermineCompilerABI_C.bin
  src/build/CMakeFiles/3.8.0/CMakeDetermineCompilerABI_CXX.bin
  src/build/CMakeFiles/3.8.0/CompilerIdC/CompilerIdC.exe
  src/build/CMakeFiles/3.8.0/CompilerIdCXX/CompilerIdCXX.exe
  src/build/CMakeFiles/FindOpenMP/ompver_C.bin
  src/build/CMakeFiles/FindOpenMP/ompver_CXX.bin
  src/build/CMakeFiles/feature_tests.bin
Source packages should not contain undeclared executable files.
See section 'Package structure' in the 'Writing R Extensions' manual.

checking for portable file names ... NOTE
Found the following non-portable file path:
  lightgbm/src/build/CMakeFiles/3.8.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate

Tarballs are only required to store paths of up to 100 bytes and cannot
store those of more than 256 bytes, with restrictions including to 100
bytes for the final component.
See section 'Package structure' in the 'Writing R Extensions' manual.
guolinke commented 7 years ago

@Laurae2

  1. After execute the https://github.com/Microsoft/LightGBM/blob/master/R-package/build_package.R, the R-Package folder is a self-contained package, we can directly use it.
  2. Why need to go back to MinGW in Windows ?
Laurae2 commented 7 years ago

@guolinke CRAN Windows machines do not have MSBuild or Runtimes for Visual Studio compiled code. They use MinGW 4.9 and Rtools to compile code and create packages.

If using precompiled stuff, we have to check with them about how we can get the package accepted on CRAN. CRAN usually compiles packages themselves in an automated fashion and there should be no error/warning/note when running the check on all platforms they have (unless we have a special reason for the check). The compiled package by CRAN is what is proposed to R users as direct download. As all CRAN / R users (who compile stuff like for Rcpp) have Rtools, they forcibly have MinGW 4.9 hence why the requirement to switch to MinGW as default: VS compiled code will not run nor load on CRAN machines (DLL error), leading to the package being rejected.

guolinke commented 7 years ago

@Laurae2 It can run by copy vc runtime DLL to the same folder of lib_lightgbm.dll manually

Laurae2 commented 7 years ago

@guolinke vc runtime DLL is MIT license? Everything in the R package must be MIT license if the R package is MIT in CRAN. There are no exception for this rule in CRAN.

Laurae2 commented 7 years ago

This is the rule for using binary packages for Windows / Mac:

Binary packages

Policies for when a (Windows or OS X) binary package will be distributed:

  • all its package dependencies on CRAN are available for that platform. Dependencies from other repositories will be installed at CRAN’s discretion.
  • any external software needed can easily be installed on the build machine for all the sub-architectures: here “easily” includes not depending on specific versions, nor should the installed binary depend on specific versions.
  • it passes R CMD check without error for all the available sub-architectures, or at CRAN’s discretion, for the most important sub-architecture(s).

Binary packages are not accepted from maintainers: CRAN will only host binary packages prepared by those responsible for the binary areas. Their packages are made automatically by batch jobs and can take a day or two to appear on the CRAN master site (maybe longer to reach CRAN mirrors).

Binary packages are built for the current version of R: they may also be built for the last version in the previous series (e.g. R 3.1.3 when R 3.2.x is current) or for R-devel.

Questions about binary packages should be addressed to those responsible for building them: Simon Urbanek (OS X) and Uwe Ligges (Windows); email addresses ‘First.Lastname@R-project.org’.

You can also check here online to try to pass a fake Windows CRAN check: https://win-builder.r-project.org/

guolinke commented 7 years ago

@Laurae2

all its package dependencies on CRAN are available for that platform. Dependencies from other repositories will be installed at CRAN’s discretion.

So the dll of vc runtime is ok ?

Another solution: upload our dlls (include vc runtime) to another website (like nuget), and download it when install R-package ?

Laurae2 commented 7 years ago

@guolinke We need to ask uwe.ligges@r-project.org to see if it is feasible or not to use Visual Studio DLL requiring VC runtime.

The whole installation and the DLL compilation must be done by Uwe Ligges.

coforfe commented 7 years ago

Hello, Good to see that you are close to release it to CRAN. Thanks for that!

I am going to start with the vignette.

Is there any point you want to highlight?. And regarding the time frame for this, when should it be ready?.

Thanks! Carlos.

guolinke commented 7 years ago

@Laurae2 okay, can you help to ask Uwe Ligges ?

Laurae2 commented 7 years ago

@guolinke yes, but I'm currently on a project so I don't have enough time anymore.

Perhaps @dselivanov can?

dselivanov commented 7 years ago

I doubt cran will accept anything which requires vc or something not open sourced. I'm out of context, could you point me why vc is used instead of mingw?

Laurae2 commented 7 years ago

@dselivanov VS is used by default for performance. But now we have an automatic fallback to Rtools' MinGW, so it is fine.

guolinke commented 7 years ago

@Laurae2 can we enable the test of R package in travis / appveyor?

Laurae2 commented 7 years ago

@guolinke Yes, we also need to add more appropriate tests to testthat folder (it's very outdated, from 6 months ago).

https://github.com/Microsoft/LightGBM/tree/master/R-package/tests/testthat

Royhuiy commented 7 years ago

how to install lightgbm in the R-language?

Laurae2 commented 7 years ago

@Royhuiy read https://github.com/Microsoft/LightGBM/tree/master/R-package and open a new issue if you still are not managing to install the R package. If everything is setup correctly, then it requires only one line to install the R package.

guolinke commented 6 years ago

@Laurae2 any updates or plans for CRAN ?

Laurae2 commented 6 years ago

@guolinke no update yet, we would need to clean all the check errors/warnings/notes first

guolinke commented 6 years ago

@Laurae2 any updates ?

Laurae2 commented 6 years ago

@guolinke Currently not having enough time, perhaps @jameslamb can help us.

jameslamb commented 6 years ago

@Laurae2 @guolinke I have been traveling a lot recently, but back with my feet on the ground for a while and should have some time to help with this. Do you have a target date for CRAN release?

jameslamb commented 6 years ago

@Laurae2 I've fixed a few more of these today, will submit a PR in the next few days.

You can assign this issue to me if you'd like

jameslamb commented 6 years ago

I made a ton of progress on this yesterday. I have the R CMD CHECK stuff down to a single note that I don't know how to best tackle. Details coming in a PR tomorrow.

Can you explain more about these two other tasks?

For the first one, it is not a CRAN requirement that the package be at repo root in source control. feather, for example, has a really similar structure to LightGBM where they copy shared C code at build time into both Python and R code. [CRAN](https://cran.r-project.org/web/packages/feather/index.html | Github

I don't understand what you mean by number 2.

Laurae2 commented 6 years ago

@jameslamb Trying to assign you the issue, it seems I can't add you (GitHub bug?).

Make examples runnable for tests

Here is an example: https://github.com/Microsoft/LightGBM/blob/master/R-package/R/lgb.train.R#L38 (currently, all examples are dontrun)

Setup a LightGBM special version for CRAN (R-package must be root folder, not a child folder)

If this is not needed, then this requirement can be removed.

I made a ton of progress on this yesterday. I have the R CMD CHECK stuff down to a single note that I don't know how to best tackle. Details coming in a PR tomorrow.

Great! Waiting tomorrow to see it!

Do you have a target date for CRAN release?

ping @guolinke (I guess none currently?)

jameslamb commented 6 years ago

@Laurae2 @guolinke @randxie I just added #1499 😀 . I expect there to be a lot of questions on it...looking forward to the discussion!

Yes let's remove the requirement about the "special version" repo. It's not required.

@randxie and I can tackle the examples dontrun thing at some point soon.

jameslamb commented 6 years ago

re: that final note left on #1499 , @ntdef pointed me to this: https://github.com/dmlc/xgboost/commit/1495a43cea05071e9451d008addffa598e4e7341

Apparently xgboost team had the same problem with CRAN and printf(). That gives me hope! Can address it in a follow-up PR

jameslamb commented 6 years ago

@Laurae2 can you update the checklist at the top of this? As of #1499 and given #1626 that I just created, I think it should look like this:

[not necessary] Setup a LightGBM special version for CRAN (R-package must be root folder, not a child folder) [done] Fix CRAN errors [done] Fix CRAN warnings Fix CRAN notes [done] Add vignettes [done] Make examples runnable for tests Switch to MinGW by default on Windows (it falls to MinGW if VS fails to be found) [done] Clean install everytime when not using precompiled dll/lib Pass CRAN checks on Windows Pass CRAN checks on Linux Submit to CRAN Get accepted on CRAN

Laurae2 commented 6 years ago

@jameslamb updated the checklist

jameslamb commented 6 years ago

thank you!

cdeterman commented 5 years ago

Any more recent updates regarding this? Is the checklist above up to date? Perhaps I can help get this package CRAN ready.

jameslamb commented 5 years ago

Hey @cdeterman apologies for the delay! We have one R CMD CHECK "NOTE" remaining on Linux distributions, building from source. That is the next highest-priority item on our road to CRAN.

I will write it up as a separate issue and link it here.

jameslamb commented 5 years ago

@cdeterman see the above, let me know if you have questions!

jameslamb commented 5 years ago

@Laurae2 @StrikerRUS I've created label r-package and am going to go through and tag outstanding R issues with it so others can see what is in the R backlog more easily than via text search on issue titles.

Laurae2 commented 5 years ago

@guolinke @jameslamb Rinternals.h is LGPL v2.1 (or any later version) so we are free to hook onto it (with certain limitations, like not copy&pasting a whole block of Rinternals.h onto LightGBM) while keeping MIT license of LightGBM and LightGBM R-package.

https://github.com/wch/r-source/blob/tags/R-3-5-3/src/include/Rinternals.h#L7

jameslamb commented 5 years ago

@Laurae2 good investigation, that is exciting! I see it's the same for R.h (https://github.com/wch/r-source/blob/tags/R-3-5-3/src/include/R.h#L6) which we may also need. If we are ok to use these headers, than I think I know how to solve #1910 and I also think it would give us a path to solve #1909 .

I've assigned #1910 to myself as I already have a branch where I'd started working down this path. Will put up a PR when I can to address it.

StrikerRUS commented 4 years ago

@jameslamb Any updates?

jameslamb commented 4 years ago

Hey @StrikerRUS sorry for the (very long) delay answering here! For those following this issue, we have at least two lingering issues to address to get to CRAN:

I just introduced #2837 which is a step towards that. It adds the idea of R defining an option for cmake which says "hey you are compiling lig_lightgbm specifically for the R package". To finish #1910 and #1909 I think I'll need to replace our custom handling of the R-to-C interface (https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/R_object_helper.h) with the headers that ship with R. I tried to just #include <R.h> to get e.g Rprintf(), but that led to a lot of name conflicts.

So I'm attacking this in the following order:

  1. proof-of-concept that we can compile a different lib_lightgbm specific to the R package (#2837)
  2. swap out our implementation for <R.h> and <Rinternals.h> to address #1909
  3. add registration to address #1910
  4. start testing installation from a source distribution (R CMD INSTALL lightgbm_*.tar.gz) on different operating systems
  5. submit to CRAN
StrikerRUS commented 4 years ago

@jameslamb Thanks for the heads-up!

I think one more step (related to n. 4 in your list) is to enable Windows R-package job (#2335) that can be done in the nearest future.

jameslamb commented 4 years ago

@jameslamb Thanks for the heads-up!

I think one more step (related to n. 4 in your list) is to enable Windows R-package job (#2335) that can be done in the nearest future.

great point! Yes I agree, that will help. I do have an old-ish Windows laptop. Maybe I'll spin that up and start developing on it 😀

StrikerRUS commented 4 years ago

@jameslamb

I do have an old-ish Windows laptop. Maybe I'll spin that up and start developing on it 😀

Appveyor has a great functionality that allows to connect to it via RDP: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/. It helped me many times! You can use it to setup R package pipeline. Also, don't forget about https://github.com/RGF-team/rgf/blob/master/R-package/.R.appveyor.ps1 😉

jameslamb commented 4 years ago

I think we're getting pretty close! Made good progress this week.

The 1 NOTE referenced above is actually not a problem. If you run R CMD CHECK on a package that is not on CRAN yet, it will throw up a note saying "hey this is a new package that hasn't been seen on CRAN before". So that one won't be a problem when we submit.

Next step after getting those 4 PRs reviewed and merged will be to add Windows CI (#2335) and (in parallel) to try running win-builder.

jameslamb commented 4 years ago

Wanted to provide an update for anyone watching this issue.

2901 , #2908 , and #2909 have been merged.

2911 is being reviewed. When it's merged, we'll have a package that is passing CRAN checks on macOS 10.14, Ubuntu 14.04, and Ubuntu 18.04, with both clang and gcc (https://github.com/microsoft/LightGBM/pull/2911#issuecomment-602964871).

2936 (adding Windows CI) is currently in review. I see two more Windows-specific R CMD CHECK NOTEs there which seem like they'll be straightforward to address.

The next thing we need to figure out is whether or not CRAN will accept a package that does not support 32-bit Windows. Notice that in #2936 I'm running R CMD check --as-cran --no-multiarch because otherwise when you run on 64-bitt Windows R will try to build and check the package for both architectures. We don't currently support 32-bit R.

I don't see anything specific about architecture requirements in https://cran.r-project.org/web/packages/policies.html#Source-packages. I don't see any 32-bit Windows environments in CRAN's standard set of checks but it's possible that they bold both architectures on a 64-bit system. We will see!

StrikerRUS commented 4 years ago

@jameslamb

I don't see any 32-bit Windows environments in CRAN's standard set of checks but it's possible that they bold both architectures on a 64-bit system.

I do see two mentiones of 32bit:

i686-posix-dwarf

jameslamb commented 4 years ago

i686-posix-dwarf

ah! I've never heard of i686 before. Ok, that might be a thing we have to figure out. We'll get there.

StrikerRUS commented 4 years ago

ah! I've never heard of i686 before. Ok, that might be a thing we have to figure out. We'll get there.

Maybe we just can wait for a while? 😄

Beginning with Windows 10, version 2004, all new Windows 10 systems will be required to use 64-bit builds and Microsoft will no longer release 32-bit builds for OEM distribution. https://www.engadget.com/windows-10-32-bit-oem-173055990.html

jameslamb commented 4 years ago

Ok I took the current version of the R package on #3188 , since I think that PR will be merged soon, and built an R source package to check on R Hub.

How to run R Hub checks from a terminal: ```shell sh build-cran-package.sh ``` from R: ```r result <- rhub::check( path = "lightgbm_2.3.2.tar.gz" , email = "jaylamb20@gmail.com" , check_args = "--as-cran" , platform = rhub::platforms()[["name"]] , env_vars = c( "R_COMPILE_AND_INSTALL_PACKAGES" = "always" ) ) ```

Overview

R Hub is a free project that runs R CMD check on an R package on a bunch of platforms.

It doesn't respond fast enough to be part of our normal CI, and it is independent of CRAN so the environments there are slightly different, but it is a free way to test on a lot of setups, especially older Windows environments.

The results are below. I don't know how long the log links last, but I included those as well

Conclusions

Not all of the problems below are problems we will face on CRAN, and none of them should block #3188 . But a few are worth looking into, with more targeted uses of rhub::check().

Results

Oracle Solaris 10, x86, 32 bit, R-release, Oracle Developer Studio 12.6

1 NOTE, 0 WARNINGS, 1 ERROR [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-27612bec0da64d65a24cdcc48c376ded) ```text /opt/csw/bin/g++-5.5 -std=gnu++11 -I"/opt/csw/lib/R/include" -DNDEBUG -I./include -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD -I/opt/csw/include -pthread -fPIC -O2 -pipe -fno-omit-frame-pointer -m32 -march=pentiumpro -c network/linkers_socket.cpp -o network/linkers_socket.o In file included from network/linkers.h:22:0, from network/linkers_socket.cpp:19: network/socket_wrapper.hpp:30:21: fatal error: ifaddrs.h: No such file or directory compilation terminated. gmake: *** [/opt/csw/lib/R/etc/Makeconf:176: network/linkers_socket.o] Error 1 ERROR: compilation failed for package ‘lightgbm’ * removing ‘/export/home/X8LyD0f/R/lightgbm’ Warning message: In i.p(...) : installation of package ‘/export/home/X8LyD0f/Rtemp/RtmpMrj4mJ/file618843243bf5/lightgbm_2.3.2.tar.gz’ had non-zero exit status ```

Oracle Solaris 10, x86, 32 bit, R-release

1 NOTE, 0 WARNINGS, 1 ERROR [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-de74e238a06d4265a5764f5474b34f29) ```text /opt/csw/bin/g++-5.5 -std=gnu++11 -I"/opt/csw/lib/R/include" -DNDEBUG -I./include -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD -I/opt/csw/include -pthread -fPIC -O2 -pipe -fno-omit-frame-pointer -m32 -march=pentiumpro -c network/linkers_socket.cpp -o network/linkers_socket.o In file included from network/linkers.h:22:0, from network/linkers_socket.cpp:19: network/socket_wrapper.hpp:30:21: fatal error: ifaddrs.h: No such file or directory compilation terminated. gmake: *** [/opt/csw/lib/R/etc/Makeconf:176: network/linkers_socket.o] Error 1 ERROR: compilation failed for package ‘lightgbm’ ```

macOS 10.13.6 High Sierra, R-release, CRAN's setup

1 NOTE, 2 WARNINGS, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-39a81f9ed7c348a8bb1e6081a103ef86) ```text * checking whether package ‘lightgbm’ can be installed ... WARNING Found the following significant warnings: Warning: package ‘R6’ was built under R version 4.0.2 See ‘/Users/userllqNxUln/lightgbm.Rcheck/00install.out’ for details. * checking top-level files ... WARNING A complete check needs the 'checkbashisms' script. See section ‘Configure and cleanup’ in the ‘Writing R Extensions’ manual. ```

macOS 10.13.6 High Sierra, R-release, brew

1 NOTE, 2 WARNINGS, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-a119459a3b62462a9ba62c2435aff183) ```text * checking whether package ‘lightgbm’ can be installed ... WARNING Found the following significant warnings: Warning: package ‘R6’ was built under R version 4.0.2 See ‘/Users/userllqNxUln/lightgbm.Rcheck/00install.out’ for details. * checking top-level files ... WARNING A complete check needs the 'checkbashisms' script. See section ‘Configure and cleanup’ in the ‘Writing R Extensions’ manual. ```

⚠️ Ubuntu Linux 16.04 LTS, R-release, GCC

3 NOTEs, 0 WARNINGS, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-378a2141f81d4a82bc64f4334d6e3fd7) ```text * checking installed package size ... NOTE installed size is 35.7Mb sub-directories of 1Mb or more: libs 35.1Mb * checking examples ... NOTE Examples with CPU or elapsed time > 5s user system elapsed lgb.cv 22.910 0.197 70.190 lgb.model.dt.tree 13.948 0.141 41.967 lgb.importance 6.955 0.058 20.697 lgb.plot.importance 6.864 0.083 19.118 lgb.interprete 4.675 0.074 14.342 lgb.get.eval.result 4.336 0.049 12.555 lgb.unloader 4.261 0.005 12.519 lgb.train 4.200 0.025 13.718 predict.lgb.Booster 4.159 0.003 12.443 ```

⚠️ Fedora Linux, R-devel, clang, gfortran

build timed out after 20 mins [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-c9630359a10845f9810ef2a6df8130dd)

Windows Server 2008 R2 SP1, R-oldrel, 32/64 bit

1 NOTE, 0 WARNINGS, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-28271b3d8f3347a7bd647b25b68908d8)

Windows Server 2008 R2 SP1, R-release, 32/64 bit

1 NOTE, 0 WARNINGs, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-0c2d3bbb8fa74becacc683b8c1b27268)

Windows Server 2008 R2 SP1, R-patched, 32/64 bit

1 NOTEs, WARNINGS, ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-5e99751523234b398aad73250062de32)

Windows Server 2008 R2 SP1, R-devel, 32/64 bit

1 NOTEs, WARNINGS, ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-8ceed10810ca4fc88d7fa95b7f14f2d8)

Windows Server 2008 R2 SP1, R-release, 32/64 bit

1 NOTE, 0 WARNINGs, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-dbd2092382ea4478866cfcef4c4ef5cf)

⚠️ Ubuntu Linux 16.04 LTS, R-devel, GCC

3 NOTEs, 1 WARNING, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-6bb8a4e52c4a4b6cbfc4da79922619ac) ```text * checking installed package size ... NOTE installed size is 11.6Mb sub-directories of 1Mb or more: libs 11.0Mb * checking top-level files ... WARNING A complete check needs the 'checkbashisms' script. See section ‘Configure and cleanup’ in the ‘Writing R Extensions’ manual. * checking examples ... NOTE Examples with CPU (user + system) or elapsed time > 5s user system elapsed lgb.cv 23.612 0.098 66.864 lgb.model.dt.tree 12.887 0.039 35.043 lgb.importance 7.528 0.051 19.835 lgb.plot.importance 7.190 0.028 20.008 lgb.interprete 5.828 0.031 16.085 lgb.get.eval.result 4.639 0.012 13.082 predict.lgb.Booster 4.547 0.038 12.532 lgb.unloader 4.558 0.017 12.948 lgb.train 4.512 0.049 12.857 ```

⚠️ Debian Linux, R-devel, GCC, no long double

3 NOTEs, 1 WARNINGS, 0 ERRORs..build timed out [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-e447f0d507334538bb45a9fdab2fdfd3) ```text * checking installed package size ... NOTE installed size is 11.1Mb sub-directories of 1Mb or more: libs 10.5Mb * checking top-level files ... WARNING A complete check needs the 'checkbashisms' script. See section ‘Configure and cleanup’ in the ‘Writing R Extensions’ manual. * checking examples ... NOTE Examples with CPU (user + system) or elapsed time > 5s user system elapsed lgb.cv 22.500 0.259 64.849 lgb.model.dt.tree 12.275 0.155 43.373 lgb.plot.importance 7.729 0.074 28.011 lgb.importance 7.089 0.105 21.387 lgb.interprete 5.348 0.036 17.705 predict.lgb.Booster 4.418 0.021 17.406 lgb.get.eval.result 4.353 0.032 13.378 lgb.train 4.263 0.105 11.392 lgb.unloader 3.896 0.041 16.054 ```

⚠️ Debian Linux, R-devel, clang, ISO-8859-15 locale

3 NOTEs, 1 WARNING, 0 ERRORs [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-1187567c8036469d992c1889b582f5f5) ```text * checking installed package size ... NOTE installed size is 11.0Mb sub-directories of 1Mb or more: libs 10.4Mb * checking top-level files ... WARNING A complete check needs the 'checkbashisms' script. See section 'Configure and cleanup' in the 'Writing R Extensions' manual. * checking examples ... NOTE Examples with CPU (user + system) or elapsed time > 5s user system elapsed lgb.cv 2.106 0.058 6.457 lgb.interprete 1.858 0.037 5.495 ```

Debian Linux, R-devel, GCC ASAN/UBSAN

failed before getting to R CMD CHECK [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-40375e2cf86e487891de62cbe5261bb2) many of these: ``` g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I./include -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD -I/usr/local/include -pthread -fpic -g -O2 -Wall -pedantic -mtune=native -c application/application.cpp -o application/application.o In file included from ./include/LightGBM/config.h:16:0, from ./include/LightGBM/application.h:8, from application/application.cpp:5: ./include/LightGBM/utils/common.h:775:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static, 1) ./include/LightGBM/utils/common.h:791:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static, 1) In file included from ./include/LightGBM/dataset.h:9:0, from application/application.cpp:8: ./include/LightGBM/feature_group.h:204:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(guided) In file included from application/application.cpp:8:0: ./include/LightGBM/dataset.h:321:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static) application/application.cpp:221:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static) In file included from ./include/LightGBM/utils/common.h:9:0, from ./include/LightGBM/config.h:16, from ./include/LightGBM/application.h:8, from application/application.cpp:5: ./include/LightGBM/utils/openmp_wrapper.h:84:2: warning: extra ‘;’ [-Wpedantic] }; // extern "C" ^ g++ -fsanitize=undefined,bounds-strict -fno-omit-frame-pointer -std=gnu++11 -I"/usr/local/lib/R/include" -DNDEBUG -I./include -DMM_PREFETCH=1 -DMM_MALLOC=1 -DUSE_SOCKET -DLGB_R_BUILD -I/usr/local/include -pthread -fpic -g -O2 -Wall -pedantic -mtune=native -c boosting/boosting.cpp -o boosting/boosting.o In file included from ./include/LightGBM/config.h:16:0, from ./include/LightGBM/boosting.h:8, from boosting/boosting.cpp:5: ./include/LightGBM/utils/common.h:775:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static, 1) ./include/LightGBM/utils/common.h:791:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas] #pragma omp parallel for schedule(static, 1) ``` and then some errors like this: ```text [LightGBM] [Info] Saving data to binary file /tmp/RtmpR4zZHQ/lgb.Dataset_b375cc1023c io/dataset_loader.cpp:340:59: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const value_type', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/stl_vector.h:948:21: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const int', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/vector.tcc:415:28: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const type', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/move.h:74:36: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const int', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/alloc_traits.h:475:4: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const type', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/move.h:74:36: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const int', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/ext/new_allocator.h:136:46: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const type', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/move.h:74:36: runtime error: reference binding to misaligned address 0x7ff62587302e for type 'const int', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/ext/new_allocator.h:136:4: runtime error: load of misaligned address 0x7ff62587302e for type 'const int', which requires 4 byte alignment 0x7ff62587302e: note: pointer points here 00 00 01 00 13 00 00 00 ff ff ff ff 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ /usr/include/c++/7/bits/stl_vector.h:943:30: runtime error: reference binding to misaligned address 0x7ff62587303a for type 'const int', which requires 4 byte alignment 0x7ff62587303a: note: pointer points here 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 15 00 00 00 16 00 00 00 ^ /usr/include/c++/7/bits/alloc_traits.h:475:4: runtime error: reference binding to misaligned address 0x7ff62587303a for type 'const type', which requires 4 byte alignment 0x7ff62587303a: note: pointer points here 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 15 00 00 00 16 00 00 00 ^ /usr/include/c++/7/bits/move.h:74:36: runtime error: reference binding to misaligned address 0x7ff62587303a for type 'const int', which requires 4 byte alignment 0x7ff62587303a: note: pointer points here 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 15 00 00 00 16 00 00 00 ^ /usr/include/c++/7/ext/new_allocator.h:136:46: runtime error: reference binding to misaligned address 0x7ff62587303a for type 'const type', which requires 4 byte alignment 0x7ff62587303a: note: pointer points here 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 15 00 00 00 16 00 00 00 ^ /usr/include/c++/7/bits/move.h:74:36: runtime error: reference binding to misaligned address 0x7ff62587303a for type 'const int', which requires 4 byte alignment 0x7ff62587303a: note: pointer points here 14 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 15 00 00 00 16 00 00 00 ```

CentOS 6 with Redhat Developer Toolset, R from EPEL

3 NOTEs, 1 WARNING, 1 ERROR [logs](https://builder.r-hub.io/status/original/lightgbm_2.3.2.tar.gz-53a62ca38f1145b19418cf25772f228b) ```text * checking installed package size ... NOTE installed size is 36.2Mb sub-directories of 1Mb or more: libs 35.6Mb * checking compilation flags used ... WARNING Compilation used the following non-portable flag(s): ‘-Wp,-D_FORTIFY_SOURCE=2’ * checking examples ... NOTE Examples with CPU or elapsed time > 5s user system elapsed lgb.cv 17.445 0.110 48.786 lgb.model.dt.tree 12.655 0.039 36.095 lgb.plot.importance 7.178 0.027 20.485 lgb.importance 7.166 0.028 20.537 lgb.interprete 5.120 0.014 14.479 lgb.get.eval.result 4.393 0.012 12.221 lgb.train 4.348 0.016 11.936 predict.lgb.Booster 4.301 0.014 12.238 lgb.unloader 4.206 0.030 12.069 * checking tests ... Running ‘testthat.R’ [7m/20m] ERROR Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: You can set `force_row_wise=true` to remove the overhead. And if memory is not enough, you can set `force_col_wise=true`. [LightGBM] [Info] Total Bins 232 [LightGBM] [Info] Number of data points in the train set: 6513, number of used features: 116 [LightGBM] [Info] Start training from score 0.482113 [LightGBM] [Warning] No further splits with positive gain, best gain: -inf ══ testthat results ═══════════════════════════════════════════════════════════ [ OK: 765 | SKIPPED: 2 | WARNINGS: 0 | FAILED: 4 ] 1. Failure: lgb.train() works as expected with sparse features (@test_basic.R#477) 2. Failure: learning-to-rank with lgb.cv() works as expected (@test_learning_to_rank.R#119) 3. Failure: learning-to-rank with lgb.cv() works as expected (@test_learning_to_rank.R#125) 4. Failure: learning-to-rank with lgb.cv() works as expected (@test_learning_to_rank.R#131) Error: testthat unit tests failed Execution halted ```

Ignored warnings and notes

The following notes and warnings can be safely ignored and should not block us on CRAN.

* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Guolin Ke <guolin.ke@microsoft.com>’

New submission

License components with restrictions and base license permitting such:
  MIT + file LICENSE
* checking whether package ‘lightgbm’ can be installed ... WARNING
Found the following significant warnings:
  Warning: package ‘R6’ was built under R version 4.0.2
See ‘/Users/userllqNxUln/lightgbm.Rcheck/00install.out’ for details.
* checking top-level files ... WARNING
A complete check needs the 'checkbashisms' script.
See section ‘Configure and cleanup’ in the ‘Writing R Extensions’
manual.
* checking installed package size ... NOTE
  installed size is 35.7Mb
  sub-directories of 1Mb or more:
    libs  35.1Mb
guolinke commented 4 years ago

@jameslamb for oracle Solaris, maybe we can disable the network module. for the misaligned error, maybe the removal of MM_MALLOC is the root cause?

StrikerRUS commented 4 years ago

Ah, Solaris 11 has ifaddrs.h file, but unfortunately CRAN runs Solaris 10: https://issues.prosody.im/419

jameslamb commented 4 years ago

for oracle Solaris, maybe we can disable the network module.

I was thinking the same thing!

for the misaligned error, maybe the removal of MM_MALLOC is the root cause?

I don't think so. On the build with that issue, I see this

checking whether MM_PREFETCH works... yes
checking whether MM_MALLOC works... yes

and -DMM_MALLOC=1 in the compiler statements.

StrikerRUS commented 4 years ago

Maybe we can use a patch for Solaris 10 from psutil?

https://github.com/giampaolo/psutil/blob/master/psutil/arch/solaris/v10/ifaddrs.h https://github.com/giampaolo/psutil/blob/master/psutil/arch/solaris/v10/ifaddrs.c

It looks quite small.