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

Package built from source to a PC with no internet connection #1982

Open
jpanfil opened this issue Sep 11, 2024 · 2 comments
Open

Package built from source to a PC with no internet connection #1982

jpanfil opened this issue Sep 11, 2024 · 2 comments

Comments

@jpanfil
Copy link

jpanfil commented Sep 11, 2024

Goal: get a specific version of XGBoost onto a computer with no internet, and installable via renv. This is a bit of an edge case so I understand if there's no current solution. I have built XGBoost v.2.0.3.1 from source following their directions . Thus, I have a library folder with xgboost installed there. It was built rather than installed manually because building from source results in a package around 7MB instead of the ~130MB version that results from renv::install("https://s3-us-west-2.amazonaws.com/xgboost-nightly-builds/release_2.0.0/xgboost_r_gpu_win64_82d846bbeb83c652a0b1dff0e3519e67569c4a3d.tar.gz") (link comes from here).

What can I do so that I could copy this XGBoost version to the other PC that has no internet, and be able to run renv::restore or install for new projects there?

I have attempted zipping the xgboost folder into .zip archive, copying that to my cellar, and running

renv::install(r"[path\to\xgboost.zip]")
renv::install("[email protected]")
renv::install("[email protected]")
# all return
Warning: failed to find binary for 'xgboost 2.0.3.1' in package repositories
Warning: failed to find source for 'xgboost 2.0.3.1' in package repositories
Error: failed to retrieve package '[email protected]'
> sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows Server 2022 x64 (build 20348)

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    

time zone: America/Chicago
tzcode source: internal

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

loaded via a namespace (and not attached):
[1] compiler_4.4.0 tools_4.4.0    renv_0.17.3  

As always, thank you!

@kevinushey
Copy link
Collaborator

kevinushey commented Sep 11, 2024

When installing packages from local files, you normally need to provide the full normalized path to that file -- otherwise renv can misinterpret the request to install the package as being (for example) from a GitHub remote.

The following seems to work on my Windows machine:

# download xgboost nightly binary
setwd(tempdir())
url <- "https://s3-us-west-2.amazonaws.com/xgboost-nightly-builds/release_2.0.0/xgboost_r_gpu_win64_82d846bbeb83c652a0b1dff0e3519e67569c4a3d.tar.gz"
download.file(url, destfile = basename(url))

# make sure path to local zipfile is normalized
path <- normalizePath(basename(url))

# install from that path
renv::install(path)

Does that help in your scenario?

@jpanfil
Copy link
Author

jpanfil commented Sep 12, 2024

When installing packages from local files, you normally need to provide the full normalized path to that file -- otherwise renv can misinterpret the request to install the package as being (for example) from a GitHub remote.

Sorry, when anonymizing the path, I didn't make it clear that I was using a full normalized path "C:\blah\blah..."

The following seems to work on my Windows machine:
Does that help in your scenario?

This is an option, but as I mentioned above, the library is 130MB when using that tar compared to the 7MB the library is when built from source. So I was hoping to find a way to get the 7MB library easily portable across machines.

I also just tried archiving the folder to a tar.gz (via 7zip) and received a different error:

> renv::install(r"[C:\Users\user\Documents\xgboost_test\xgboost_2.0.3.1.tar.gz]")
Installing xgboost [2.0.3.1] ...
	FAILED
Error installing package 'xgboost':
===================================

* installing *binary* package 'xgboost' ...
cp: unknown option -- )
Try '/usr/bin/cp --help' for more information.
ERROR: installing binary package failed
* removing 'C:/Users/user/Documents/R_experiments/renv_test/renv/staging/1/xgboost'
Error: install of package 'xgboost' failed [error code 1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants