stan-dev / stan-dev/rstan

cpp_object_initializer failing in downstream packages

Open
#353 4 comments 1 reaction 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

Summary:

Downstream packages can't use rstan without dependsing on Rcpp, which would pollute the user's namespace

Description:

This was previously discussed in #176.

The Rcpp developers have discussed improved solutions in the last week or so on https://github.com/RcppCore/Rcpp/issues/168; If I understand correctly, it might be solvable by adding importFrom(Rcpp, evalCpp) to the NAMESPACE.

Reproducible Steps:

(via a mini package I created to demonstrate the issue)

devtools::install_github("davharris/fail")
fail::test()
Current Output:
Error in .Object$initialize(...) : 
  could not find function "cpp_object_initializer"
failed to create the sampler; sampling not done
Expected Output:

an 8-schools stanfit

RStan Version:

2.12.1

R Version:

R version 3.3.2 (2016-10-31)

Operating System:

10.12.1

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 failure with the commands in the issue and inspect the linked mini package's R/hello.R entry point. Compare the package namespace behavior around Rcpp and cpp_object_initializer, then verify completion by confirming downstream packages work without depending on Rcpp and the 8-schools example produces a stanfit.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.