Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot run my stan code due to an error "Multiple results for CXXFLAGS found" #866

Closed
hellomissingdata opened this issue Oct 25, 2020 · 10 comments

Comments

@hellomissingdata
Copy link

Summary:

I have a fresh installation of R/RStidio/RStan, but it cannot run

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rstan_2.21.2 ggplot2_3.3.2 StanHeaders_2.21.0-6

loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 pillar_1.4.6 compiler_4.0.3 prettyunits_1.1.1 tools_4.0.3
[6] digest_0.6.27 pkgbuild_1.1.0 jsonlite_1.7.1 evaluate_0.14 lifecycle_0.2.0
[11] tibble_3.0.4 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.8 cli_2.1.0
[16] rstudioapi_0.11 parallel_4.0.3 curl_4.3 yaml_2.2.1 xfun_0.18
[21] loo_2.3.1 gridExtra_2.3 withr_2.3.0 knitr_1.30 vctrs_0.3.4
[26] stats4_4.0.3 grid_4.0.3 glue_1.4.2 inline_0.3.16 R6_2.4.1
[31] processx_3.4.4 fansi_0.4.1 rmarkdown_2.5 callr_3.5.1 magrittr_1.5
[36] codetools_0.2-16 matrixStats_0.57.0 scales_1.1.1 ps_1.4.0 ellipsis_0.3.1
[41] htmltools_0.5.0 assertthat_0.2.1 colorspace_1.4-1 V8_3.2.0 RcppParallel_5.0.2
[46] munsell_0.5.0 crayon_1.3.4

Description:

I reinstalled R/RStudio/Rtools/RStan on my computer, but I cannot run any RStan code because of the error message;

"Error in withr::set_makevars(new, path, state, assignment = assignment) :
Multiple results for CXXFLAGS found, something is wrong.FALSE
Calls: ... .local_makevars -> -> setup_makevar ->

Execution halted"

RStan Version:

2.21.2

R Version:

4.0.3

Operating System:

Windows 10

@jgabry
Copy link
Member

jgabry commented Oct 26, 2020

Hi @hellomissingdata, can you check your Makevars.win file using

file.edit(file.path(Sys.getenv("HOME"), ".R", "Makevars.win"))

and share what the contents are? I think there could be some duplicate entries.

@SteveBronder
Copy link
Contributor

@jgabry can we merge #857 ? I think that should help here

@hellomissingdata
Copy link
Author

hellomissingdata commented Oct 26, 2020 via email

@jgabry
Copy link
Member

jgabry commented Oct 26, 2020

@jgabry can we merge #857 ? I think that should help here

Yeah that's fine by me. I usually let @bgoodri merge RStan stuff but I'll reply to the PR and ask if if he's ready. I couldn't quite tell from his comments on the PR if he's ready to merge it yet.

I have multiple entries there. Now I wiped them. It worked finally.

@hellomissingdata Great, glad it's working! Did you remove everything or just the duplicate? I think currently on Windows this line should work well:

CXX14FLAGS = -O3 -g0 -Wno-ignored-attributes -Wno-deprecated-declarations

The -O3 should speed things up a bit and the Wno-** lines should silence some messages during compilation

@hellomissingdata
Copy link
Author

hellomissingdata commented Oct 27, 2020 via email

@jgabry jgabry closed this as completed Dec 1, 2020
@lottybrand
Copy link

lottybrand commented Dec 15, 2021

Hi there @jgabry , I have the same error message but I'm on a mac. any idea how to find and remove the duplicates on a mac?

@bgoodri
Copy link
Contributor

bgoodri commented Dec 15, 2021 via email

@lottybrand
Copy link

lottybrand commented Dec 15, 2021

Thanks!! It prints this:

CC=clang
CXX=clang++

CXXFLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CXXFLAGS=-O3 -Wno-unused-variable -Wno-unused-function

CC=clang
CXX=clang++ -arch x86_64 -ftemplate-depth-256

So I just delete the duplicate line in the middle?

@bgoodri
Copy link
Contributor

bgoodri commented Dec 15, 2021 via email

@lottybrand
Copy link

I tried just deleting the middle duplicate line to begin with - and it worked!! Thank you SO SO much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants