2

I am trying hard to make julia work through R but i am not being successful. I followed the instructions from here, here and here with no success. I added Julia to the path and installed and tested in Julia both RCall and JSON packages. I don't know what else to do T_T!

With JuliaCall i get the following error:

> julia <- julia_setup()
Julia version 0.7.0 at location C:\Users\ModellT\AppData\Local\JULIA_~1\bin will be used.
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  character argument expected

With XRJulia:

> findJulia()
[1] "C:\\Users\\ModellT\\AppData\\Local\\Julia_0_7\\bin\\julia.exe"
> findJulia(test = T)
[1] FALSE

My R and Julia version:

R.version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.1
year 2018
month 07
day 02
svn rev 74947
language R
version.string R version 3.5.1 (2018-07-02) nickname Feather Spray

julia> VERSION v"0.7.0"

Gerald T
  • 704
  • 3
  • 18

2 Answers2

3

JuliaCall has just finished upgrading for Julia 0.7 and Julia 1.0. The development version of JuliaCall should be able to support Julia 0.7 with the latest released version of RCall and should be able to support Julia 1.0 with the github master of RCall.

Note that the latest master of JuliaCall also contains a fix for segfault on Windows, which is also confirmed by a Windows user. Related discussions are at https://github.com/Non-Contradiction/JuliaCall/issues/63.

Update: The github master of RCall is already released. So there should be no problem in using JuliaCall with Julia 1.0.

Consistency
  • 2,884
  • 15
  • 23
0

The basic answer is that newer versions than Julia 0.6.4 don't work with JuliaCall and XRJulia packages. They worked on my system after installing Julia 0.6.4.

Following Consistency request:

NOTE: I run this test with both Julia 0.7 and Julia 1.0

Julia 1.0___________________________________________________________________________

trace(dyn.load, quote(print(x)))
julia_setup()

Julia version 1.0.0 at location C:\PROGRA~1\Julia\JULIA-~1.0\bin will be used. 

Tracing dyn.load(libm, DLLpath = .julia$bin_dir) on entry 
[1] "ERROR: UndefVarError: Libdl not defined" "Stacktrace:"           
[3] " [1] top-level scope at none:0"          
attr(,"status") 
[1] 1
Error in inDL(x, as.logical(local), as.logical(now), ...) :   
  character argument expected 
