jeroen / openssl

OpenSSL bindings for R
Other
65 stars 23 forks source link

Installing on OS X #12

Closed zaprice closed 8 years ago

zaprice commented 9 years ago

When installing the package on a machine where the OpenSSL dev libraries aren't in the expected place, you have to disable the configure script to install correctly. Ex. on OS X, I had to run:

R CMD INSTALL --configure-args="INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2d_1/include LIB_DIR=/usr/local/Cellar/openssl/1.0.2d_1/lib" --no-configure ~/Downloads/openssl_0.4.tar.gz

This took a while to troubleshoot so I figured it was worth noting here. May be useful to add it to the README.

jeroen commented 9 years ago

Is this the version from CRAN or github? What do you get if you just try:

devtools::install_github("jeroenooms/openssl")

OSX includes a copy of openssl (without brew) so it should always work.

jeroen commented 9 years ago

You could also set the PKG_CONFIG_PATH var. This works for me:

Sys.setenv(PKG_CONFIG_PATH = "/usr/local/Cellar/openssl/1.0.2d_1/lib/pkgconfig/")
devtools::install_github("jeroenooms/openssl")
zaprice commented 9 years ago

It is the CRAN version. I unlinked the homebrew OpenSSL package and tried it again. The CRAN version doesn't install, but the Github version does.

Running install.packages("openssl") gives:

File /usr/include/openssl/rand.h not found. Make sure the OpenSSL development library is installed, e.g. libssl-dev (deb) or openssl-devel (rpm).
ERROR: configuration failed for package ‘openssl’

I also tried setting PKG_CONFIG_PATH as above and it didn't change anything.

jeroen commented 8 years ago

The latest version of the configure script should automatically find the homebrew version of openssl from /usr/local/opt/openssl and verify that the version is correct (ie. at least 1.0.0)