Skip to content

Allow easier installation for R package via devtools#177

Merged
guolinke merged 2 commits intolightgbm-org:masterfrom
Laurae2:patch-1
Jan 9, 2017
Merged

Allow easier installation for R package via devtools#177
guolinke merged 2 commits intolightgbm-org:masterfrom
Laurae2:patch-1

Conversation

@Laurae2
Copy link
Copy Markdown
Contributor

@Laurae2 Laurae2 commented Jan 8, 2017

Provide better documentation for installing the R package:

  • To install directly from R using devtools
  • To install directly a specific LightGBM commit from R using devtools
  • The pre-requisites for Windows (Rtools)
  • A quick test to run to check if LightGBM installed correctly

Old PR:

This allows to fix issue #176.

Source / R-package folders must not be separated when installing the R package.

The edit: a lot of details are added for compiling LightGBM successfully in Windows.

@msftclas
Copy link
Copy Markdown

msftclas commented Jan 8, 2017

Hi @Laurae2, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@guolinke
Copy link
Copy Markdown
Collaborator

guolinke commented Jan 9, 2017

@Laurae2 How do you install R-package in windows ?
I think it doesn't need the visual studio. The compile is done by R-Tools, which uses mingw32/cygwin to compile the cpp codes in windows.

@Laurae2
Copy link
Copy Markdown
Contributor Author

Laurae2 commented Jan 9, 2017

I was using the following to install LightGBM in R:

devtools::install_github("Microsoft/LightGBM", ref = "1b7643b", subdir = "R-package")

Output:

> devtools::install_github("Microsoft/LightGBM", ref = "1b7643b", subdir = "R-package")
Downloading GitHub repo Microsoft/LightGBM@1b7643b
from URL https://api.github.com/repos/Microsoft/LightGBM/zipball/1b7643b
Installing lightgbm
"C:/PROGRA~1/MIE74D~1/MRO-33~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/Laurae/AppData/Local/Temp/RtmpuGA4p0/devtools2176cb79646b/Microsoft-LightGBM-1b7643b/R-package" --library="C:/Program  \
  Files/Microsoft/MRO-3.3.1/library" --install-tests 

* installing *source* package 'lightgbm' ...
** libs
c:/Rtools/mingw_64/bin/g++ -m64 -std=c++0x -I"C:/PROGRA~1/MIE74D~1/MRO-33~1.1/include" -DNDEBUG -I../..//include -DUSE_SOCKET      -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -fopenmp -pthread -std=c++11   -O2 -Wall  -mtune=core2 -c lightgbm-all.cpp -o lightgbm-all.o
c:/Rtools/mingw_64/bin/g++ -m64 -std=c++0x -I"C:/PROGRA~1/MIE74D~1/MRO-33~1.1/include" -DNDEBUG -I../..//include -DUSE_SOCKET      -I"C:/swarm/workspace/External-R-3.3.1/vendor/extsoft/include"  -fopenmp -pthread -std=c++11   -O2 -Wall  -mtune=core2 -c lightgbm_R.cpp -o lightgbm_R.o
c:/Rtools/mingw_64/bin/g++ -m64 -shared -s -static-libgcc -o lightgbm.dll tmp.def ./lightgbm-all.o ./lightgbm_R.o -fopenmp -pthread -lws2_32 -liphlpapi -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib/x64 -LC:/swarm/workspace/External-R-3.3.1/vendor/extsoft/lib -LC:/PROGRA~1/MIE74D~1/MRO-33~1.1/bin/x64 -lR
installing to C:/Program Files/Microsoft/MRO-3.3.1/library/lightgbm/libs/x64
** R
** data
** demo
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
Warning in readLines(file) :
  incomplete final line found on './demo/00Index'
** testing if installed package can be loaded
* DONE (lightgbm)

This is mysterious, it doesn't error anymore as I cannot reproduce anymore the issue I had (I rebooted my computer between yesterday and today, could be the "fix").

I updated accordingly the PR to provide an easier way to install this package using devtools (and change the PR name).

@Laurae2 Laurae2 changed the title Fix to avoid issue #176 for R package installation Allow easier installation fo R package Jan 9, 2017
@Laurae2 Laurae2 changed the title Allow easier installation fo R package Allow easier installation for R package via devtools Jan 9, 2017
@guolinke
Copy link
Copy Markdown
Collaborator

guolinke commented Jan 9, 2017

I see. Thanks for the document !

@guolinke guolinke merged commit 9b2558d into lightgbm-org:master Jan 9, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants