Could one of the RStan devs verify? Is there a workaround in place?
The problem the user had who came to our office yesterday was primarily
with dependencies=TRUE. I don't know enough about RStan installs to do much more
than guess.
- Bob
P.S. Here's what Alexandre originally sent:
Hello,
I have been using RStan for nearly a month now and today I tried to use the command "stan_model" and it didn't work, even on the simple example:
stan_model(model_code = 'parameters {real y;} model {y ~ normal(0,1);}')
Therefore I decided to re-install RStan and this is when all my problems started. Here is the way I did it and the messages I got:
.libPaths()
[1] "C:/Users/MOESCHIA/Programs/R/R-3.2.2/library"
Which is correct.
Sys.getenv("PATH")
[1] "C:\Users\MOESCHIA\Programs\R\R-3.2.2\bin\x64;C:\Users\MOESCHIA\Programs\Rtools\bin;C:\Users\MOESCHIA\Programs\Rtools\gcc-4.6.3\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files\Java\jre6\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\texlive\2015\bin\win32;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Program Files (x86)\WinSCP\;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Users\MOESCHIA\Dropbox\Stage\R\RStan\Tests\ C:\Users\MOESCHIA\Programs\Putty"
Which agrees with what is written on the RStan Getting Started guide. Same for:
system('where make')
C:\Users\MOESCHIA\Programs\Rtools\bin\make.exe
Sys.getenv("HOME")
[1] "C:"
Is correct.
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M)) file.create(M)
cat("\nCXXFLAGS=-O3", file = M, sep = "\n", append = TRUE)
This correctly created the file in C:/.R
Sys.setenv(MAKEFLAGS = "-j4")
install.packages("rstan", dependencies = TRUE)
trying URL '
https://cran.rstudio.com/bin/windows/contrib/3.2/rstan_2.7.0-1.zip'
Content type 'application/zip' length 3394676 bytes (3.2 MB)
downloaded 3.2 MB
package ‘rstan’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\MOESCHIA\AppData\Local\Temp\RtmpWG4l1q\downloaded_packages
Everything is ok too.
library(rstan)
Le chargement a nécessité le package : Rcpp
Le chargement a nécessité le package : inline
Attachement du package : ‘inline’
The following object is masked from ‘package:Rcpp’:
registerPlugin
rstan (Version 2.7.0-1, packaged: 2015-07-17 18:12:01 UTC, GitRev: 05c3d0058b6a)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
Then I tried to run the example in the RStan Getting Started guide.
setwd("C:/Users/MOESCHIA/Dropbox/Stage/R/RStan/Tests") # 8schools.stan was correctly copied!
schools_dat <- list(J = 8,
y = c(28, 8, -3, 7, -1, 1, 18, 12),
sigma = c(15, 10, 16, 11, 9, 11, 10, 18))
fit <- pstan(file = '8schools.stan', data = schools_dat, iter = 1000, chains = 4)
Which prints the long error message:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/MOESCHIA/Programs/R/R-3.2.2/library/rstan/include/rstan/stan_fit.hpp:80:0,
from C:/Users/MOESCHIA/Programs/R/R-3.2.2/library/rstan/include/rstan/rstaninc.hpp:3,
from file268863157f1d.cpp:444:
C:/Users/MOESCHIA/Programs/R/R-3.2.2/library/rstan/include/rstan/io/rlist_ref_var_context_factory.hpp:4:63: fatal error: stan/interface/var_context_factory/dump_factory.hpp: No such file or directory
compilation terminated.
make: *** [file268863157f1d.o] Error 1
Warning message:
the execution of the command 'make -f "C:/Users/MOESCHIA/Programs/R/R-32~1.2/etc/x64/Makeconf" -f "C:/Users/MOESCHIA/Programs/R/R-32~1.2/share/make/
winshlib.mk" -f "//RKAMSCOE64/U_moeschia$/My Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file268863157f1d.dll" WIN=64 TCLBIN=64 OBJECTS="file268863157f1d.o"' sent a status 2
In addition: Warning message:
running command 'C:/Users/MOESCHIA/Programs/R/R-32~1.2/bin/x64/R CMD SHLIB file268863157f1d.cpp 2> file268863157f1d.cpp.err.txt' had status 1
I think there is a possibility that the problem comes from this part:
-f "//RKAMSCOE64/U_moeschia$/My Documents/.R/Makevars"
Because this is an external hard-drive and I don't use it. The computer belongs to the firm where I work and this might be related to some admin rights problem. I need to precise that whenever I tried to install something, I did it with right click, execute as administrator.
I don't know if I'm reporting my problem in the good section. If not, can you tell me where I should?
Thanks in advance for your help, I'm running out of solution after reinstalling R.
AND THEN:
I also tried the installation on my personal computer. I get the same final error:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Program Files/R/R-3.2.2/library/rstan/include/rstan/stan_fit.hpp:80:0,
from C:/Program Files/R/R-3.2.2/library/rstan/include/rstan/rstaninc.hpp:3,
from file1474331f1f.cpp:444:
C:/Program Files/R/R-3.2.2/library/rstan/include/rstan/io/rlist_ref_var_context_factory.hpp:4:63: fatal error: stan/interface/var_context_factory/dump_factory.hpp: No such file or directory
compilation terminated.
make: *** [file1474331f1f.o] Error 1
Warning message:
l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/
winshlib.mk" -f "D:/Users/P1XX3L-HP/Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file1474331f1f.dll" WIN=64 TCLBIN=64 OBJECTS="file1474331f1f.o"' renvoie un statut 2
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-32~1.2/bin/x64/R CMD SHLIB file1474331f1f.cpp 2> file1474331f1f.cpp.err.txt' had status 1
> On Sep 18, 2015, at 2:48 AM, Jonathan Gilligan <
notifi...@github.com> wrote:
>
> CRAN just updated StanHeaders to 2.8.0, but rstan is at 2.7.0-1 That is probably. at the heart of this.
>
> —
> Reply to this email directly or view it on GitHub.
>