0

I'm trying to install the following package in RStudio on Linux. I'm getting the follow error code. I don't really understand it. I was wondering if anyone could help me make sense of it.

Thanks, Nick

> 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’
  • 1
    Possible duplicate of https://stackoverflow.com/q/31196431/8382207 – Sagar Aug 18 '17 at 20:13
  • Actually it is not a duplicate. The problem there was that the openssl library was missing from the system. Here there is a different error from the compiler. I had the same problem that I fixed by installing the latest version 0.1-5 whereas on CRAN it's 0.1-3. – Blaza Aug 18 '17 at 20:28

1 Answers1

1

I think I had the same problem recently.

I installed the package by downloading the most recent tarball (the .tar.gz file PKI_0.1-5.tar.gz) from the PKI RForge page and then running

install.packages(<tarball_path>, repos = NULL, type = "source").

EDIT: Actually, it's easier to run install.packages('PKI',,'http://www.rforge.net/') as written in small print at the bottom of the PKI RForge page

EDIT2: Looking at the news, it looks like version 0.1-4 (perhaps more stable) also fixes the problem and, well enough, it works on my system, while 0.1-3 doesn't (the one on CRAN currently).

Blaza
  • 253
  • 1
  • 10