stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.03k stars 264 forks source link

Stanheaders fails to install from source - looking for old cvodes folder #507

Open andrjohns opened 6 years ago

andrjohns commented 6 years ago

Summary:

The install_StanHeaders.R script fails because the cleanup script is attempting to find the folder inst/include/mathlib/lib/cvodes_2.9.0 when the folder is now inst/include/mathlib/lib/cvodes_3.1.0

Current Output:

Installing StanHeaders
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL '/tmp/RtmpEJQQf0/git2r-273912a3c235/StanHeaders'  \
  --library='/home/andrew/R/x86_64-pc-linux-gnu-library/3.4' --install-tests  \
  --preclean 

* installing *source* package ‘StanHeaders’ ...
cp: cannot stat 'inst/include/mathlib/lib/cvodes_2.9.0': No such file or directory
mv: cannot stat 'inst/include/mathlib/lib/cvodes_2.9.0/include/*': No such file or directory
** libs
make: *** No rule to make target 'cvodes/src/cvodes/cvodes.o', needed by 'static'.  Stop.
ERROR: compilation failed for package ‘StanHeaders’
* removing ‘/home/andrew/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders’
Error: Command failed (1)

RStan Version:

Latest version from git

R Version:

3.4.3

Operating System:

Ubuntu 17.10

bgoodri commented 6 years ago

Yeah, you need to change the branch to "for-2.18"

On Wed, Mar 14, 2018 at 8:14 PM, Andrew Johnson notifications@github.com wrote:

Summary:

The install_StanHeaders.R script fails because the cleanup script is attempting to find the folder inst/include/mathlib/lib/cvodes_2.9.0 when the folder is now inst/include/mathlib/lib/cvodes_3.1.0 Current Output:

Installing StanHeaders '/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD \ INSTALL '/tmp/RtmpEJQQf0/git2r-273912a3c235/StanHeaders' \ --library='/home/andrew/R/x86_64-pc-linux-gnu-library/3.4' --install-tests \ --preclean

  • installing source package ‘StanHeaders’ ... cp: cannot stat 'inst/include/mathlib/lib/cvodes_2.9.0': No such file or directory mv: cannot stat 'inst/include/mathlib/lib/cvodes_2.9.0/include/': No such file or directory libs make: No rule to make target 'cvodes/src/cvodes/cvodes.o', needed by 'static'. Stop. ERROR: compilation failed for package ‘StanHeaders’
  • removing ‘/home/andrew/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders’ Error: Command failed (1)

RStan Version:

Latest version from git R Version:

3.4.3 Operating System:

Ubuntu 17.10

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/507, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqrS5Fm_lZzBsVXzGdO8CFtKCMmDxks5tebJlgaJpZM4SrXa8 .

rgiordan commented 6 years ago

When I run the below install_StanHeaders.R file (where my stan-dev directory has fresh clones of all the repos), I get a lot of compile errors running make install in rstan.

Is there a set of branches for rstan, math, and stan that are known to work together?

# install_StanHeaders.R file:

# This directory has fresh clones of all the relevant repos to save repeatedly downloads.
stan_dev_root <- "/home/rgiordan/Documents/git_repos/stan-dev"

path_rstan <- tempfile(pattern = "git2r-")
git2r::clone(file.path(stan_dev_root, "rstan"), path_rstan,
             branch = "for-2.18")
git2r::clone(file.path(stan_dev_root, "stan"),
             file.path(path_rstan, "StanHeaders", "inst", "include", "upstream"),
             branch = "develop")
git2r::clone(file.path(stan_dev_root, "math"),
             file.path(path_rstan, "StanHeaders", "inst", "include", "mathlib"),
             branch = "develop")

devtools::install(file.path(path_rstan, "StanHeaders"), args = "--preclean")
print(path_rstan)

For what it's worth, here's the start of the compile errors:

