我试图在Linux上的RStudio中安装以下软件包。我得到了下面的错误代码。我真的不明白。我想知道是否有人能帮我弄明白。
谢谢,
尼克

> install.packages("PKI")
Installing package into ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/PKI_0.1-3.tar.gz'
Content type 'application/x-gzip' length 31058 bytes (30 KB)
==================================================
downloaded 30 KB

* installing *source* package ‘PKI’ ...
** package ‘PKI’ successfully unpacked and MD5 sums checked
** libs
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c asn1.c -o asn1.o
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c init.c -o init.o
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c pki-x509.c -o pki-x509.o
pki-x509.c: In function ‘PKI_extract_key’:
pki-x509.c:136:26: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
     if (EVP_PKEY_type(key->type) != EVP_PKEY_RSA)
                          ^~
pki-x509.c: In function ‘get_cipher’:
pki-x509.c:244:40: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
  ctx = (EVP_CIPHER_CTX*) malloc(sizeof(*ctx));
                                        ^~~~
pki-x509.c: In function ‘PKI_RSAkeygen’:
pki-x509.c:550:5: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
     rsa = RSA_generate_key(bits, 65537, 0, 0);
     ^~~
In file included from /usr/include/openssl/rsa.h:13:0,
                 from pki.h:13,
                 from pki-x509.c:1:
/usr/include/openssl/rsa.h:193:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^
make: *** [/usr/lib64/R/etc/Makeconf:159: pki-x509.o] Error 1
ERROR: compilation failed for package ‘PKI’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4/PKI’
Warning in install.packages :
  installation of package ‘PKI’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpttDG6C/downloaded_packages’

最佳答案

我想我最近也有同样的问题。
我通过从PKI RForge page下载最新的tarball(tar.gz文件PKI_0.1-5.tar.gz)并运行
install.packages(<tarball_path>, repos = NULL, type = "source")
编辑:实际上,运行install.packages('PKI',,'http://www.rforge.net/')更容易,就像在PKI RForge page底部用小字体写的那样
EDIT2:看看news,看起来0.1-4版本(可能更稳定)也解决了这个问题,而且,很好,它在我的系统上运行,而0.1-3版本没有(目前在CRAN上的版本)。

10-06 13:07