[英]Issue installing package testthat R on Ubuntu 22.04
我正在嘗試在 R 中安裝“devtools”。 我不能這樣做,因為它提示我“testthat”的問題。 然后我嘗試安裝它,我得到了:
> 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
我嘗試了其他方法:
我對 linux 和 r 不熟練,有人可以幫我嗎?
如果您使用的是 Microsoft-R,我所做的是為 Cran 卸載並安裝 R。 然后,我可以安裝“devtools”。 我對這個問題的理解是,r 和 microsoft-R 的版本已更新,因此您無法安裝“testthat”的最新版本(需要在 devtools 中安裝)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.