Perhaps the above indicates that there might be something wrong in your Makevars file which on my Mac is in my home directory in the .R/ directory? Which compiler and OS are you using?
[yabyibe@login GM12878]$ which gcc
/usr/bin/gcc
[yabyibe@login GM12878]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
That compiler is almost 8 years old and is based on an even older branch of GCC that does not know about the C++14 standard. You need GCC 5 or later, but if the server does not have them, you can download from
[yabyibe@comput18 ~]$ which gcc
/public/home/software/opt/gcc/gcc-5.4.0/bin/gcc
[yabyibe@comput18 ~]$ gcc --version
gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I used GCC 5.4.0 and got this error
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from /public/home/yabyibe/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:28:0,
from /public/home/yabyibe/R/library/BH/include/boost/shared_ptr.hpp:17,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat/fun/LDLT_factor.hpp:7,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat/err/check_ldlt_factor.hpp:6,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat.hpp:33,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/rev/mat.hpp:12,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math.hpp:4,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file158
Calls: stan ... cxxfunctionplus -> <Anonymous> -> cxxfunction -> compileCode
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '/public/home/yabyibe/anaconda3/lib/R/bin/R CMD SHLIB file15846acd4061.cpp 2> file15846acd4061.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
Calls: stan -> stan_model -> cxxfunctionplus -> sink
Execution halted
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from /public/home/yabyibe/R/library/BH/include/boost/smart_ptr/shared_ptr.hpp:28:0,
from /public/home/yabyibe/R/library/BH/include/boost/shared_ptr.hpp:17,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat/fun/LDLT_factor.hpp:7,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat/err/check_ldlt_factor.hpp:6,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/prim/mat.hpp:33,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math/rev/mat.hpp:12,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/stan/math.hpp:4,
from /public/home/yabyibe/anaconda3/lib/R/library/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file311
Calls: stan ... cxxfunctionplus -> <Anonymous> -> cxxfunction -> compileCode
Execution halted