On Saturday, May 9, 2015 at 1:11:22 AM UTC+10, Simon Byrne wrote: > > FWIW, the relevant R Docs are here: > > > http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Calling-R_002edll-directly > > > Unfortunately, they're not very helpful, just saying: > > > You may need to ensure that R_HOME/bin is in your PATH so the R DLLs are > found. > > But I can't figure out why the julia process PATH wouldn't carry over > to the R one. >
Your problem may not be the dll itself, it could be one of its dependencies. Also the windows dll search path is kind of complex (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx) and PATH is only included in some of the cases. > > > > On 8 May 2015 at 15:32, Simon Byrne <[email protected] <javascript:>> > wrote: > > I tried it (adding both the extra PATH path, and the path of the > > library it couldn't find), but that didn't seem to help either. > > > > > > On 8 May 2015 at 15:17, Isaiah Norton <[email protected] <javascript:>> > wrote: > >> I'm also a bit surprised that it doesn't work. You could try calling > >> AddDllDirectory first: > >> > >> > https://msdn.microsoft.com/en-us/library/windows/desktop/hh310513(v=vs.85).aspx > > >> > >> On Fri, May 8, 2015 at 10:12 AM, Simon Byrne <[email protected] > <javascript:>> wrote: > >>> > >>> As a follow up, here's some code (which requires that R be installed): > >>> > >>> ENV["PATH"] = ENV["PATH"]*";C:\\Program Files\\R\\R-3.2.0\\bin\\x64\\" > >>> const libR = "C:\\Program Files\\R\\R-3.2.0\\bin\\x64\\R.dll" > >>> argv = ["REmbed"] > >>> > >>> > println(ccall((:Rf_initEmbeddedR,libR),Cint,(Cint,Ptr{Ptr{Uint8}}),length(argv),argv)) > > > >>> > >>> > >>> If I run this as a script, I get an error message (unable to load > shared > >>> library). However if I first set > >>> > >>> PATH=PATH;C:\Program Files\R\R-3.2.0\bin\x64 > >>> > >>> then run the script (from within the same command prompt session), the > >>> error goes away. > >>> > >>> Any ideas? > >>> > >>> Simon > >>> > >>> > >>> On Friday, 8 May 2015 09:55:29 UTC+1, Simon Byrne wrote: > >>>> > >>>> I'm trying to understand how ENV works (at least on Windows): > >>>> > >>>> I'm trying to ccall a library that requires a particular addition to > >>>> "PATH". If I do this externally (through the Windows menus) it works > okay, > >>>> but not via ENV["PATH"]. I assume that this means that ENV only > changes the > >>>> local process? If so, is there anyway I can modify the system > variable from > >>>> within Julia? > >>>> > >>>> -Simon > >> > >> >
