danheck / metaBMA

Bayesian Model Averaging for Random and Fixed Effects Meta-Analysis
https://danheck.github.io/metaBMA/
28 stars 2 forks source link

Compilation error #4

Closed jcaude closed 4 years ago

jcaude commented 4 years ago

I try to build metaBMA using R 4.0.0 running on Unbuntu 18.04LTS (gcc 5.4.0) but it fails with the following error..

/home/user/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat/functor/adj_jac_apply.hpp:619:15: error: invalid use of ‘auto’ return (*vi)(args...); ^

I understand that it is possibly related to stan, still rstan package compile very well.. Any idea ?

thx.

danheck commented 4 years ago

On a virtual machine, I could install and build the package metaBMA on Ubuntu 18.04 LTS with R 4.0.0 without any issues, so it is difficult to replicate this error. However, it was necessary to remove all package installed previously in R 3.6.0.

Can you compile the R package StanHeaders ? The error seems related to this package.

jcaude commented 4 years ago

Ok.. and sorry, I made a mistakes the error occurs on a Ubuntu 16.04 (different server). Actually I made an R upgrade and indeed all old 3.6 packages were discarded.. so start from a clean environment. Both rstan and StanHeaders installed properly. Unfortunately, when I reinstall all my 3.6 packages (that's ~300) all goes well.. except metaBMA and all those that depends on it..

I have attached the installation output below.. maybe it can help you. I have to check but I thought StanHeaders were installed with c++-11 while your package seems to compile with c++-14 .. I am definitely not a c++ expert and I can't even tell you if that makes any difference at all.

btw, Thanks for you reply.

metaBMA-log.txt

danheck commented 4 years ago

The error message invalid use of ‘auto’ would be in line with the fact that the functionality of auto has changed with c++14 as shown here: https://en.cppreference.com/w/cpp/language/auto (but I am not a c++ expert myself).

Anyways, c++14 is used as a default for R packages with pre-compiled Stan models generated by the package rstantools. Is it possible to install rstanarm? This R package also uses c++14.

The CRAN checks do not indicate issues, so it is difficult togenerate ideas on how to solve this issue.

jcaude commented 4 years ago

I just tried and indeed I got the same error.. I will try to reinstall StanHeaders from source and see what's happen.

jcaude commented 4 years ago

It doesn't change anything at all..

jcaude commented 4 years ago

My bad ... well my really bad. I try to switch to the clang compiler and just found that my Makevars were set to c++11 (it was for testing purpose, that's another story). Anyway, after fixing this very stupid mistake your package compile without any pb.

danheck commented 4 years ago

No problem, good to hear that everything is working now.