Matlabstan running problem,win10, 64bit

I installed the MatlabStan2.15.1.0 on my matlab 2018b under windows10 64bits.
I had installed the cmdstan under cygwin. MatlabProcessManager was installed and set to path too.
I tried to run the example " …\Examples\rats" but failed. The error is

">> rats
Having a problem getting stan version.
This is likely a problem with Java running out of file descriptors
Trying again.
Trying again.
Trying again.
Trying again.
Trying again.
Trying again.
Giving up.
Output argument “ver” (and maybe others) not assigned during call to “StanModel/stan_version”.

Error in StanModel (line 196)
ver = self.stan_version();

Error in stan (line 108)
model = StanModel();

Error in rats (line 20)
fit = stan(‘file’,‘rats.stan’,‘data’,rats_dat,‘verbose’,true);"

At first, I thought it is because the MatlabProcessManager. I tried different version of MatlabProcessManager, but I got the same errors. Then I thought the problem is just getting the version of stan in matlab. So I change my directory to ...\cmdstan\bin, and run the below command:

" [status,cmdout] = system(‘stanc.exe --version’)"

I got

" status = -1.0737e+09

cmdout =0×0 empty char array"

I seems that the system command failed with a return value not 0. To exclude the cmdstan reason, I have tried to run the same command in cygwin,
“./stanc --version,”
where I make and build stan. It gets the version successfully.
“stanc version 2.3.0”
Besides, I run the same command under CMD in windows10. After adding the cygwin path to the enviroment path, it succeeds again. Now I am very confused in the Matlab. How could I run the stanc.exe to get the version? I really need help and suggestions.
Thank you.

I found the reason for this problem. It is the lack of .dll files from cygwin not stan.
i.e. cygwin1.dll cygstdc+±6.dll cyggcc_s-seh-1.dll
After add path or just copy the dll files into the stanc.exe directory. The error disappeared.
Matlab cannot output the error reason of lacking dll files. So I just notes these here in case anybody else need them.

Is there a reason you are using a release from 2014?

There is no good reason that I use the old version. That is just a “intermediate product”. During my fixing the problem above, I had tried different version of MatlabStan to exclude the possible cause of stan’s software version. Now I am using the 2.17.1 version, not the latest 2.18.1. I found some bugs in the 2.18.1, which I can’t handle.

1 Like