jeroen / openssl

OpenSSL bindings for R
Other
64 stars 22 forks source link

installation of package ‘openssl’ had non-zero exit status #71

Closed atanasj closed 5 years ago

atanasj commented 5 years ago

When trying to install openssl I get the following:

> install.packages("openssl")
trying URL 'https://cran.rstudio.com/src/contrib/openssl_1.4.tar.gz'
Content type 'application/x-gzip' length 1202838 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Wed 12 Jun 2019 21:55:41 AEST: Auto-brewing openssl@1.1 in /var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1...
==> Tapping homebrew/core
Tapped 2 commands and 4796 formulae (5,052 files, 12.5MB).
==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1c.mojave.bottle.tar.gz
Already downloaded: /var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/downloads/c93cb0fc92a48609683c002e358bde5de769acd7a94d15e6159d680b7f93a8c8--openssl@1.1-1.1.1c.mojave.bottle.tar.gz
==> Pouring openssl@1.1-1.1.1c.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/etc/openssl@1.1/certs

and run
  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/include"

==> Summary
🍺  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/Cellar/openssl@1.1/1.1.1c: 7,963 files, 17.9MB
Using PKG_CFLAGS=-I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/include -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/include
Using PKG_LIBS=-L/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/lib -L/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/lib -lssl -lcrypto
** 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
clang -I"/usr/local/Cellar/r/3.6.0_2/lib/R/include" -DNDEBUG -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/include -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/include  -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -isysroot / -fPIC  -g -O2  -c aes.c -o aes.o
In file included from aes.c:1:
/usr/local/Cellar/r/3.6.0_2/lib/R/include/Rinternals.h:39:11: fatal error: 'stdio.h' file not found
# include <stdio.h>
          ^~~~~~~~~
1 error generated.
make: *** [aes.o] Error 1
ERROR: compilation failed for package ‘openssl’
* removing ‘/usr/local/Cellar/r/3.6.0_2/lib/R/library/openssl’
* restoring previous ‘/usr/local/Cellar/r/3.6.0_2/lib/R/library/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/RtmpHg9nvu/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

Please see below of relevant system info:

ProductName:    Mac OS X
ProductVersion: 10.14.5
BuildVersion:   18F132
R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
OpenSSL 1.0.2s  28 May 2019

I have tried addingopenssl via homebrew, add to path and exported as recommended. Then I followed the same procedure with the openssl@1.1 that comes up when running install.packates("openssl"), however it still fails.

Am I doing something wrong? Please let me know if you need more info. Cheers.

jeroen commented 5 years ago

🤔 so you are using the homebrew version of R, but brew is not on your PATH?

Are you aware that this is not the official version of R for Mac? If you use the official version of R, all packages will be precompiled.

Can you also try this:

Sys.setenv(PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig")
install.packages("openssl")
atanasj commented 5 years ago

Hi, sorry for tardy reply. I'm pretty sure brew is in my PATH. I am using the brew version of r with open-blas.

I have tried what you recommended, however still get an error:

> install.packages("openssl")
trying URL 'https://cran.rstudio.com/src/contrib/openssl_1.4.tar.gz'
Content type 'application/x-gzip' length 1202838 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Fri  5 Jul 2019 13:31:19 AEST: Auto-brewing openssl@1.1 in /var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1...
==> Tapping homebrew/core
Tapped 2 commands and 4809 formulae (5,064 files, 12.5MB).
==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1c.mojave.bottle.tar.gz
Already downloaded: /var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/downloads/c93cb0fc92a48609683c002e358bde5de769acd7a94d15e6159d680b7f93a8c8--openssl@1.1-1.1.1c.mojave.bottle.tar.gz
==> Pouring openssl@1.1-1.1.1c.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/etc/openssl@1.1/certs

and run
  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/opt/openssl@1.1/include"

==> Summary
🍺  /private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/build-openssl@1.1/Cellar/openssl@1.1/1.1.1c: 7,963 files, 17.9MB
Using PKG_CFLAGS=-I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/include -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/include
Using PKG_LIBS=-L/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/lib -L/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/lib -lssl -lcrypto
** 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
clang -I"/usr/local/Cellar/r/3.6.0_2/lib/R/include" -DNDEBUG -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl@1.1/include -I/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T//build-openssl@1.1/opt/openssl/include  -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -isysroot / -fPIC  -g -O2  -c aes.c -o aes.o
In file included from aes.c:1:
/usr/local/Cellar/r/3.6.0_2/lib/R/include/Rinternals.h:39:11: fatal error: 'stdio.h' file not found
# include <stdio.h>
          ^~~~~~~~~
1 error generated.
make: *** [aes.o] Error 1
ERROR: compilation failed for package ‘openssl’
* removing ‘/usr/local/Cellar/r/3.6.0_2/lib/R/library/openssl’
* restoring previous ‘/usr/local/Cellar/r/3.6.0_2/lib/R/library/openssl’
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/77/7ht3td2j1vb00csyp1l4wlv40000gn/T/Rtmpt4Q6Cr/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

Any thoughts?

atanasj commented 5 years ago

Hi, this is closed as I reinstalled via cran. Thanks for your help.