0

I'm trying to install OpenSSL in R via

install.packages("openssl")

It's a clean install of R via brew so not sure what's wrong. Here are the last ~20 logs

> o compatibility.o diffie.o envelope.o error.o hash.o info.o keygen.o
> keys.o onload.o openssh.o password.o pem.o pkcs12.o pkcs7.o rand.o
> rsa.o signing.o ssl.o stream.o write.o
> -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/openssl/lib -lssl -lcrypto -F/usr/local/Cellar/r/3.3.2/R.framework/.. -framework R -lintl -Wl,-framework -Wl,CoreFoundation installing to /usr/local/lib/R/3.3/site-library/openssl/libs
> ** R
> ** inst
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) :   unable to load shared object
> '/usr/local/lib/R/3.3/site-library/openssl/libs/openssl.so':  
> dlopen(/usr/local/lib/R/3.3/site-library/openssl/libs/openssl.so, 6):
> Symbol not found: _DSA_get0_key   Referenced from:
> /usr/local/lib/R/3.3/site-library/openssl/libs/openssl.so   Expected
> in: flat namespace  in
> /usr/local/lib/R/3.3/site-library/openssl/libs/openssl.so Error:
> loading failed Execution halted ERROR: loading failed
> * removing ‘/usr/local/lib/R/3.3/site-library/openssl’
> 
> The downloaded source packages are in
>   ‘/private/var/folders/8n/47bzk9810mq31790qbb38zg80000gn/T/Rtmpe7etrQ/downloaded_packages’
> Warning message: In install.packages("openssl") :   installation of
> package ‘openssl’ had non-zero exit status
jww
  • 97,681
  • 90
  • 411
  • 885
Geoff Lee
  • 144
  • 6
  • [Problem installing R packages that depends from OpenSSL library in rocker/rstudio](https://github.com/rocker-org/rocker/issues/124). It looks like you need to install the OpenSSL development headers. Take it for what its worth. I'm not an R or Brew person. – jww Jan 27 '17 at 00:26
  • If it is Brew related, then see see [Brew refusing to link openssl](http://stackoverflow.com/q/38670295), [Update OpenSSL on OS X with Homebrew](http://stackoverflow.com/q/15185661), [How to install latest version of openssl Mac OS X El Capitan](http://stackoverflow.com/q/35129977), [How to upgrade OpenSSL in OS X?](http://apple.stackexchange.com/q/126830), [Openssl installation using HomeBrew fails](http://superuser.com/q/486389), etc. – jww Jan 27 '17 at 00:36

2 Answers2

0

Just lucky I guess but randomly solved it. I uninstalled openssl from brew, which may require you to do this:

brew uninstall --ignore-dependencies openssl

If you run it without the --ignore-dependencies, then it will list the packages that depend on it, if any. Then go back to R and install openssl and it works (at least for me). You can then install openssl from brew for brew packages if they stop working. I had no trouble using R with it (so far)

brew install openssl
Geoff Lee
  • 144
  • 6
0

I got the same error to you and after trying to uninstall and reinstall, etc. without error, I finally succeeded with changing the lib to my local lib install of using default:

/Users/username/Library/R/3.6/library

By default, R install packages into /usr/local/lib/R/3.6/site-library. Let's try with

install.packages("openssl", lib = "/Users/username/Library/R/3.6/library")

You can run .libPaths() for checking your library paths

Tuan Chau
  • 1,243
  • 1
  • 16
  • 30