Openssl installation error

Hi, i'm trying to install openssl in Rstudio, but i get an error:

install.packages("openssl")
Installing package into ‘/home/neuro/R/x86_64-redhat-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
probando la URL 'https://cran.rstudio.com/src/contrib/openssl_2.0.2.tar.gz'
Content type 'application/x-gzip' length 1203211 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lssl -lcrypto
** libs
rm -f aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pbkdf.o pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o x25519.o openssl.so bcrypt/libstatbcrypt.a bcrypt/bcrypt_pbkdf.o bcrypt/blowfish.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c aes.c -o aes.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c base64.c -o base64.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c bignum.c -o bignum.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c cert.c -o cert.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c compatibility.c -o compatibility.o

...

info.c: En la función ‘R_openssl_fips_mode’:
info.c:38:3: aviso: declaración implícita de la función ‘FIPS_mode’ [-Wimplicit-function-declaration]
   int enabled = FIPS_mode();
   ^
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c keygen.c -o keygen.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c keys.c -o keys.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c onload.c -o onload.o
gcc -m64 -std=gnu99 -I"/usr/include/R" -DNDEBUG   -I/usr/local/include  -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c openssh.c -o openssh.o
openssh.c: En la función ‘R_ecdsa_pubkey_build’:
openssh.c:208:3: aviso: declaración implícita de la función ‘EC_KEY_set_public_key_affine_coordinates’ [-Wimplicit-function-declaration]
   if(!EC_KEY_set_public_key_affine_coordinates(pubkey, new_bignum_from_r(x), new_bignum_from_r(y)))

...

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against symbol `OPENSSL_cpuid_setup' can not be used when making a shared object; recompile con -fPIC
/usr/bin/ld: falló el enlace final: Valor erróneo
collect2: error: ld devolvió el estado de salida 1
make: *** [openssl.so] Error 1
ERROR: compilation failed for package ‘openssl’
* removing ‘/home/neuro/R/x86_64-redhat-linux-gnu-library/3.6/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status

Any suggestions?

I don't understand what is causing the compilation error but you can try avoiding compilation by installing from the public RStudio Package Manager

https://packagemanager.rstudio.com/client/#/repos/1/overview

Hi, i have changed the cran url repository in tools>global options, and still have the same error

install.packages("openssl")
Installing package into ‘/home/neuro/R/x86_64-redhat-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
probando la URL 'https://packagemanager.rstudio.com/all/latest/src/contrib/openssl_2.0.2.tar.gz'
Content type 'binary/octet-stream' length 1201787 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lssl -lcrypto
** libs
rm -f aes.o base64.o bignum.o cert.o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o keys.o onload.o openssh.o password.o pbkdf.o pem.o pkcs12.o pkcs7.o ra

...

info.c: En la función ‘R_openssl_fips_mode’:
info.c:38:3: aviso: declaración implícita de la función ‘FIPS_mode’ [-Wimplicit-function-declaration]
   int enabled = FIPS_mode();
   ^

...

openssh.c: En la función ‘R_ecdsa_pubkey_build’:
openssh.c:208:3: aviso: declaración implícita de la función ‘EC_KEY_set_public_key_affine_coordinates’ [-Wimplicit-function-declaration]
   if(!EC_KEY_set_public_key_affine_coordinates(pubkey, new_bignum_from_r(x), new_bignum_from_r(y)))
   ^
...

x25519.c:13:13: aviso: se define ‘R_read_raw_key’ pero no se usa [-Wunused-function]
 static SEXP R_read_raw_key(SEXP x, int type){
             ^
x25519.c:30:13: aviso: se define ‘R_read_raw_pubkey’ pero no se usa [-Wunused-function]
 static SEXP R_read_raw_pubkey(SEXP x, int type){
             ^
...

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against symbol `OPENSSL_cpuid_setup' can not be used when making a shared object; recompile con -fPIC
/usr/bin/ld: falló el enlace final: Valor erróneo
collect2: error: ld devolvió el estado de salida 1
make: *** [openssl.so] Error 1
ERROR: compilation failed for package ‘openssl’
* removing ‘/home/neuro/R/x86_64-redhat-linux-gnu-library/3.6/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status

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

What operating system are you using? It seems you haven't set it to download binaries and you are still compiling from source.

I'm using a Linux, Centos 7

Then, to use RSPM binaries, your package repository should be set to

https://packagemanager.rstudio.com/all/__linux__/centos7/latest

Thanks!! Problem solved! :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.