jeroen / openssl

OpenSSL bindings for R
Other
63 stars 20 forks source link

Installing source package on Windows fails with parallel make #62

Closed wch closed 5 years ago

wch commented 5 years ago

On my Windows machine, my ~/.Renviron contains MAKEFLAGS=-j4. When installing the source package, it fails, because it tries compiling package code before the openssl library is downloaded and unzipped. Commenting out MAKEFLAGS=-j4 makes the problem go away.

The same thing happens with install_github().

To fix it, the dependencies should be specified differently. We had the same problem in rstudio/websocket#43, and have a potential fix in rstudio/websocket#44.

> install.packages('openssl', type='source')
Installing package into ‘C:/Users/winst/R/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/openssl_1.2.1.tar.gz'
 length 1198080 bytes (1.1 MB)
downloaded 1.1 MB

* installing *source* package 'openssl' ...
** package 'openssl' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
rm -f openssl.dll 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 pem.o pkcs12.o pkcs7.o rand.o rsa.o signing.o ssl.o stream.o write.o win32/ipv6.o
"C:/PROGRA~1/R/R-35~1.2/bin/i386/Rscript.exe" "../tools/winlibs.R" 1.1.1
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-35~1.2/include" -DNDEBUG -I../windows/openssl-1.1.1/include         -O3 -Wall  -std=gnu99 -mtune=generic -O0 -Wall -c win32/ipv6.c -o win32/ipv6.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-35~1.2/include" -DNDEBUG -I../windows/openssl-1.1.1/include         -O3 -Wall  -std=gnu99 -mtune=generic -O0 -Wall -c aes.c -o aes.o
C:/Rtools/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-35~1.2/include" -DNDEBUG -I../windows/openssl-1.1.1/include         -O3 -Wall  -std=gnu99 -mtune=generic -O0 -Wall -c base64.c -o base64.o
aes.c:4:28: fatal error: openssl/crypto.h: No such file or directory
 #include <openssl/crypto.h>
                            ^
compilation terminated.
base64.c:4:25: fatal error: openssl/bio.h: No such file or directory
 #include <openssl/bio.h>
                         ^
compilation terminated.
make: *** [C:/PROGRA~1/R/R-35~1.2/etc/i386/Makeconf:208: aes.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [C:/PROGRA~1/R/R-35~1.2/etc/i386/Makeconf:208: base64.o] Error 1
ERROR: compilation failed for package 'openssl'
* removing 'C:/Users/winst/R/3.5/openssl'
* restoring previous 'C:/Users/winst/R/3.5/openssl'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘openssl’ had non-zero exit status
gustavo-etal commented 5 years ago

Same heree

jeroen commented 5 years ago

I'm not sure I would recommend using parallel make with the current toolchain (the version of make is about 15 years old) but I'll have a look....