Skip to content

Instantly share code, notes, and snippets.

@remlapmot
Last active April 1, 2021 09:54
Show Gist options
  • Save remlapmot/e556bbb2c2c59352e0b59bbd9cc375c2 to your computer and use it in GitHub Desktop.
Save remlapmot/e556bbb2c2c59352e0b59bbd9cc375c2 to your computer and use it in GitHub Desktop.
rstan compiler on Ubuntu
# In Terminal install clang
# sudo apt-get install clang
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M)) file.create(M)
cat("\nCXX14FLAGS=-O3 -march=native -mtune=native -fPIC",
"CXX14=clang++", # g++ # or clang++ but you may need a version postfix
file = M, sep = "\n", append = TRUE)
@remlapmot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment