Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrjohns opened this issue Mar 15, 2018 · 5 comments
Open

Comments

@andrjohns
Copy link
Contributor

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
Copy link
Contributor

bgoodri commented Mar 15, 2018 via email

@rgiordan
Copy link

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
Copy link

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
Copy link
Contributor

bgoodri commented Apr 20, 2018 via email

@mcol
Copy link
Contributor

mcol commented Jul 4, 2018

In case other people get stuck on this:

  • checkout the for_2.18 branch
  • add -std=c++14 to the end of the PKG_CPPFLAGS variable in rstan/src/Makevars (maybe this should go somewhere else, but this worked for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants