Closed datasurfergtx closed 4 years ago
MacOS doesn't have libssl installed by default.
I recently went through this. I installed openssl with homebrew and I created ~/.R/Makevars
(not a great practice, but I was just trying to get stuff working)
CPPFLAGS=-I/usr/local/opt/openssl/include
PKG_LIBS=-lssl -lcrypto -ldl -L/usr/local/opt/openssl/lib
I can't remember if I had to do anything else.
@s-u I believe configure script has some difficulties identifying openssl on Catalina, so PKG_LIBS
is not generated properly. I remember that I haven't had any issues on Mojave (just had LDFLAGS += -L/usr/local/opt/openssl/lib
in my ~/.R/Makevars
).
Also seems setting PKG_LIBS
in ~/.R/Makevars
is not a good option since it should be set in a pkg.
PS configure
from openssl pkg successfully detects OpenSSL installation
@dselivanov It is generated properly if you have working libssl
. Catalina has removed OpenSSL from the system and also all dev files. I would not recommend using Homebrew, mixing HB with native libraries creates a very explosive mix that usually breaks. You can use the system LibreSSL, but you have to use full paths in LIBS
because Apple is now disabling search in system /usr/lib
and the SDK doesn't include it (c.f. the setup in PKI).
Note that the correct way is to use use either CPPFLAGS
/LIBS
or PKG_CPPFLAGS
/PKG_LIBS
with R CMD INSTALL
. Do not modify Makevars
- that is a really bad idea as it affects compilations of all code in R and causes a lot of issues when your forget to remove it after updates etc.
All in all, the user has to decide what to do on Catalina - I would recommend using static openssl build since that won't conflict with anything (NB that's what nginx does). The other alternative is to get the headers from Apple and use full paths in LIBS
which then uses the system libraries.
BTW: openssl package doesn't use the system library, it will download and install a private copy - I find its approach very controversial since it does a lot of things you may not even know - and it will link against a homebrew installation which I don' find safe for reasons explained above. If you use homebrew, you should use R from homebrew and no special setup is needed, but you cannot use CRAN packages.
@s-u Thanks for the suggestions, I've successfully linked to a static openssl (just downloaded 1.1.1 and followed instructions ).
Do not modify Makevars - that is a really bad idea as it affects compilations of all code in R and causes a lot of issues when your forget to remove it after updates etc.
that's understandable...
All in all, the user has to decide what to do on Catalina
Regretting a lot after upgrade =(
I am trying to get a newer version of RServe installed, as the CRAN version has the long vectors bug (known issue). When I attempt to install the new version (either on Rforge or locally) I get the same error
ld: library not found for -lssl
Here's the error log I have:
I am using gcc 9.0.2 that I downloaded using homebrew. It seems like there is some interference with XCode but I'm not too sure how to troubleshoot this.