MikhailArkhipov / vscode-r

R Tools for VS Code
Other
82 stars 6 forks source link

Unable to find R interpreter in ManjaroLinux/Arch Linux #73

Open gusbemacbe opened 3 years ago

gusbemacbe commented 3 years ago

I am using Manjaro Linux. I applied:

    "r.interpreterPath": "/usr/bin/radian",
    "r.rpath.linux": "/usr/bin/R",
    "r.rterm.linux": "/usr/bin/radian",
    "r.rterm.option": [""],

I havedotnet-host, dotnet-sdk anddotnet-runtime whose version is 5. I have binutils, gcc, gcc-fortran, R and radian installed.

After all this, I received an error:

Unable to start Microsoft.R.Host process. Exception: R host process did not start on the machine. Exception: Unknown error 139
   at Microsoft.R.Host.Client.BrokerServices.WebService.EnsureSuccessStatusCode(HttpResponseMessage response)
   at Microsoft.R.Host.Client.BrokerServices.WebService.GetHttpPutResponseAsync(Uri uri, String requestBody, CancellationToken cancellationToken)
   at Microsoft.R.Host.Client.BrokerServices.WebService.RepeatUntilAuthenticatedAsync[T](Func`2 action, CancellationToken cancellationToken)
   at Microsoft.R.Host.Client.BrokerServices.WebService.HttpPutAsync[TRequest,TResponse](Uri uri, TRequest request, CancellationToken cancellationToken)
   at Microsoft.R.Host.Client.Host.BrokerClient.CreateBrokerSessionAsync(String name, Boolean useRCommandLineArguments, Boolean isInteractive, CancellationToken cancellationToken)

Following the tutorial from #72. I have tested, running the command:

❯ /home/gusbemacbe/.vscode-insiders/extensions/mikhail-arkhipov.r-0.0.25/ls/Host/Linux/Microsoft.R.Host
zsh: segmentation fault (core dumped)

And

❯ ./Microsoft.R.Host --rhost-interactive /usr/share/R
zsh: segmentation fault (core dumped)  ./Microsoft.R.Host --rhost-interactive /usr/share/R
❯ ./Microsoft.R.Host --rhost-interactive /usr/share/R/R
zsh: segmentation fault (core dumped)  ./Microsoft.R.Host --rhost-interactive /usr/share/R/R
❯ ./Microsoft.R.Host --rhost-r-dir /usr/share/R/R
�zsh: segmentation fault (core dumped)  ./Microsoft.R.Host --rhost-r-dir /usr/share/R/R
❯ ./Microsoft.R.Host --rhost-r-dir /usr/share/R
�zsh: segmentation fault (core dumped)  ./Microsoft.R.Host --rhost-r-dir /usr/share/R
MikhailArkhipov commented 3 years ago

Try ./Microsoft.R.Host --help

gusbemacbe commented 3 years ago

It seems OK:

imagem

MikhailArkhipov commented 3 years ago

OK, this part works. "r.interpreterPath": "/usr/bin/radian" appears to be the issue. Interpreter location is where R dynamic library is loaded by the extension. So it needs to be actual R installation OR where the libR.so is in Radian. Basically extension appends lib/libR.so to the interpreter path and then calls dlopen on it. If Radian structure is different, you can use Radian in terminal/console and have stock R installed matching the Radian version.

gusbemacbe commented 3 years ago

I have replaced "r.interpreterPath": "/usr/bin/radian" with "r.interpreterPath": "/usr/lib/R/lib/libR.so", and I received this error:

imagem

gusbemacbe commented 3 years ago

Looking at @wlandau's topic, I tested with:

dotnet Microsoft.R.Host.Broker.dll
: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using '/home/gusbemacbe/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using '/home/gusbemacbe/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Production
Content root path: /home/gusbemacbe/.vscode-insiders/extensions/mikhail-arkhipov.r-0.0.25/ls
Now listening on: http://0.0.0.0:5444
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://0.0.0.0:5444/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://0.0.0.0:5444/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 132.4333ms 404 
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 132.4333ms 404 
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://0.0.0.0:5444/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET http://0.0.0.0:5444/  
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.5004ms 404 
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.5004ms 404
MikhailArkhipov commented 3 years ago

It should be /usr/lib/R or just delete it so extension can auto-pick R.

gusbemacbe commented 3 years ago

It should be /usr/lib/R or just delete it so extension can auto-pick R.

I deleted it and received the error:

imagem

With "r.interpreterPath": "/usr/lib/R", it worked.

MikhailArkhipov commented 3 years ago

OK then. I'll check why /usr/lib/R is not found automatically.

PeetoomHeida commented 3 years ago

I am having a similar problem. I get the same error as up top, and have gone through the steps listed above and have gotten similar outputs. R is installed in /usr/bin/R based on the results below

> which R
/usr/bin/R

Searching through all my files shows that libR.so is in /usr/lib64/R/lib/.

I am on openSUSE Tumbleweed.

What would I do in this case to resolve the issue?