In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast.hpp:105:0,
                 from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast_def.cpp:7,
                 from lang__ast_def.cpp:18:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp:27:48: error: ‘>>’ should be ‘> >’ within a nested template argument list
   static std::vector<std::pair<int, std::string>>& registered_calls() {
                                                ^
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp: In static member function ‘static std::vector<std::pair<int, std::__cxx11::basic_string<char> > >& stan::lang::map_rect::registered_calls()’:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp:28:50: error: ‘>>’ should be ‘> >’ within a nested template argument list
     static std::vector<std::pair<int, std::string>> REGISTERED_CALLS_;
                                                  ^
In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast_def.cpp:92:0,
                 from lang__ast_def.cpp:18:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect_def.hpp: In member function ‘void stan::lang::map_rect::register_id()’:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect_def.hpp:42:22: error: ‘class std::vector<std::pair<int, std::__cxx11::basic_string<char> > >’ has no member named ‘emplace_back’
   registered_calls().emplace_back(call_id_, fun_name_);

... and so on for many pages.

rgiordan commented 6 years ago

I should mention that using the master branch for all three gives the devtools error

> devtools::install(file.path(path_rstan, "StanHeaders"), args = "--preclean")
Error: Could not find package root.

...and that using the master branch only for stan and math, but for-2.18 with rstan gives the following cvodes error:

cp: cannot stat 'inst/include/mathlib/lib/cvodes-3.1.0': No such file or directory
mv: cannot stat 'inst/include/mathlib/lib/cvodes-3.1.0/include/*': No such file or directory
bgoodri commented 6 years ago

On the "for-2.18" branch you need to be specifying the C++14 standard in your Makevars file.

On Thu, Apr 19, 2018 at 8:54 PM, Ryan notifications@github.com wrote:

When I run the below install_StanHeaders.R file (where my stan-dev directory has fresh clones of all the repos), I get a lot of compile errors running make install in rstan.

Is there a set of branches for rstan, math, and stan that are known to work together?

install_StanHeaders.R file:

This directory has fresh clones of all the relevant repos to save repeatedly downloads.

stan_dev_root <- "/home/rgiordan/Documents/git_repos/stan-dev"

path_rstan <- tempfile(pattern = "git2r-") git2r::clone(file.path(stan_dev_root, "rstan"), path_rstan, branch = "for-2.18") git2r::clone(file.path(stan_dev_root, "stan"), file.path(path_rstan, "StanHeaders", "inst", "include", "upstream"), branch = "develop") git2r::clone(file.path(stan_dev_root, "math"), file.path(path_rstan, "StanHeaders", "inst", "include", "mathlib"), branch = "develop")

devtools::install(file.path(path_rstan, "StanHeaders"), args = "--preclean") print(path_rstan)

For what it's worth, here's the start of the compile errors:

In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast.hpp:105:0, from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast_def.cpp:7, from langast_def.cpp:18: /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp:27:48: error: ‘>>’ should be ‘> >’ within a nested template argument list static std::vector<std::pair<int, std::string>>& registered_calls() { ^ /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp: In static member function ‘static std::vector<std::pair<int, std::cxx11::basic_string > >& stan::lang::map_rect::registered_calls()’: /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect.hpp:28:50: error: ‘>>’ should be ‘> >’ within a nested template argument list static std::vector<std::pair<int, std::string>> REGISTEREDCALLS; ^ In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast_def.cpp:92:0, from lang__ast_def.cpp:18: /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect_def.hpp: In member function ‘void stan::lang::map_rect::register_id()’: /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/map_rect_def.hpp:42:22: error: ‘class std::vector<std::pair<int, std::__cxx11::basic_string > >’ has no member named ‘emplace_back’ registered_calls().emplace_back(callid, funname);

... and so on for many pages.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/507#issuecomment-382928269, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqnmzAn6qpG-zah38aAZOB5EYC2W9ks5tqTG5gaJpZM4SrXa8 .

mcol commented 6 years ago

In case other people get stuck on this: