antcalcagni / ssMousetrack

Bayesian State-Space Modeling of Mouse-Tracking Experiments via Stan
GNU General Public License v3.0
0 stars 1 forks source link

How to install #2

Open codeaadd opened 5 years ago

codeaadd commented 5 years ago

Hi,

I have trouble to install the package. When I do

install.packages("ssMousetrack", repos = "http://cran.r-project.org")

it gives compiling error, such as

adj_jac_apply.hpp:530:5: error: ‘FReturnType’ was not declared in this scope

Can you help to resolve this issue? Thank you!

antcalcagni commented 5 years ago

Hello, Please, could you give me some information about the R platform being used (just type version on your R console). Just in case, have you installed C libraries and the compiler Rcpp?

codeaadd commented 5 years ago

platform x86_64-redhat-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 6.0
year 2019
month 04
day 26
svn rev 76424
language R
version.string R version 3.6.0 (2019-04-26) nickname Planting of a Tree

codeaadd commented 5 years ago

I have gcc 4.8.5 installed

codeaadd commented 5 years ago

Rcpp is also installed. Then what are the steps I should take to install ssMousetrack? Thank you for your help!

antcalcagni commented 5 years ago

That should be enough to install ssMousetrack. It's a bit strange. In the meantime, I have tried to install the package on other Linux and Osx based systems and everything was fine. Usually, when you install ssMousetrack it automatically installs all the needed the dependencies.

In addition, take a look here https://discourse.mc-stan.org/t/compilation-problem-on-travis-linux-works-fine-on-travis-osx/9190, they suggest installing a new version of g++ compiler. Let me know..

Please, try again and let me know what kind of errors you get so I can help you with the further steps.

codeaadd commented 5 years ago

I just do

install.packages("ssMousetrack")

It gives errors below. Thank you!

/nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/BH/include/boost/fusion/support/detail/index_sequence.hpp:59:12: note: ‘boost::fusion::detail::make_index_sequence’ struct make_index_sequence ^ In file included from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/fun/ordered_constrain.hpp:6:0, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat.hpp:41, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/src/stan/model/test_gradients.hpp:7, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/rstan/include/rstan/stan_fit.hpp:34, from /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/rstan/include/rstan/rstaninc.hpp:3, from stan_files/fit_model_log.hpp:18, from stan_files/fit_model_log.cc:3: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:49:77: error: expected primary-expression before ‘{’ token return apply_impl(f, t, std::make_index_sequence<std::tuple_size{}>{}); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:49:77: error: expected ‘)’ before ‘{’ token /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp: At global scope: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:151:9: error: expected type-specifier = std::result_of_t<F(decltype(isvar), decltype(value_of(Targs()))...)>; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:156:42: error: ‘FReturnType’ was not declared in this scope std::array<int, internal::computedims::value> M; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:156:53: error: template argument 1 is invalid std::array<int, internal::computedims::value> M; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:156:61: error: template argument 2 is invalid std::array<int, internal::computedims::value> M; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp: In member function ‘std::vector stan::math::adj_jac_vari<F, Targs>::build_return_varis_and_vars(const std::vector&)’: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jacapply.hpp:349:9: error: invalid types ‘int[int]’ for array subscript M[0] = val_y.size(); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:350:32: error: invalid types ‘int[int]’ for array subscript std::vector vary(M[0]); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp: In member function ‘Eigen::Matrix<stan::math::var, R, C> stan::math::adj_jac_vari<F, Targs>::build_return_varis_and_vars(const Eigen::Matrix<double, R, C>&)’: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jacapply.hpp:375:9: error: invalid types ‘int[int]’ for array subscript M[0] = val_y.rows(); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jacapply.hpp:376:9: error: invalid types ‘int[int]’ for array subscript M[1] = val_y.cols(); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:377:40: error: invalid types ‘int[int]’ for array subscript Eigen::Matrix<var, R, C> vary(M[0], M_[1]); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:377:47: error: invalid types ‘int[int]’ for array subscript Eigen::Matrix<var, R, C> vary(M[0], M_[1]); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp: In member function ‘void stan::math::adj_jac_vari<F, Targs>::chain()’: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:530:5: error: ‘FReturnType’ was not declared in this scope FReturnType y_adj; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:530:17: error: expected ‘;’ before ‘y_adj’ FReturnType y_adj; ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:532:38: error: ‘y_adj’ was not declared in this scope internal::build_y_adj(yvi, M_, y_adj); ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:536:26: error: expansion pattern ‘auto&&’ contains no argument packs [this](auto&&... args) { this->accumulate_adjoints(args...); }, ^ /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp: In lambda function: /nfs/stak/users/home/R/x86_64-redhat-linux-gnu-library/3.6/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:536:60: error: ‘args’ was not declared in this scope [this](auto&&... args) { this->accumulate_adjoints(args...); }, ^ make: *** [stan_files/fit_model_log.o] Error 1 rm stan_files/fit_model_log.cc ERROR: compilation failed for package ‘ssMousetrack’

The downloaded source packages are in ‘/tmp/RtmpAEAelT/downloaded_packages’ Warning message: In install.packages("ssMousetrack") : installation of package ‘ssMousetrack’ had non-zero exit status

antcalcagni commented 5 years ago

Well, it seems to be that something is wrong with your C compilers. Since ssMousetrack uses rstan to estimate the models, then you may try running rstan before. In this way, we can exclude that the problem belongs to ssMousetrack. Please, try running the Example 1 from this simple guide https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started (you need to install rstan before).

Anyway, I think the problem is with your gcc/g++ libraries. Here there is something related to the issue: https://discourse.mc-stan.org/t/installing-rstan-on-rhel7/1752.

Let me know is rstan works properly on your machine. As suggested here https://github.com/stan-dev/rstan/issues/589, you may try to remove rstan (if installed), update the gcc/g++ libraries, and install rstan again. The last link reports an issue with rstan and redhat.

codeaadd commented 5 years ago

Sorry to ask more questions. I restart the installation on a new Ubuntu system with latest c/c++ compiler. Follow the example to install rstan, I get errors:

ERROR: dependecies 'rsconnect', 'rstan' are not available for package 'shinystan'

Thank you!

antcalcagni commented 5 years ago

It's a bit strange to me that error. Did you follow the instructions described at https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started ? Anyway, you need to test the correct functioning of rstan before using ssMousetrack. Usually, I did not experience any errors with rstan but something can be changed with the new version of Ubuntu. I would try install once again rstan by following the above link. Let me know.