Partial progress: on my Ubuntu 16.04 server, I have added a Makevars
CXX=clang++
USE_CXX11=1
and got a working version of 2.16.2. The error is now downgraded to a warning (not that I love it), but again, USE_CXX11 has not been picked up as the warning message shows. clang 3.5 is installed.
No progress yet on TravisCI where I cannot simply change the system.
clang++ -I/usr/share/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"`"/usr/lib/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/RcppEigen/include" -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/StanHeaders/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c lang__grammars__whitespace_grammar_inst.cpp -o lang__grammars__whitespace_grammar_inst.o
In file included from lang__grammars__whitespace_grammar_inst.cpp:19:
In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/grammars/whitespace_grammar_inst.cpp:1:
In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/grammars/whitespace_grammar_def.hpp:5:
In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/grammars/semantic_actions.hpp:6:
In file included from /usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast.hpp:68:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/lang/ast/node/conditional_op.hpp:40:21: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
bool has_var_ = false;
^
1 warning generated.
I only know the ugly style. But I do know that RStan is not going to work with anything less than g+±4.9 (or clang++) in the next version. So, maybe someone knows a different way to get an updated compiler onto Travis?
At least until rstan 3 comes along, using the new âtrustyâ makes things nice again with TravisCI. Full .travis.yml below. The only change is dist:trusty; probably not needed âquite soonâ, since it will become standard. Still testing what this means for C++14
To summarize this lengthy thread, hoping that someone finds a better solution:
To solve the âconstructorâ issue, do what Ben suggests a the top of the thread: constructors = list(c("SEXP", "SEXP", "SEXP")), fields = character(),
If you want to run on TravisCI with the simplified syntax shown above, use dist: trusty; starting from July 17, this is no longer needed, it will be the default.
Replace CXX_STD = CXX14 with CXX_STD = CXX11 in Makevars. Currently, this is the settings in Makevars.win anyway. This will produce a lot of warnings about ânon-static data memberâ, but it is not an error as with the compiler that comes in the compiler of default TravisCI precise.
Changing to CXX11 is not future-safe, rstan 3.0 requires CXX14, but maybe someone finds better simplified travis.yml
For sure you can find a a more flexible solution using sudo:required and the imperative format; check travis.yml file of package rstanarm. I like the elegant native version.
Feel free to clone https://github.com/dmenne/teststan which is a minimal package using rstan to find a better solution with CXX14. (Hint: I wish the skeleton created by rstan would produce such a package with a sample .stan and travis support)
I also tried r-hub, which is much more flexible when it comes to C++ support. TravisCI is just a bit better integrated into the workflow for me - currently. Donât be surprised to get an email: teststan 2.16.0: PREPERROR: This is a false-positive bug as Gabor Csardi told me.
Thanks (also to Dirk), this works great. Maybe @bgoodri could make this solution better exposed somewhere. I have change the threadâs title to make the important part more visible.
Hi, I think Iâm running into a similar issue. A code that worked perfectly last week, does not anymore. Any suggestions for someone who is not that computer savy? Iâm using windows 10