rmcelreath / rethinking

Statistical Rethinking course and book package
2.18k stars 606 forks source link

Ubuntu2204, Can't install "rethinking": Multiple results for CXX14FLAGS found #356

Open brucejuz opened 2 years ago

brucejuz commented 2 years ago

`> devtools::install_github("rmcelreath/rethinking")

Downloading GitHub repo rmcelreath/rethinking@HEAD

Skipping 1 packages not available: cmdstanr

Error: Failed to install 'rethinking' from GitHub: Multiple results for CXX14FLAGS found, something is wrong.FALSE`

`> devtools::install_github("rmcelreath/rethinking@slim")

Downloading GitHub repo rmcelreath/rethinking@slim

Error: Failed to install 'rethinking' from GitHub: ", something is wrong.FALSE`

rok-cesnovar commented 2 years ago

Does

devtools::install_github("rmcelreath/rethinking", dependencies = FALSE) 

work?

brucejuz commented 2 years ago

Thanks you

Does

devtools::install_github("rmcelreath/rethinking", dependencies = FALSE) 

https://github.com/stan-dev/rstan/pull/857 Thank you! I have find the problem in this web. It seems I have configed the c++ toolchain use following code more than one time 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=g++", # or clang++ but you may need a version postfix file = M, sep = "\n", append = TRUE)

Each time I run it, it will add 2 lines in my "Makevars".

So I just go into my "home/.R" directory, then edit the file "Makevars", delete the repeated lines. Then it working! I can install "rethinking!"