stan-dev / stan-dev/rstan

Error on stan when running 8school example

Open
#747 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

i just installed rstan in R, but it can not work.

i just followed the procedure 'Example 1: Eight Schools' in getting start.

The error is as follow.

library("rstan")
Loading required package: StanHeaders
Loading required package: ggplot2
rstan (Version 2.19.3, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
For improved execution time, we recommend calling
Sys.setenv(LOCAL_CPPFLAGS = '-march=corei7 -mtune=corei7')
although this causes Stan to throw an error on a few processors.
options(mc.cores = parallel::detectCores())
rstan_options(auto_write = TRUE)
Sys.setenv(LOCAL_CPPFLAGS = '-march=corei7')
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 <- stan(file = '8schools.stan', data = schools_dat)
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! sh: C:/Program: No such file or directory
make: *** [C:/PROGRA1/R/R-351.3/etc/x64/Makeconf:215: file2201ad3164e.o] Error 127
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command 'C:/PROGRA1/R/R-351.3/bin/x64/R CMD SHLIB file2201ad3164e.cpp 2> file2201ad3164e.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection

R version 3.5.3
Rtools version 3.5.0.4
Rstan version 2.19.3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Eight Schools example with 8schools.stan using the reported R 3.5.3, Rtools 3.5.0.4, and rstan 2.19.3 versions. Inspect the failing R CMD SHLIB compilation command and its C++ output; done means the example compiles and the stan(file = '8schools.stan', data = schools_dat) call runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.