In addition: Warning message: 
In system2(file.path(.julia$bin_dir, "julia"), shQuote(command),  :  
running command '"C:\PROGRA~1\Julia\JULIA-~1.0\bin/julia" "-e" "print(Libdl.dlpath(Base.libm_name))"' had status 1

RCall doesn't seem to work on Julia 1.0.0

(v1.0) pkg> build RCall
  Building Conda ───────────→ `C:\Users\VideoLab\.julia\packages\Conda\m7vem\deps\build.log`
  Building CodecZlib ───────→ `C:\Users\VideoLab\.julia\packages\CodecZlib\wwgbh\deps\build.log`
  Building SpecialFunctions → `C:\Users\VideoLab\.julia\packages\SpecialFunctions\KvXoO\deps\build.log`
  Building RCall ───────────→ `C:\Users\VideoLab\.julia\packages\RCall\OBHAc\deps\build.log`
┌ Error: Error building `RCall`:
│ ERROR: LoadError: syntax: try without catch or finally
│ Stacktrace:
│  [1] include at .\boot.jl:317 [inlined]
│  [2] include_relative(::Module, ::String) at .\loading.jl:1038
│  [3] include(::Module, ::String) at .\sysimg.jl:29
│  [4] include(::String) at .\client.jl:388
│  [5] top-level scope at none:0
│ in expression starting at C:\Users\VideoLab\.julia\packages\RCall\OBHAc\deps\build.jl:24
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Pkg\src\Operations.jl:1068

Julia 0.7___________________________________________________________________________

> trace(dyn.load, quote(print(x)))
Tracing function "dyn.load" in package "base"
[1] "dyn.load"
> julia_setup()
Julia version 0.7.0 at location C:\PROGRA~1\Julia\JULIA-~1.0\bin will be used.
Tracing dyn.load(libm, DLLpath = .julia$bin_dir) on entry 
[1] "WARNING: C:\\PROGRA~1\\Julia\\JULIA-~1.0\\bin\\libopenlibm.DLLBase.Libdl is deprecated, run `using Libdl` instead"
[2] " in module Main"                                                                                                  
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  character argument 

RCall works with Julia 0.7 but it gives some warning messages when installing in Julia

julia> Pkg.build("RCall")
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
 in module Main
  Building CodecZlib → `C:\Users\VideoLab\.julia\packages\CodecZlib\wwgbh\deps\build.log`
  Building Conda ────→ `C:\Users\VideoLab\.julia\packages\Conda\m7vem\deps\build.log`
  Building RCall ────→ `C:\Users\VideoLab\.julia\packages\RCall\KPBrH\deps\build.log`

julia> import RCall
[ Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
┌ Warning: `using A.B` will only be allowed for modules, not single bindings. Use `using A: B` instead
│   caller = ip:0x0
└ @ Core :-1
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(AbstractArray{T, 1}) where {T} in module AxisArrays at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:43 overwritten at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:47.
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(AbstractArray{T, 1}) where {T} in module AxisArrays at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:43 overwritten at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:47.
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(A<:AbstractArray{T, 1}) where {T, A<:AbstractArray{T, 1}} in module AxisArrays at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:47 overwritten at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:43.
WARNING: Method definition (::Type{AxisArrays.CategoricalVector{T, A} where A<:AbstractArray{T, 1} where T})(AbstractArray{T, 1}) where {T} in module AxisArrays at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:43 overwritten at C:\Users\VideoLab\.julia\packages\AxisArrays\uZ7JS\src\categoricalvector.jl:47.
Error: package or namespace load failed for 'stats' in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'C:/Program Files/R/R-3.5.1/library/stats/libs/x64/stats.dll':
  LoadLibrary failure:  The network path was not found.

During startup - Warning message:
package 'stats' in options("defaultPackages") was not found

Julia 0.7 devtools::install_github("Non-Contradiction/JuliaCall") _________________________

enter image description here

Gerald T
  • 704
  • 3
  • 18
  • Hi, I'm the maintainer of `JuliaCall`. `JuliaCall` should be able to support `Julia 0.7`. I had received a similar issue report here and I'm working to solve it. But it's still unclear to me what had happened, because I don't have windows at hand. Would you follow the last post in the linked issue and try to print out more information by using `trace(dyn.load, quote(print(x)))` before `julia_setup()`? – Consistency Aug 14 '18 at 13:38
  • @Consistency I run the test you asked on both `Julia 1.0` and `Julia 0.7` – Gerald T Aug 14 '18 at 16:28
  • Thanks! The JuliaCall master seems to fix the problem, but I'm not sure. Could you try to install JuliaCall from github using `devtools`? – Consistency Aug 14 '18 at 16:29
  • Yes, `RCall` doesn't support `Julia 1.0` yet. But the maintainer is working on it at the moment. And if RCall works, then I need to test `JuliaCall` on the `Julia 1.0`. If everything goes right, then there will be a fix in a few days. – Consistency Aug 14 '18 at 16:33
  • @Consistency I get the same message with the **development version**: `Julia version 0.7.0 at location C:\PROGRA~1\Julia\JULIA-~1.0\bin will be used. Tracing dyn.load(libm, DLLpath = .julia$bin_dir) on entry [1] "WARNING: C:\\PROGRA~1\\Julia\\JULIA-~1.0\\bin\\libopenlibm.DLLBase.Libdl is deprecated, run using Libdl instead" [2] " in module Main" Error in inDL(x, as.logical(local), as.logical(now), ...) : character argument expected` – Gerald T Aug 14 '18 at 16:47
  • Okay. I just found that my previous fix working for julia 1.0 but not 0.7... The newest fix should work for julia 0.7. Could you give it a try? – Consistency Aug 14 '18 at 17:00
  • @Consistency It makes r session abort. Check edited answer. – Gerald T Aug 14 '18 at 17:15
  • I have no idea what is going on, but at least the library path is correct. Maybe we could try to do `dyn.load("the dll location of libm")` in R directly. The dll location can be obtained in julia by `try using Libdl; catch; end; print(Libdl.dlpath(Base.libm_name))`. – Consistency Aug 14 '18 at 17:21