stan-dev / stan-dev/rstan

Unable to install Rstan with R 3.4.4

Open
#683 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

Using install.packages function, I get compilation errors. I am using R 3.4.4 on Ubuntu 16.04.5 LTS.

A portion of the output showing the errors:

In file included from chains.cpp:19:0:
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp: In function 'typename boost::math::tools::promote_args::type stan::math::mean(const std::vector&)':
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:63: error: an array reference cannot appear in a constant-expression
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
^
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:63: error: '&' cannot appear in a constant-expression
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:68: error: '.' cannot appear in a constant-expression
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
^
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:73: error: a function call cannot appear in a constant-expression
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
^
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:74: error: a function call cannot appear in a constant-expression
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
^
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:74: error: template argument 3 is invalid
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:74: error: template argument 4 is invalid
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:74: error: template argument 6 is invalid
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:24:27: error: template argument 1 is invalid
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>> m(&v[0], v.size());
^
/usr/local/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:25:10: error: 'm' was not declared in this scope
return m.mean();
^

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

Reproduce the install.packages failure with R 3.4.4 on Ubuntu 16.04.5 LTS, then inspect the reported StanHeaders path and the errors in stan/math/prim/mat/fun/mean.hpp while compiling chains.cpp. Done means identifying a compatible installation path or correcting the compatibility issue so RStan installs without these compilation errors.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.