blm-replicate icon indicating copy to clipboard operation
blm-replicate copied to clipboard

packrat fails

Open floswald opened this issue 6 years ago • 8 comments

sorry :-(

➜  git git clone [email protected]: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.

floswald avatar Apr 09 '19 19:04 floswald

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

tlamadon avatar Apr 09 '19 19:04 tlamadon

perhaps this is simply a packrat issue. See https://github.com/rstudio/packrat/issues/524

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

tlamadon avatar Apr 09 '19 19:04 tlamadon

docker works! (of course.)

this worked for a few steps: https://github.com/rstudio/packrat/issues/524#issuecomment-451524611

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 avatar Apr 09 '19 20:04 floswald

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().

floswald avatar Apr 09 '19 20:04 floswald

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!

tlamadon avatar Apr 09 '19 20:04 tlamadon

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.

brakka avatar Feb 26 '20 10:02 brakka

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

tlamadon avatar Mar 08 '20 18:03 tlamadon

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

brakka avatar Mar 09 '20 08:03 brakka