I am trying to install 'devtools' in R. I cannot do it because it promps me a issue with 'testthat'. Then I tried to install it and I got:
> install.packages("testthat")
Installing package into ‘/home/alejo/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 243k 100 243k 0 0 192k 0 0:00:01 0:00:01 --:--:-- 192k
Microsoft R Open 4.0.2
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2020 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing (using 6 cores).
Default CRAN mirror snapshot taken on 2020-07-16.
See: https://mran.microsoft.com/.
* installing *source* package ‘testthat’ ...
** package ‘testthat’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c init.c -o init.o
gcc -std=gnu99 -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c reassign.c -o reassign.o
g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c test-catch.cpp -o test-catch.o
g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c test-example.cpp -o test-example.o
g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c test-runner.cpp -o test-runner.o
In file included from /usr/include/signal.h:328,
from ../inst/include/testthat/vendor/catch.h:6467,
from ../inst/include/testthat/testthat.h:65,
from ../inst/include/testthat.h:1,
from test-runner.cpp:7:
../inst/include/testthat/vendor/catch.h:6490:33: error: size of array ‘altStackMem’ is not an integral constant-expression
6490 | static char altStackMem[SIGSTKSZ];
| ^~~~~~~~
../inst/include/testthat/vendor/catch.h:6541:45: error: size of array ‘altStackMem’ is not an integral constant-expression
6541 | char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
| ^~~~~~~~
make: *** [/opt/microsoft/ropen/4.0.2/lib64/R/etc/Makeconf:168: test-runner.o] Error 1
ERROR: compilation failed for package ‘testthat’
* removing ‘/home/alejo/R/x86_64-pc-linux-gnu-library/4.0/testthat’
Warning in install.packages :
installation of package ‘testthat’ had non-zero exit status
I have tried other ways:
I am not skillful with linux and r, can someone help me?
If you are using Microsoft-R, what I did was to uninstall and install R for Cran. Then, I could install 'devtools'. What I understand of this issue, the version of r and microsoft-R is updated and therefore you cannot install the last version of 'testthat' (it is need for installin devtools).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.