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

Windows 11 issue: precompiled headers Error 1 #1048

Open
qdread opened this issue Dec 2, 2024 · 0 comments
Open

Windows 11 issue: precompiled headers Error 1 #1048

qdread opened this issue Dec 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@qdread
Copy link

qdread commented Dec 2, 2024

I am assisting a client installing cmdstan and cmdstanr on a Windows 11 machine. I have tried various strategies for installing CmdStan, none of which have been successful. We've tried the standard procedure of using cmdstanr::install_cmdstan() as well as installing cmdstan via Anaconda, and setting cmdstan path to the instance of cmdstan installed by Anaconda. When using install_cmdstan(), it verifies that the toolchain is set up properly, and Rtools appears as expected in the PATH variable.

Unfortunately both ways of installing lead to the same error message when we try to run a model: mingw32-make Error 1 in model_header.hpp.gch. Below is a representative console + error log when we try to run a brms model with cmdstanr backend.

By the way I also tried running install_cmdstan with PRECOMPILED_HEADERS=FALSE but that did not seem to solve the problem either.

OS is Windows 11 running R 4.4.1 and installing latest stable versions of CmdStan and CmdStanR.

Console & error log:

> cmdstanr::set_cmdstan_path("C:/Users/Kip.Balkcom/AppData/Local/anaconda3/Library/bin/cmdstan")
CmdStan path set to: C:/Users/Kip.Balkcom/AppData/Local/anaconda3/Library/bin/cmdstan
> library(brms)
Loading required package: Rcpp
Loading 'brms' package (version 2.22.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package: ‘brms’

The following object is masked from ‘package:stats’:

    ar

Warning message:
package ‘brms’ was built under R version 4.4.2 
> options(mc.cores = 4, brms.backend = 'cmdstanr', brms.file_refit = 'on_change')
> brm(mpg~hp, data = mtcars)
Compiling Stan program...
mingw32-make: *** [make/program:28: stan/src/stan/model/model_header.hpp.gch/model_header_14_2.hpp.gch] Error 1

Error: An error occured during compilation! See the message above for more information.
In addition: Warning message:
CmdStan's precompiled header (PCH) files may need to be rebuilt.
If your model failed to compile please run rebuild_cmdstan().
If the issue persists please open a bug report. 
> 
@qdread qdread added the bug Something isn't working label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant