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

packrat fails #1

Open
floswald opened this issue Apr 9, 2019 · 8 comments
Open

packrat fails #1

floswald opened this issue Apr 9, 2019 · 8 comments

Comments

@floswald
Copy link

floswald commented Apr 9, 2019

sorry :-(

➜  git git clone git@github.com:tlamadon/blm-replicate.git
Cloning into 'blm-replicate'...
remote: Enumerating objects: 122, done.
remote: Counting objects: 100% (122/122), done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 521 (delta 72), reused 82 (delta 38), pack-reused 399
Receiving objects: 100% (521/521), 1.59 MiB | 3.45 MiB/s, done.
Resolving deltas: 100% (311/311), done.
➜  git cd blm-replicate 

➜  blm-replicate git:(master) R

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (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.

  Natural language support but running in an English locale

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.

Packrat is not installed in the local library -- attempting to bootstrap an installation...
> No source tarball of packrat available locally
> Using user-library packrat (0.4.9.3) to bootstrap this project
Packrat mode on. Using library in directory:
- "~/git/blm-replicate/packrat/lib"
> install.packages("packrat")
Installing package into ‘/Users/florian.oswald/git/blm-replicate/packrat/lib/x86_64-apple-darwin15.6.0/3.5.1’
(as ‘lib’ is unspecified)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  438k  100  438k    0     0   177k      0  0:00:02  0:00:02 --:--:--  177k

The downloaded binary packages are in
	/var/folders/d2/hbd_ncyd6rg7jj25j7d4ht3h0000gp/T//RtmpnnXRbW/downloaded_packages
> source("packrat/init.R") 
Error in !packrat::opts$symlink.system.packages() : invalid argument type
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.3

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] C/UTF-8/C/C/C/C

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

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1    packrat_0.5.0 
> 

I get the same if I erase the repo, re-clone, first install.packages("packrat"), then starting R inside your package.

@tlamadon
Copy link
Owner

tlamadon commented Apr 9, 2019

eheh, interesting. Did you give the docker a try?

@tlamadon
Copy link
Owner

tlamadon commented Apr 9, 2019

perhaps this is simply a packrat issue. See rstudio/packrat#524

basically says to try rm -rf packrat/src packrat/lib*

@floswald
Copy link
Author

floswald commented Apr 9, 2019

docker works! (of course.)

this worked for a few steps: rstudio/packrat#524 (comment)

source("packrat/init.R") failed again. but packrat::restore() runs. however:

> packrat::restore()

The following packages were not installed by packrat and will be ignored:
            _        
    packrat   0.4.9-2

If you would like to overwrite them, call restore again with
overwrite.dirty = TRUE.
Installing Formula (1.2-3) ... 
	OK (downloaded binary)
Installing KernSmooth (2.23-15) ... 
	OK (downloaded binary)
Installing MASS (7.3-47) ... 
	OK (built source)
Installing R.methodsS3 (1.7.1) ... 
	OK (downloaded binary)
Installing R6 (2.3.0) ... 
	OK (built source)
Installing RColorBrewer (1.1-2) ... 
	OK (downloaded binary)
Installing Rcpp (1.0.0) ... 
	OK (built source)
Installing SparseM (1.77) ... 
	OK (downloaded binary)
Installing acepack (1.4.1) ... 
	OK (downloaded binary)
Installing assertthat (0.2.0) ... 
	OK (built source)
Installing backports (1.1.3) ... 
	OK (downloaded binary)
Installing base64enc (0.1-3) ... 
	OK (downloaded binary)
Installing bitops (1.0-6) ... 
	OK (downloaded binary)
Installing brew (1.0-6) ... 
	OK (downloaded binary)
Installing clipr (0.4.1) ... 
	OK (built source)
Installing clisymbols (1.2.0) ... 
	OK (downloaded binary)
Installing cluster (2.0.6) ... 
[1] "Command failed (1)\n\nFailed to run system command:\n\n\t'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL '/private/var/folders/d2/hbd_ncyd6rg7jj25j7d4ht3h0000gp/T/RtmpvdmV9B/cluster' --library='/Users/florian.oswald/git/blm-replicate/packrat/lib/x86_64-apple-darwin15.6.0/3.5.1' --install-tests --no-docs --no-multiarch --no-demo \n\nThe command failed with output:\n* installing *source* package 'cluster' ...\n** package 'cluster' successfully unpacked and MD5 sums checked\n** libs\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c clara.c -o clara.o\ngfortran   -fPIC  -g -O2  -c daisy.f -o daisy.o\ngfortran   -fPIC  -g -O2  -c dysta.f -o dysta.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c fanny.c -o fanny.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c mona.c -o mona.o\nmona.c:249:21: warning: variable 'lcc' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]\n                for (int lbb = k; lbb <= kb; ++lbb) {\n                                  ^~~~~~~~~\nmona.c:257:28: note: uninitialized use occurs here\n                for (int laa = k; laa <= lcc; ++laa) {\n                                         ^~~\nmona.c:249:21: note: remove the condition if it is always true\n                for (int lbb = k; lbb <= kb; ++lbb) {\n                                  ^~~~~~~~~\nmona.c:248:10: note: initialize the variable 'lcc' to silence this warning\n                int lcc, nelbb;\n                       ^\n                        = 0\n1 warning generated.\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c pam.c -o pam.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c sildist.c -o sildist.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c spannel.c -o spannel.o\nclang -I\"/Library/Frameworks/R.framework/Resources/include\" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c twins.c -o twins.o\nclang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o cluster.so clara.o daisy.o dysta.o fanny.o init.o mona.o pam.o sildist.o spannel.o twins.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation\nld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'\nld: warning: directory not found for option '-L/usr/local/gfortran/lib'\nld: library not found for -lgfortran\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nmake: *** [cluster.so] Error 1\nERROR: compilation failed for package 'cluster'\n* removing '/Users/florian.oswald/git/blm-replicate/packrat/lib/x86_64-apple-darwin15.6.0/3.5.1/cluster'"
Error: Command failed (1)

Failed to run system command:

	'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL '/private/var/folders/d2/hbd_ncyd6rg7jj25j7d4ht3h0000gp/T/RtmpvdmV9B/cluster' --library='/Users/florian.oswald/git/blm-replicate/packrat/lib/x86_64-apple-darwin15.6.0/3.5.1' --install-tests --no-docs --no-multiarch --no-demo 

The command failed with output:
* installing *source* package 'cluster' ...
** package 'cluster' successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c clara.c -o clara.o
gfortran   -fPIC  -g -O2  -c daisy.f -o daisy.o
gfortran   -fPIC  -g -O2  -c dysta.f -o dysta.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c fanny.c -o fanny.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.
> 

I think I'll stop here and stick to docker.

@floswald
Copy link
Author

floswald commented Apr 9, 2019

by the way, I found pretty straight forward on my office computer to just install the 2 non-CRAN packages manually first (RcppSimpleTensor and LatexTables), then straight devtools::install().

@tlamadon
Copy link
Owner

tlamadon commented Apr 9, 2019

ah ok! good. I am thinking about adding all the package sources to the git folder. But again, the docker is here to not have to deal with any of these issues!

@brakka
Copy link

brakka commented Feb 26, 2020

For those people who can not use docker, for one reason or another, the way to deal with the packrat issue (at least on a windows system - on a mac it works) is to install all the packages in their correct version manually.

@tlamadon
Copy link
Owner

tlamadon commented Mar 8, 2020

that is not ideal of course. packrat has not worked as well as I hoped for. I would recommend using docker.

@brakka
Copy link

brakka commented Mar 9, 2020

Yes, docker works, but it also has flaws. When I try to run the dynamic bootstrap R crashes every time.

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

3 participants