brian-lau / MatlabStan

Matlab interface to Stan, a package for Bayesian inference
BSD 3-Clause "New" or "Revised" License
80 stars 47 forks source link

Matlab 2014b error #3

Open geebioso opened 9 years ago

geebioso commented 9 years ago

Hi Brian,

I tried installing and running matlab stan in Matlab 2014b. I tested the installation on the schools_code example provided in the README file and Matlab threw the following error:

Error using processManager/start (line 362) Java exception occurred: java.io.IOException: Cannot run program "make" (in directory "C:\Users\Garren\Dropbox\cmdstan-2.5.0\cmdstan"): CreateProcess error=2, The system cannot find the file specified

at java.lang.ProcessBuilder.start(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

at java.lang.Runtime.exec(Unknown Source)

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified

at java.lang.ProcessImpl.create(Native Method)

at java.lang.ProcessImpl.<init>(Unknown Source)

at java.lang.ProcessImpl.start(Unknown Source)

... 3 more

Error in processManager/set.command (line 212) self.start();

Error in processManager (line 179) self.command = p.Results.command;

Error in StanModel/compile (line 842) p = processManager('id','compile',...

Error in StanModel/sampling (line 715) self.compile();

Error in stan (line 137) fit = model.sampling(p.Unmatched);

I ran the same example in Matlab 2014a and it worked fine. I'm also able to run the make program directly from the command line in the specified directory.

I'm happy to use 2014a, but I thought I'd let you know about the issue and would appreciate advice for getting it working on 2014b if you have any. As a disclaimer, I'm fairly inexperienced at using the command line and installing packages from source, so there's probably something I'm missing.

Thanks,

Garren

brian-lau commented 9 years ago

That's an odd error. FWIW, all tests pass on Mac OSX 10.9.5 running Matlab 2014b. I will install 2014b on a Windows box and see if I can reproduce the error.

XxgithubxX commented 9 years ago

I had that same error, granted I'm using Matlab2013a. I was able to fix it by placing "C:\MinGW\msys\1.0\bin" first in my environmental path. Not sure if that's the same issue you're facing, but just thought I'd offer a potential solution.

peleschramm commented 7 years ago

I had precisely the same problem, running Windows 10, with Matlab R2015b, cmdStan2.14.0, and MatlabStan 2.7.0.0. After a restart the problem went away.

I updated my windows environment variables to include the dependencies shared by Rtools (like the cmdstan installation instructions advise), and I noticed my path didn't change in the Windows command line until I closed the terminal and reopened it, and I had the Matlab window I used open prior to changing the Windows path. It's possible that Matlab maintains a terminal from the beginning, and changes to Windows environment variables don't get implemented until after Matlab is closed and reopened.

I'm not entirely sure if that's what caused the fix, but it's my best guess.

SaidehF commented 3 years ago

Hello,

I also have the same problem as geebioso. I have Matlab2019a and Windows10. I did the above recommendations, but none of them work. I really appreciate if anyone could help me to find the solution.

thanks in advance. Saideh