stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.03k stars 264 forks source link

Install Error on Ubuntu 20.04 with Microsoft R Open 4.0.2 #895

Closed cmhoove14 closed 3 years ago

cmhoove14 commented 3 years ago

Summary:

Install on Ubuntu 20.04 with Microsoft R open errors out trying to compile chains.o

Description:

Error message in its entirety is:

/bin/bash: -c: line 0: syntax error near unexpected token(' /bin/bash: -c: line 0: g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS Microsoft R Open 4.0.2 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2020 Microsoft Corporation Using the Intel MKL for parallel mathematical computing (using 8 cores). Default CRAN mirror snapshot taken on 2020-07-16. See: https://mran.microsoft.com/. -I'/home/chris/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include' -I'/home/chris/R/x86_64-pc-linux-gnu-library/4.0/RcppEigen/include' -I'/home/chris/R/x86_64-pc-linux-gnu-library/4.0/BH/include' -I'/opt/microsoft/ropen/4.0.2/lib64/R/library/StanHeaders/include' -I'/home/chris/R/x86_64-pc-linux-gnu-library/4.0/RcppParallel/include' -DU_STATIC_IMPLEMENTATION -O3 -march=native -mtune=native -fPIC -c chains.cpp -o chains.o' make: *** [/opt/microsoft/ropen/4.0.2/lib64/R/etc/Makeconf:168: chains.o] Error 1 ERROR: compilation failed for package ‘rstan’

The error seems to be coming from the Makeconf (equivalent to Makevar, I think?) line 168 which is:

.cpp.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@

Lines CXX14FLAGS=-O3 -march=native -mtune=native -fPIC and CXX14 = g++ are in the Makeconf, V8 is installed successfully. Spent all day searching for a solution, but couldn't find anything. Seems like it's maybe something to do with compiation though. gcc version 9.3.0

R Version:

Microsoft R Open 4.0.2

Operating System:

Ubuntu 20.04

andrjohns commented 3 years ago

There's an issue with R Open copying their disclaimer/summary into the compilation argument. A user on the forums posted a fix, but there are compatibility issues with the TBB library (RcppParallel) on Windows, not sure if you'll have the same experience on Linux

cmhoove14 commented 3 years ago

Nice. Deleting all the mumble jumble in .Rprofile.site as described in that post worked for me. Able to install and example runs. Thanks!