在R

时间:2019-07-01 06:37:49

标签: r git curl cmake devtools

我目前在Manjaro上使用Microsoft R Open 3.5。 我安装了devtools来通过以下方式安装ITKR:

devtools::install_github("stnava/ITKR")

这样做,我收到一个cacert错误:

Downloading GitHub repo stnava/ITKR@master
curl: (77) error setting certificate verify locations:
  CAfile: r-cacert.pem
  CApath: none
Error in utils::download.file(url, path, method = download_method(), 
quiet = quiet,  : 
  'curl' call had nonzero exit status

当我阅读其他问题时,我使用以下代码解决了这个问题(因为devtools告诉我下载的文件不是有效的tar文件,所以options()调用完成了。

Sys.setenv("CURL_CA_BUNDLE" = "/usr/lib/R/lib/microsoft-r-cacert.pem")
options(download.file.extra = paste0("-L ", getOption("download.file.extra", default = "")))

重新使用devtools安装ITKR时,下载开始,但是下载的文件很少之后,cacert错误又回来了。

> devtools::install_github("stnava/ITKR")
Downloading GitHub repo stnava/ITKR@master
✔  checking for file ‘/tmp/RtmpuipYyA/remotes83b43c925e6/stnava-ITKR-1b88aa6/DESCRIPTION’ ...
─  preparing ‘ITKR’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘ITKR_0.5.0.tar.gz’

Installing package into ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package ‘ITKR’ ...
Cloning into 'itks'...
remote: Enumerating objects: 58, done.
remote: Counting objects: 100% (58/58), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 449481 (delta 8), reused 11 (delta 4), pack-reused 449423
Receiving objects: 100% (449481/449481), 145.87 MiB | 589.00 KiB/s, done.
Resolving deltas: 100% (353286/353286), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
Note: checking out 'f136bfe8bdb86c068ef1627ca2a5c02d5aa2fa24'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at f136bfe8bd BUG: Fix export for ITKDeprecated classes
Cloning into 'cmaker'...
remote: Enumerating objects: 12647, done.
remote: Total 12647 (delta 0), reused 0 (delta 0), pack-reused 12647
Receiving objects: 100% (12647/12647), 10.42 MiB | 591.00 KiB/s, done.
Resolving deltas: 100% (3402/3402), done.
* installing to library ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5’
* installing *source* package ‘cmaker’ ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (77) error setting certificate verify locations:
  CAfile: r-cacert.pem
  CApath: none
Error in download.file("https://cmake.org/files/v3.11/cmake-3.11.4.tar.gz",  : 
  'curl' call had nonzero exit status
Execution halted
Error in file(con, "rb") : 
  (converted from warning) cannot open file 'cmake-3.11.4.tar.gz': No such file or directory
Calls: <Anonymous> -> readBin -> file
Execution halted
cp: cannot stat 'src/cmake/Utilities/NoDartCoverage': No such file or directory
cp: cannot stat 'src/cmake/Utilities/cmexpat/NoDartCoverage': No such file or directory
cp: cannot stat 'src/cmake/Utilities/cmzlib/NoDartCoverage': No such file or directory
./configure: line 29: cd: ./src/cmake: No such file or directory
./configure: line 32: ./bootstrap: No such file or directory
** libs
g++ -std=gnu++11 -I/usr/lib/R/include -DNDEBUG   -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c dummy.cpp -o dummy.o
cd cmake && make -j 2 && make install &&  cd ../ && rm -rf cmake
/bin/bash: line 0: cd: cmake: No such file or directory
make: *** [Makevars:8: libs] Error 1
ERROR: compilation failed for package ‘cmaker’
* removing ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/cmaker’
Error in loadNamespace(name) : there is no package called ‘cmaker’
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
./configure: line 55: -DCMAKE_BUILD_TYPE:STRING=Release: command not found
** libs
g++ -std=gnu++11 -I/usr/lib/R/include -DNDEBUG  -I"/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c dummy.cpp -o dummy.o
cd itkb && make -j 2 && make install && rm -rf ../itks
make[1]: Entering directory '/tmp/RtmpmaGPS8/R.INSTALLb1978611788/ITKR/src/itkb'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory '/tmp/RtmpmaGPS8/R.INSTALLb1978611788/ITKR/src/itkb'
make: *** [Makevars:8: libs] Error 2
ERROR: compilation failed for package ‘ITKR’
* removing ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/ITKR’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/tmp/RtmpuipYyA/file83b61ada88f/ITKR_0.5.0.tar.gz’ had non-zero exit status

调用Sys.getenv()时,CURL_CA_BUNDLE已正确设置为/usr/lib/R/lib/microsoft-r-cacert.pem。此外,我还可以通过devtools正确安装muschellij2/fslr

您知道如何解决此问题吗?谢谢。

0 个答案:

没有答案