This is in reference to Dealing with Catalina. I have been unsuccessful getting my model sample in Rstan and so moved to CmdStanR. Unfortunately running install_cmdstan() results in a seemingly endless loop of; clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.69.0 -I stan/lib/stan_math/lib/sundials_4.1.0/include -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/functions_grammar_inst.o -MT stan/src/stan/lang/grammars/functions_grammar_inst.d -MM -E -MG -MP -MF stan/src/stan/lang/grammars/functions_grammar_inst.d stan/src/stan/lang/grammars/functions_grammar_inst.cpp clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.69.0 -I stan/lib/stan_math/lib/sundials_4.1.0/include -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/program_grammar_inst.o -MT stan/src/stan/lang/grammars/program_grammar_inst.d -MM -E -MG -MP -MF stan/src/stan/lang/grammars/program_grammar_inst.d stan/src/stan/lang/grammars/program_grammar_inst.cpp
being printed to the RStudio console (for a variety of .cpp files) without the build ever finishing.
I’ve started a new thread to address this issue separately from those related to RStan and Catalina.
Operating System: macOS Catalina 10.15
Interface Version: Rstudio 1.2.1335; R 3.6.0
Compiler/Toolkit: installed with @coatless installer
Yeah this does seem similar to that issue from @rok_cesnovar.
@coatless thanks for helping with this! since the Apple clang 11 seems to work for CmdStanR, could we just have CmdStanR set the PATH environment variable?(i.e., overriding .Renviron but then changing it back when it finishes)
This does seems similar to that Travis issue. We never got around to fixing it, because we opted to exclude Travis in favor of doing all tests on Jenkins instead.
One thing worth trying is to install the current develop version of cmdstan. I think this latest PR from @mitzimorris could fix this issue. Not 100% sure, but worth a try.
After I deleted the ~/.Renviron the compilation worked fine but when I tried compiling a test program, I go the following error message:
> mod <- cmdstan_model("bern.stan")
Compiling Stan program...
error: PCH file built from a different branch ((clang-1103.0.32.29)) than the compiler ((tags/RELEASE_700/final))
1 error generated.
make: *** [/var/folders/rq/rz57m_px0sscbvx56fx18k5w0000gn/T/RtmpuuUqsW/model-5c7951ecc530] Error 1
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command 'make' failed, exit status: 2, stderr:
E> error: PCH file built from a different branch ((clang-1103.0.32.29)) than the compiler ((tags/RELEASE_700/final))
E> 1 error generated.
E> make: *** [/var/folders/rq/rz57m_px0sscbvx56fx18k5w0000gn/T/RtmpuuUqsW/model-5c7951ecc530] Error 1
Type .Last.error.trace to see where the error occured
I am on Apple clang version 11.0.3 (clang-1103.0.32.29)
Problem solved. Before running the above I restored ~/.Renviron and that was apparently causing the problem. After removing it (again) the compilation succeeded.
Just to follow up, from the looks of it I would say that the previous ~/.Renviron enforced the use of another version of clang? Is that possible?
I am guessing there was a leftover model_header PCH file that was build using the older version of Clang. This issue would also be solved if you would clean and rebuild the cmdstan (make clean-all`` and make build`). We need to expose this cleanup feature via a R command anyways (cmdstan_clean_and_rebuild() or something along those lines).
what Rok said - stanc2 is available as a way to check/workaround failures of the new compiler.
but I thought that there was another reason as well - some other kind of debugging or error messages?