rwinlib / rtools35

Scripts for building the rtools installer bundle
15 stars 3 forks source link

make: /bin/sh: Command not found #11

Closed sjmgarnier closed 5 years ago

sjmgarnier commented 5 years ago

Environment

Windows 10 R 3.5.3 RTools 3.5 Cmake 3.14 PATH: C:\Rtools\bin; C:\Program Files\CMake\bin; %SystemRoot%\system32;%SystemRoot%; %SystemRoot%\System32\Wbem; %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

makeconf::rtools_info()

[[1]]
[[1]]$rtools
[1] ‘3.5’

[[1]]$compiler
[1] "gcc 4.9.3"

[[1]]$api
[1] ‘4.9’

[[1]]$PATH
[1] "C:\\Rtools\\bin"

[[1]]$BINPREF
[1] "C:/Rtools/mingw_$(WIN)/bin/"

[[1]]$available
[1] TRUE

[[1]]$compatible
[1] TRUE

Command to reproduce the error

remotes::install_github("swarm-lab/ROpenCVLite")

Error message

The C++ compiler

    "C:/Rtools/mingw_64/bin/g++.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/Users/SimonGarnier/Documents/GitHub/ROpenCVLite/src/opencv-4.0.1/build64/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/Rtools/bin/make.exe cmTC_92b6f/fast 
    /Rtools/bin/make -f CMakeFiles/cmTC_92b6f.dir/build.make CMakeFiles/cmTC_92b6f.dir/build
    make: /bin/sh: Command not found
    make: *** [Makefile:121: cmTC_92b6f/fast] Error 127
sjmgarnier commented 5 years ago

Note that I do not have this issue with the same setup and Rtools 3.4.

jeroen commented 5 years ago

Which make do you use? Can you show makeconf::make_info() ? Is sh on the PATH? What does sys.which('sh') give?

sjmgarnier commented 5 years ago

See below. This was on a fresh install of Windows 10, R, Rtools and RStudio. There shouldn't be any weird third party libraries laying around.

> make_info()
$name
[1] "make"

$available
[1] TRUE

$path
[1] "C:\\Rtools\\bin\\make.exe"

$version
[1] "GNU Make 4.2.1"

$makeconf
[1] "C:\\PROGRA~1\\R\\R-35~1.3\\etc\\x64\\Makeconf"

> Sys.which("sh")
                       sh 
"C:\\Rtools\\bin\\sh.exe" 
JBlefebvre commented 5 years ago

Hi, I had this problem too using Rtools 3.5. When I changed for Rtools3.4, it functionned correctly and I could download ROpenCVlite correctly! Have a good day

jeroen commented 5 years ago

Hmm I really don't know 😞 We did upgrade make in rtools 3.5 (the rtools 3.4 version was over 15 years old) but it is just a standard version from msys2.

I don't know what the problem is with the ROpenCVLite configure script. Perhaps an interaction with cmake (which you use in configure.win but is not included with rtools)

sjmgarnier commented 5 years ago

I was afraid you were going to say that. It is definitely linked to cmake somehow, but since the error reported is that make could not find bin/sh, I was hoping something was wrong in RTools 3.5 (since it works fine with 3.4). I'll keep digging and let you know if I find anything.

muschellij2 commented 5 years ago

I've found the command may help:

    -DCMAKE_SH:BOOL=OFF 
sjmgarnier commented 5 years ago

@muschellij2 It didn't :-( Same error message.

sjmgarnier commented 5 years ago

I figured it out. Until Rtools 3.4, it looks like using the make binary in C:/Rtools/bin worked fine. Since Rtools 3.5, using it throws that error, but using the mingw32-make binary in C:/Rtools/mingw_XX/bin seems to do the trick.