Daniel Castro
Daniel Castro

Reputation: 157

PKI package install in R - RHEL 7

I have the following environment:

OS: RHEL 7.9 (Maipo) R version: 4.2.0

When I try to install the PKI package I get the following error:

> install.packages('PKI')
trying URL 'https://myrepo.com:4343/RBrepo/latest/src/contrib/PKI_0.1-14.tar.gz'
Content type 'application/x-gzip' length 87283 bytes (85 KB)
==================================================
downloaded 85 KB

* installing *source* package ‘PKI’ ...
** package ‘PKI’ successfully unpacked and MD5 sums checked
** using staged installation
checking for pkg-config... yes
checking whether it knows about openssl... yes
configure: CFLAGS:
configure: LIBS: -lssl -lcrypto
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to enable C11 features... -std=gnu11
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for openssl/ssl.h... yes
checking for openssl/rsa.h... yes
checking for library containing RSA_generate_key_ex... none required
checking for openssl/ssl.h... (cached) yes
checking for library containing SSL_CTX_load_verify_locations... none required
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c asn1.c -o asn1.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c init.c -o init.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c pem.c -o pem.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c pgp.c -o pgp.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c pki-x509.c -o pki-x509.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c register.c -o register.o
/opt/rh/devtoolset-9/root/bin/gcc -I"/usr/lib64/R/include" -DNDEBUG -I/usr/local/include     -I/usr/local/include   -fpic  -g -O2  -c tools.c -o tools.o
/opt/rh/devtoolset-9/root/bin/gcc -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o PKI.so asn1.o init.o pem.o pgp.o pki-x509.o register.o tools.o -lssl -lcrypto -L/usr/lib64/R/lib -lR
installing to /usr/lib64/R/library/00LOCK-PKI/00new/PKI/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘PKI’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/lib64/R/library/00LOCK-PKI/00new/PKI/libs/PKI.so':
  /usr/lib64/R/library/00LOCK-PKI/00new/PKI/libs/PKI.so: undefined symbol: EVP_CIPHER_CTX_reset
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/PKI’

The downloaded source packages are in
        ‘/opt/tmp/Rtmp9mPyGn/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("PKI") :
  installation of package ‘PKI’ had non-zero exit status

I read in some other posts that this error (undefined symbol: EVP_CIPHER_CTX_reset) has to do with the openssl libraries (libcrypto.so).

I have in /usr/lib64:

lrwxrwxrwx   1 root         root              19 Jun  2  2023 libcrypto.so -> libcrypto.so.1.0.2k
lrwxrwxrwx   1 root         root              19 Jun  2  2023 libcrypto.so.10 -> libcrypto.so.1.0.2k
-rwxr-xr-x   1 root         root         2521224 Mar 10  2023 libcrypto.so.1.0.2k
-rw-r--r--   1 root         root              65 Mar 10  2023 .libcrypto.so.1.0.2k.hmac
lrwxrwxrwx   1 root         root              25 Jun  2  2023 .libcrypto.so.10.hmac -> .libcrypto.so.1.0.2k.hmac
lrwxrwxrwx   1 root         root              19 Dec  9  2023 libcrypto.so.1.1 -> libcrypto.so.1.1.1k
-rwxr-xr-x   1 root         root         3086752 Nov 25  2023 libcrypto.so.1.1.1k
-rw-r--r--   1 root         root              65 Nov 25  2023 .libcrypto.so.1.1.1k.hmac
lrwxrwxrwx   1 root         root              25 Dec  9  2023 .libcrypto.so.1.1.hmac -> .libcrypto.so.1.1.1k.hmac

The only one that has EVP_CIPHER_CTX_reset is libcrypto.so.1.1 :

nm -gD /usr/lib64/libcrypto.so.1.1 | grep EVP_CIPHER_CTX

000000000016d540 T EVP_CIPHER_CTX_block_size
000000000016d950 T EVP_CIPHER_CTX_buf_noconst
000000000016d5a0 T EVP_CIPHER_CTX_cipher
000000000016df90 T EVP_CIPHER_CTX_clear_flags
000000000016ce20 T EVP_CIPHER_CTX_copy
000000000016c770 T EVP_CIPHER_CTX_ctrl
000000000016d5b0 T EVP_CIPHER_CTX_encrypting
000000000016bb70 T EVP_CIPHER_CTX_free
000000000016d5d0 T EVP_CIPHER_CTX_get_app_data
000000000016d5f0 T EVP_CIPHER_CTX_get_cipher_data
000000000016d930 T EVP_CIPHER_CTX_iv
000000000016d620 T EVP_CIPHER_CTX_iv_length
000000000016d940 T EVP_CIPHER_CTX_iv_noconst
000000000016d990 T EVP_CIPHER_CTX_key_length
000000000016bb10 T EVP_CIPHER_CTX_new
000000000016db00 T EVP_CIPHER_CTX_nid
000000000016d960 T EVP_CIPHER_CTX_num
000000000016d920 T EVP_CIPHER_CTX_original_iv
000000000016cde0 T EVP_CIPHER_CTX_rand_key
000000000016ba30 T EVP_CIPHER_CTX_reset
000000000016d5e0 T EVP_CIPHER_CTX_set_app_data
000000000016d600 T EVP_CIPHER_CTX_set_cipher_data
000000000016df80 T EVP_CIPHER_CTX_set_flags
000000000016cd60 T EVP_CIPHER_CTX_set_key_length
000000000016d970 T EVP_CIPHER_CTX_set_num
000000000016c750 T EVP_CIPHER_CTX_set_padding
000000000016dfa0 T EVP_CIPHER_CTX_test_flags

Somehow I think that the compiler is reading another version of libcrypto.so different than libcrypto.so.1.1. IS there any way to "force it" or is there any other solution ?

Thank you in advance !

Upvotes: 0

Views: 66

Answers (0)

Related Questions