r-lib / ps

R package to query, list, manipulate system processes
https://ps.r-lib.org/
Other
78 stars 20 forks source link

Unable to install ps in R-3.6 #63

Closed pati-ni closed 5 years ago

pati-ni commented 5 years ago

I can not seem to get this package working with R 3.6

> install.packages('ps')
trying URL 'https://ftp.cc.uoc.gr/mirrors/CRAN/src/contrib/ps_1.3.0.tar.gz'
Content type 'application/octet-stream' length 261887 bytes (255 KB)
==================================================
downloaded 255 KB

* installing *source* package ‘ps’ ...
** package ‘ps’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -g -O2  -Wall px.c -o px
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c init.c -o init.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c api-common.c -o api-common.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c common.c -o common.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c extra.c -o extra.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c dummy.c -o dummy.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c posix.c -o posix.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c api-posix.c -o api-posix.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c linux.c -o linux.o
gcc -I"/home/main/apps/R-3.6/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2  -c api-linux.c -o api-linux.o
gcc -shared -L/home/main/apps/R-3.6/lib/R/lib -L/usr/local/lib -o ps.so init.o api-common.o common.o extra.o dummy.o posix.o api-posix.o linux.o api-linux.o -L/home/main/apps/R-3.6/lib/R/lib -lR
installing via 'install.libs.R' to /home/main/apps/R-3.6/lib/R/library/00LOCK-ps/00new/ps
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
mv: cannot move '/home/main/apps/R-3.6/lib/R/library/00LOCK-ps/00new/ps' to '/home/main/apps/R-3.6/lib/R/library/ps': Permission denied
ERROR:   moving to final location failed

The downloaded source packages are in
        ‘/tmp/Rtmp3GvegO/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("ps") :
  installation of package ‘ps’ had non-zero exit status

I am pretty sure I do not have permission problems since I am able to successfully install other packages.

Is this problem reproducible in other systems as well or is it just mine?

gaborcsardi commented 5 years ago

This seems like a failure of the base R installation process, most likely because of the new staged installation. See e.g.: https://stat.ethz.ch/pipermail/r-devel/2019-May/077736.html and the workaround there:

Disabling staged installation, for instance by setting environment variable 'R_INSTALL_STAGED=false' avoids this problem.

albertotb commented 5 years ago

I can confirm this problem exists when trying to install ps in the WSL (Windows 10). The workaround works fine in that case

egoipse commented 4 years ago

I found that I get this message when trying to update a library owned by root user (on Unix-based systems, of course). Just chown the library folder to the user running R to solve the issue.