peclayson / ERA_Toolbox

Matlab toolbox for obtaining dependability estimates for ERP measurements
6 stars 1 forks source link

Problem installing toolbox #28

Closed fbarbey closed 3 years ago

fbarbey commented 3 years ago

Whil trying to install the toolbox on my new machine, I get the following error (see screenshot):

Error using fileread (line 18) Filename must not be empty.

Error in era_checkversionsofdeps (line 58) cs_file = fileread(cs_filepath);

Error in era_start (line 201) depvercheck = era_checkversionsofdeps;

Context:

I installed Rtools40 using cmdstanpy: 1) first I installed python on Windows 10 2) I installed cmdstanpy using pip 3) python -m cmdstanpy.install_cxx_toolchain -d "C:\Users\my-username\Documents\MATLAB\ERADependents" 4) python -m cmdstanpy.install_cmdstan -d "C:\Users\my-username\Documents\MATLAB\ERADependents" --compiler

this commands allowed to build cmdstan-2.27.0, After that, I downloaded MatlabStan 0.4.2 and MatlabProcessManager 2.7.0.0 in the ERADependents folder. Finally I tried to run the toolbox in matlab and I got the error below.

Screenshot

image

Your Environment

peclayson commented 3 years ago

Sorry for the slow reply. I'm traveling right now. Can you try updating to the most current version of the toolbox? If that doesn't fix the issue, I'll be able to look into it next week.

Good luck! Peter

peclayson commented 3 years ago

Just wanted to follow up to know whether you were able to successfully install the toolbox.

Peter

fbarbey commented 3 years ago

Hi Peter,

I did not manage unfortunately. I did update the toolbox, but I am hitting the same wall each time. It feels like the toolbox cannot find the reference of the version of Cmdstan

peclayson commented 3 years ago

Okay, next things to check.

Can you verify that you reported your MatlabStan version correctly? You said you downloaded 0.4.2 but the most recent version of MatlabStan is 2.15.1.0.

In your MatlabStan directory, can you check the +mstan/stan_home.m file to verify that the path specified in line 8 points to your cmdstan installation?

d = 'C:\Users\brian\Downloads\cmdstan'; needs to be changes to the location of your cmdstan installation.

Let me know if that helps.

Good luck! Peter

fbarbey commented 3 years ago

hi Peter,

I just updated MatlabStan to 2.15.1.10m, MatlabProcessManager to 0.5.1, and changed the cmdatan installation and still no luck. I get the same error msg :(

peclayson commented 3 years ago

Ok, so I'm not entirely sure what the cmdstan installation looks like when using Python.

The toolbox here is getting stuck just trying to get the version number, but it might be stored differently due to the use of Python for installation.

Let's try this:

In ERA_Toolbox/subroutines/installation/era_checkversionsofdeps.m script comment out lines 58-81 like so...

% cs_filepath = which('cmdstan-guide.tex');
% 
% if ~isempty(cs_filepath)
%     %load the file and pull the version information
%     cs_file = fileread(cs_filepath);
%     C = strsplit(cs_file,'\');
%     str = C{5};
%     c_beg = strfind(str,'{');
%     cs_ver = str(c_beg+1:end-2);
%     
% else
%     cs_filepath = fileparts(which('runCmdStanTests.py'));
%     command = [fullfile(cs_filepath,'bin','stanc') ' --version'];
%     %command = [fullfile(self.stan_home,'bin','stanc') ' --version'];
%     p = processManager('id','stanc version','command',command,...
%         'keepStdout',true,...
%         'printStdout',false,...
%         'pollInterval',0.005);
%     
%     p.block(0.05);
%     
%     str = regexp(p.stdout{1},'\ ','split');
%     cs_ver = str{2}(2:end);
% end

Then change line 87 from cs_found_parts = sscanf(cs_ver,'%d.%d.%d')'; to cs_found_parts = [2,27,0];

What we are doing is just hardcoding in the version of cmdstan into your script. Let me know if this helps :)

Good luck, Peter

fbarbey commented 3 years ago

Hi Peter,

Just to say that it worked out !

Thanks a lot,

Cheers,

Florentine