RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

Error with conda install on Windows

Open JackDunnNZ opened this issue 6 years ago • 10 comments

If I try to force the install via conda on Windows like following:

ENV["R_HOME"] = "*"
Pkg.build("RCall")

I get an error, because it tries to call isdir("*") which seems to error on Windows

JackDunnNZ avatar Sep 14 '18 15:09 JackDunnNZ

Please check if 72dc8a1 fixes your issue.

randy3k avatar Sep 14 '18 15:09 randy3k

Thanks for the quick response! That moves the error one step forward to isfile("*") in validate_libR

┌ Error: Error building `RCall`:
│ ERROR: LoadError: IOError: stat: invalid argument (EINVAL)
│ Stacktrace:
│  [1] stat(::String) at .\stat.jl:68
│  [2] isfile at .\stat.jl:303 [inlined]
│  [3] validate_libR(::String, ::Bool) at C:\Users\Jack\.julia\dev\RCall\deps\setup.jl:12
│  [4] locate_libR(::String, ::Bool) at C:\Users\Jack\.julia\dev\RCall\deps\setup.jl:53
│  [5] top-level scope at logging.jl:317
│  [6] top-level scope at C:\Users\Jack\.julia\dev\RCall\deps\build.jl:19
│  [7] include at .\boot.jl:317 [inlined]
│  [8] include_relative(::Module, ::String) at .\loading.jl:1038
│  [9] include(::Module, ::String) at .\sysimg.jl:29
│  [10] include(::String) at .\client.jl:398
│  [11] top-level scope at none:0
│ in expression starting at C:\Users\Jack\.julia\dev\RCall\deps\build.jl:10
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:1068

JackDunnNZ avatar Sep 14 '18 15:09 JackDunnNZ

Try again 2815fa9

randy3k avatar Sep 14 '18 16:09 randy3k

I think I'm hitting a similar error, but on Linux.

julia> ENV["R_HOME"]
"*"

julia> using Pkg

julia> Pkg.build("RCall")
  Building CodecZlib → `~/julia_depot_cossio/packages/CodecZlib/DAjXH/deps/build.log`
  Building Conda ────→ `~/julia_depot_cossio/packages/Conda/uQitS/deps/build.log`
  Building RCall ────→ `~/julia_depot_cossio/packages/RCall/RPlFw/deps/build.log`
┌ Error: Error building `RCall`: 
│ ERROR: LoadError: R_HOME is not a directory.
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] top-level scope at logging.jl:311
│  [3] top-level scope at /home/cossio/julia_depot_cossio/packages/RCall/RPlFw/deps/build.jl:19
│  [4] include at ./boot.jl:317 [inlined]
│  [5] include_relative(::Module, ::String) at ./loading.jl:1044
│  [6] include(::Module, ::String) at ./sysimg.jl:29
│  [7] include(::String) at ./client.jl:392
│  [8] top-level scope at none:0
│ in expression starting at /home/cossio/julia_depot_cossio/packages/RCall/RPlFw/deps/build.jl:10
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097

cossio avatar Dec 11 '18 17:12 cossio

It seems to be getting caught here: https://github.com/JuliaInterop/RCall.jl/blob/b1a8fd73ea3ad6fb777c7ffcf35066bdcbd5612b/deps/build.jl#L31-L33

We should move the check for Rhome == "*" to be above that.

simonbyrne avatar Dec 11 '18 17:12 simonbyrne

@simonbyrne I'm not sure it's the same issue so I separated it.

cossio avatar Dec 11 '18 17:12 cossio

I am also having this problem. It appears that the location of the R executables is not the same on a windows machine. The build script is looking for the binaries in C:\Users\david\.julia\conda\3\Library\bin\R, while the executables are actually in C:\Useres\david.julia\conda\3\Lib\R\bin (and a number of other aliases as well).

haberdashPI avatar May 29 '19 16:05 haberdashPI

The build script is looking for the binaries in C:\Users\david\.julia\conda\3\Library\bin\R, while the executables are actually in C:\Useres\david.julia\conda\3\Lib\R\bin (and a number of other aliases as well).

@stevengj do you know why the Conda-installed R binary wouldn't be in Conda.BINDIR, but in a separate path?

simonbyrne avatar May 30 '19 04:05 simonbyrne

Is it in Conda.SCRIPTDIR, maybe? (Though I thought that was for Python scripts?) On Unix, Conda.SCRIPTDIR == Conda.BINDIR, but on Windows they are different.

But you are looking in joinpath(Conda.LIBDIR, "R") … why not do readchomp(`$(Conda.BINDIR)/R RHOME`) or similar?

stevengj avatar Jun 14 '19 14:06 stevengj

It's in joinpath(Conda.ROOTENV, "Lib", "R")

simonbyrne avatar Jun 14 '19 18:06 simonbyrne