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 error with initial compiling #217

Open
arranhamlet opened this issue Oct 16, 2024 · 3 comments
Open

Windows error with initial compiling #217

arranhamlet opened this issue Oct 16, 2024 · 3 comments

Comments

@arranhamlet
Copy link
Collaborator

arranhamlet commented Oct 16, 2024

Describe the bug
A rather annoying bug that appears to occur because Windows has not included the Rtools environment in its paths. I've found a solution, and flagging here in case this happens to other people who are running the package for the first time.

To Reproduce
Steps to reproduce the behavior:

  1. Installing Rtools, cmdstanr and ww-inference on my CDC VAP.
  2. Successful install of required packages.
  3. Running compile_model() produces the following error
INFO: Could not find files for the given pattern(s).

mingw32-make.exe: Interrupt/Exception caught (code = 0xc0000005, addr = 0x00007ffb221f746b)

Error: An error occured during compilation! See the message above for more information.

Solution
Add new PATH to the windows environment. The issue appears to be that CmdStanR doesnt know where the mingw32-make.exe file is which is required to compile the model.

  1. Type "environment" in the Windows search bar - click on "Edit the system environment variables".
  2. This will open a "System Properties" window on the "Advanced" tab.
  3. Click on "Environment Variables" on the bottom right.
  4. Click on the variable "Path" and then click edit.
  5. Click "New" and then paste in the file path to the folder within your Rtools folder called "mingw64". I.e. C:\rtools44\mingw64.
  6. Click okay.

After completing these steps, compile_model() was able to run successfully.

Session info
image

@kaitejohnson
Copy link
Collaborator

@arranhamlet Thank you for documenting this! Is this the way to do what is instructed here https://mc-stan.org/docs/cmdstan-guide/installation.html#rtools44 (Specifically: "Next, you need to add the toolchain directory to your PATH variable"), but for make? Or basically, how did you figure this out :)

@arranhamlet
Copy link
Collaborator Author

Yes, that is the expanded version of what they say to do. I didn't know how to "add the toolchain directory to your PATH variable", until I found these more helpful step-by-step instructions here:

https://www.maxmantei.com/2020/05/16/cmdstanr-windows/
https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/

@kaitejohnson
Copy link
Collaborator

Yeah that direction is not very intuitive... Hmm I am wondering if we should create a little FAQ guide to document some of these work arounds attached to this package... thoughts @dylanhmorris ? I know its just replicating solutions already on the internet somewhere, but can be helpful to have a sort of "if you get this error when doing this, try this and heres a link to the source"?

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

2 participants