Operating System: Windows 10, Matlab 2019b
Interface Version: Matlabstan 2.15.10, cmdstan v2.21.0
Compiler/Toolkit: mingw64
Running the 8 schools example gives me the following:
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.
Error using cellfun
Non-scalar in Uniform output, at index 1, output 1.
Set ‘UniformOutput’ to false.
Error in StanModel/stan_version (line 850)
ver = cellfun(@str2num ,regexp(str{3},‘.’,‘split’));
Error in StanModel (line 196)
ver = self.stan_version();
Error in stan (line 108)
model = StanModel();
Error in tester (line 29)
fit = stan(‘model_code’,schools_code,‘data’,schools_dat);
[status,cmdout] = system(‘stanc.exe --version’)
status =
0
cmdout =
'stanc acfb4612 (Win32)
’
I have found the topics below. There is no space in file path and matlabprocessmanager runs fine. I don’t know how to continue. Help?
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 may…
opened 03:07PM - 06 Nov 15 UTC
closed 08:07AM - 03 Jan 17 UTC
(Moved from the Stan email list. Thanks Brian for your reply, and it's good to k… now that MatlabStan and OS X can get along!)
Hi,
I’ve attempted to install and run MatlabStan (v. 2.7.0; cmdstan 2.8.0; operating system Mac OS X 10.10.5), but am unsuccessful for reasons I can’t figure out. Running, for example, the eight-schools example gives the following error:
_Having a problem getting stan version._
_This is likely a problem with Java running out of file descriptors_
_Trying again._ [repeated 6 times]
_Giving up._
_Error using processManager/start (line 402)_
_Looks like command doesn't exist. Check spelling or path?_
_Error in processManager/set.command (line 212)_
_self.start();_
_Error in processManager (line 179)_
_self.command = p.Results.command;_
_Error in StanModel/stan_version (line 789)_
_p = processManager('id','stanc version','command',command,..._
_Error in StanModel (line 194)_
_ver = self.stan_version();_
_Error in stan (line 108)_
_model = StanModel();_
_Error in school_test (line 27)_
_fit = stan('model_code',schools_code,'data',schools_dat);_
This error & message seems very similar to an issue reported elsewhere, caused by MATLAB not using the appropriate libraries, using its own rather than those in /usr/lib . See e.g. items 13-18 at https://www.mathworks.com/matlabcentral/newsreader/view_thread/162466, or http://sgpsproject.sourceforge.net/JavierVGomez/index.php/Solving_issues_with_GLIBCXX_and_libstdc%2B%2B . However, trying the solutions posted at these places does not work. (Essentially, many of the solutions involve setting the LD_PRELOAD variable to, for example, /usr/lib/libstdc++.so.6 to redirect to the proper libraries.) I think this fails for me because in Mac OS X there is no LD_LIBRARY_PATH variable; the prior discussion of solutions is all for Unix. Also, I don't see libstdc++... in Matlab's binary directories, and don't know what other things I should be looking for. It’s very non-obvious (to me) how to direct Matlab to the proper libraries. (I tried “setenv('DYLD_LIBRARY_PATH', '/usr/lib’);” — this also fails. It is also, of course, possible that the problem is something completely different!
Has anyone used MatlabStan with OS X ? If so, is there some necessary step I’m missing?
(Running Stan from the command line, not through Matlab, works, by the way.)
Any thoughts are very much appreciated!
best wishes,
Raghu
Raghuveer Parthasarathy
Group web page: http://physics.uoregon.edu/~raghu/
Blog: http://eighteenthelephant.wordpress.com/
Associate Professor
Department of Physics
1274 University of Oregon
Eugene, OR 97403-1274
(541) 346-2933 -- office
Thanks!
emiruz
January 24, 2020, 5:15pm
2
From the output it looks to me that stanc is not on PATH. Hence it’s not able to just run it from a new shell. I think you can solve this by adding the cmdstan bin folder to your “Environment variables” in Windows.
cmdstan/bin is in the path.
output from cmd:
stanc --version
stanc acfb4612 (Win32)
Hi rainfern, I am having the exact same issue (except on Mac OS). Have you figured out a fix yet? Thanks!
I just switched from cmdstan-2.23.0 to cmdstan-2.17-1. Now there’s no issue anymore. It seems like the new cmdstan doesn’t work well with MatlabStan, which hasn’t been updated for quite a while.
2 Likes
I am running cmdstan in Matlab R2019b on a Mac OS. Switching from cmdstan-2.23.0 to cmdstan-2.17-1 solved my problem as well. Thanks Jimmy_Xia!
Whatever matlab stan is expecting as the version, it’s not what the Stanc3 compiler is returning -
reopened this issue: https://github.com/stan-dev/stanc3/issues/443
The 2.23 release is returning this:
bin/stanc --version
stanc3 f556d0d (Unix)
What does MatLabStan expect?
As I can see matlabstan does not support mingw32-make so 2.21 definitely does not work out of the box, at least not on Windows. So 2.22 and 2.23 that both use stanc3 also dont work.
I am not sure if we want to change the version output back. The original reason of why we added the 3 to the version number in the --version output is that both STANC2 and stanc3 binaries were named bin/stanc. That reason is not there right now, that is true.
mitzimorris:
stanc3 f556d0d (Unix)
That is probably something we missed during the release (this should say stanc3 v2.23 (Unix)
). That is how it was for 2.22.
If we changed the version output back, both would say
stanc v2.23 (Unix)
but they are not the same. Stanc3 has additional signatures along with other differences: Changes from stanc2 · stan-dev/stanc3 Wiki · GitHub
So I dont think they should both output the same version.
Unfortunately, I think the best solution would be for someone to fork the matlabstan repo and fix this issue along with the mingw32-make thing. One easy trick to make 2.22/2.23 work is using stanc2 (see Potential solutions for the problems of using MatlabStan in Windows systems · Issue #57 · brian-lau/MatlabStan · GitHub )
I can assist if help is needed but my Matlab/Octave skills are stuck in my undergrad years and I dont plan on reviving them anytime soon :)
2 Likes
@serban-nicusor - is this something that needs to go into the release script?
I ran into the same issue. For anyone interested, an ugly workaround is to comment out the function stan_version()
in StanModel.m
and replace it with
function ver = stan_version(self)
ver = [2 26 1];
end
for version stanc3 v2.26.1 (Unix)
.
1 Like