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. On 8 May 2015 at 15:32, Simon Byrne <[email protected]> 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]> 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]> 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 >> >>
