Closed alazarolop closed 2 years ago
Can you show the full installation log?
Sure, it is:
Installing package into ‘/opt/R/4.2.0/lib/R/site-library’
(as ‘lib’ is unspecified)
system (cmd0): /opt/R/4.2.0/lib/R/bin/R CMD INSTALL
trying URL 'https://cloud.r-project.org/src/contrib/openssl_2.0.1.tar.gz'
Content type 'application/x-gzip' length 1204569 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
foundpkgs: openssl, /tmp/RtmpkmVNXm/downloaded_packages/openssl_2.0.1.tar.gz
files: /tmp/RtmpkmVNXm/downloaded_packages/openssl_2.0.1.tar.gz
* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-l:libssl.so.3 -l:libcrypto.so.3
** 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
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c aes.c -o aes.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c base64.c -o base64.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c bignum.c -o bignum.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c cert.c -o cert.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c compatibility.c -o compatibility.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c diffie.c -o diffie.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c envelope.c -o envelope.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c error.c -o error.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c hash.c -o hash.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c info.c -o info.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c keygen.c -o keygen.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c keys.c -o keys.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c onload.c -o onload.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c openssh.c -o openssh.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c password.c -o password.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c pbkdf.c -o pbkdf.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c pem.c -o pem.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c pkcs12.c -o pkcs12.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c pkcs7.c -o pkcs7.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c rand.c -o rand.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c rsa.c -o rsa.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c signing.c -o signing.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c ssl.c -o ssl.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c stream.c -o stream.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c write.c -o write.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c x25519.c -o x25519.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c bcrypt/bcrypt_pbkdf.c -o bcrypt/bcrypt_pbkdf.o
ccache gcc-11 -I"/opt/R/4.2.0/lib/R/include" -DNDEBUG -DOPENSSL_SUPPRESS_DEPRECATED -I/usr/local/include -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -fpic -O3 -Wall -pipe -pedantic -std=gnu99 -fopenmp -c bcrypt/blowfish.c -o bcrypt/blowfish.o
ar rcs bcrypt/libstatbcrypt.a bcrypt/bcrypt_pbkdf.o bcrypt/blowfish.o
ccache gcc-11 -shared -L/opt/R/4.2.0/lib/R/lib -L/usr/local/lib -o openssl.so 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 -fopenmp -lgomp -L/opt/R/4.2.0/lib/R/lib -lR
installing to /opt/R/4.2.0/lib/R/site-library/00LOCK-openssl/00new/openssl/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘openssl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.2.0/lib/R/site-library/00LOCK-openssl/00new/openssl/libs/openssl.so':
/opt/R/4.2.0/lib/R/site-library/00LOCK-openssl/00new/openssl/libs/openssl.so: undefined symbol: PKCS12_SAFEBAG_free
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/4.2.0/lib/R/site-library/openssl’
The downloaded source packages are in
‘/tmp/RtmpkmVNXm/downloaded_packages’
Warning message:
In install.packages("openssl", verbose = TRUE) :
installation of package ‘openssl’ had non-zero exit status
How did you install R? It is using unusual settings. I suspect there is a conflicting version of libssl in /usr/local/lib
which seems to be hardcoded in your CFLAGS.
Also why are you compiling with ccache gcc-11
? Can you try compiling with just gcc
?
Can you check if there is maybe a second conflicting openssl installation in /usr/local/include/openssl
? The only openssl installation should be under /usr/include/openssl
.
Thank you a lot for the quick reply!
curl -O https://cdn.rstudio.com/r/ubuntu-${OS_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb
sudo gdebi r-${R_VERSION}_1_amd64.deb
ccache
in Makevars. I erased it, but I got the same error. /usr/local/lib
doesn't have any openssl folder inside. The same happens in usr/local/include/openssl
./usr/local/lib
harcoded. But I wasn't able to locate it (as I mentioned). I thought the problem could come from R build and installation process. Thus, I decided to create two new WSL (20.04 and 22.04) and follow the same installation process. I was able to install the openssl R package in 20.04, but it was throwing the issue in 22.04. I noticed 22.04 is using 3.0.2 version rather than the 1.1.1 version in 20.04. I wonder whether the problem could come from openssl building in 22.04 or maybe the R package not being able to cope with 3.0.2 (in Ubuntu 22.04)?What do you mean by "the same happens in usr/local/include/openssl"? Does that folder exist? If it exists you should delete it and try again.
I use ubuntu 22.04 myself and many other systems with openssl 3.0.2 so the problem is definitely in your configuration.
I am sorry that sound vague. I meant inside /usr/local/include/
, the directory is fully empty. Inside /usr/local/lib/
there are two folder, but none related to openssl. Both directories don't contain any openssl folder.
I also checked pkg-config libssl -L -cflags
and I couldn't see any path pointing to /usr/local/lib/
. Could I force R to get the openssl directory I need by using configure.args?
I just downloaded the same R as you did for ubuntu 22.04, but the result is very different. The problem happens in this line in your output:
ccache gcc-11 -shared -L/opt/R/4.2.0/lib/R/lib -L/usr/local/lib -o openssl.so 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 -fopenmp -lgomp -L/opt/R/4.2.0/lib/R/lib -lR
It looks like your linker flags are completely wrong. They show -fopenmp -lgomp
instead of the libssl flags. Are you overriding PKG_LIBS
or LDFLAGS
in your local config?
On my own ubuntu 22.04 machine I see this
gcc -shared -L/opt/R/4.2.0/lib/R/lib -L/usr/local/lib -o openssl.so 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 -Lbcrypt -lstatbcrypt -l:libssl.so.3 -l:libcrypto.so.3 -L/opt/R/4.2.0/lib/R/lib -lR
@alazarolop has your problem been solved? Can you check if your settings are overriding PKG_LIBS
or LDFLAGS
or similar?
Hi and sorry for the late response,
I tried to follow yours comments, but I couldn't figure out where the overriding was happening.
Recently, I've tried again after upgrading all the packages (openssl included) and it worked out-of-the-box in a vanilla installation (no config changes in WSL Ubuntu 22.04), so I guess the SO package was involved in the error. I guess the ticket can be now closed. Thank you a lot for your support.
Hi,
I am unable to build the openssl R package on WSL Ubuntu 22.04 using R downloaded from RStudio site:
I have installed and reinstalled openssl OS packages:
When building the R package I get the following error:
How could I fix it? Thanks