You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As indicated when raising issue #504, on my linux machine (Ubuntu 14.04.4 LTS), I compile R from source, and install both a 32 bit version and a 64 bit version; both as subarchitectures. To my surprise, I noticed that I cannot run stan() from the rstan package on my machine when I use RStudio.
Description:
The work-around to issue #504 that I am currently using is to create a symbolic link in R_HOMElibrary/StanHeaders/libs/64/libStanHeaders.a to library/StanHeaders/libs/libStanHeaders.a. stan() works if R is started from the console, but not if it is started from RStudio. The error message I get is:
Error in get_makefile_txt() :
file /opt/R/R-3.4.3/lib/R/etc//Makeconf does not exist
Problem:
The error seems to be produced by lines 28-34 in the function get_makefile_txt() in rstan/R/makefile_op.R:
WINDOWS <- .Platform$OS.type == "windows"
rarch <- Sys.getenv("R_ARCH") # unix only
if (WINDOWS && nzchar(.Platform$r_arch))
rarch <- paste0("/", .Platform$r_arch)
site <- file.path(R.home("etc"), rarch, "Makevars.site")
sys_makeconf <- file.path(R.home("etc"), rarch, "Makeconf")
On my Linux machine, if I start R from the console, I get the following result:
> Sys.getenv("R_ARCH")
[1] "/64"
When I start R via RStudio, I get:
> Sys.getenv("R_ARCH")
[1] ""
By way of contrast, on a Windows machine, whether I start R directly or via RStudio, I always get:
> Sys.getenv("R_ARCH")
[1] "/x64"
Proposed Solution:
Looking at makeconf_path() in rstan/R/misc.R (lines 1377-1388), a solution might be to replace the above lines with:
WINDOWS <- .Platform$OS.type == "windows"
rarch <- .Platform$r_arch
if (rarch = ''){
site <- file.path(R.home("etc"), "Makevars.site")
sys_makeconf <- file.path(R.home("etc"), "Makeconf")
}else{
site <- file.path(R.home("etc"), rarch, "Makevars.site")
sys_makeconf <- file.path(R.home("etc"), rarch, "Makeconf")
}
Not sure if the if() construct is needed as R does not seem to have problems with paths created by file.path() that contain // (in my limited experience).
I am not sure whether the logic of last_makefile() in rstan/R/makefile_op.R (lines 99-114) also needs revisiting.
RStan Version:
2.17.3
R Version:
R version 3.4.3 (2017-11-30)
> RStudio.Version()$version
[1] ‘1.1.423’
Operating System:
$ uname -a
Linux ECM-DTC-716 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
The text was updated successfully, but these errors were encountered:
G'day Ben (?),
apologies if you receive this twice, on my first attempt I hit the
reply-all button. Perhaps I am supposed to hit reply only (my usual
default)?
On Wed, 13 Jun 2018 14:33:21 -0700 bgoodri ***@***.***> wrote:
Does this function work on your machine(s)?
It seems it does, when I start rstudio on my machine:
Summary:
As indicated when raising issue #504, on my linux machine (Ubuntu 14.04.4 LTS), I compile R from source, and install both a 32 bit version and a 64 bit version; both as subarchitectures. To my surprise, I noticed that I cannot run
stan()
from therstan
package on my machine when I useRStudio
.Description:
The work-around to issue #504 that I am currently using is to create a symbolic link in
R_HOME
library/StanHeaders/libs/64/libStanHeaders.a
tolibrary/StanHeaders/libs/libStanHeaders.a
.stan()
works ifR
is started from the console, but not if it is started fromRStudio
. The error message I get is:Problem:
The error seems to be produced by lines 28-34 in the function
get_makefile_txt()
inrstan/R/makefile_op.R
:On my Linux machine, if I start
R
from the console, I get the following result:When I start
R
viaRStudio
, I get:By way of contrast, on a Windows machine, whether I start
R
directly or via RStudio, I always get:Proposed Solution:
Looking at
makeconf_path()
inrstan/R/misc.R
(lines 1377-1388), a solution might be to replace the above lines with:Not sure if the
if()
construct is needed asR
does not seem to have problems with paths created byfile.path()
that contain//
(in my limited experience).I am not sure whether the logic of
last_makefile()
inrstan/R/makefile_op.R
(lines 99-114) also needs revisiting.RStan Version:
2.17.3
R Version:
R version 3.4.3 (2017-11-30)
Operating System:
The text was updated successfully, but these errors were encountered: