1+ function checkMASHmex()
2+
3+ % compile molecule localization method Schmied2012
4+ if exist(' forloop' ,' file' )~=3
5+ cd(fileparts(which(' forloop.c' )));
6+ try
7+ mex(' forloop.c' );
8+ catch err
9+ dispMatlabErr(err );
10+ end
11+ end
12+
13+ % compile image filters
14+ % if exist('FilterArray','file')~=3
15+ % pname = fileparts(which('FilterArray.c'));
16+ % % set runtime library path for LINUX
17+ % if strcmp(computer,'GLNXA86') || strcmp(computer,'GLNXA64')
18+ % system(['LD_LIBRARY_PATH=$LD_LIBRARY_PATH:',matlabroot,filesep,...
19+ % 'glnxa64:',matlabroot,filesep,'sys',filesep,'os',filesep,...
20+ % 'glnxa64']);
21+ % end
22+ % if strcmp(computer,'PCWIN') || strcmp(computer,'GLNX86') % 32bit OS
23+ % runtimefolder = 'runtime32';
24+ % libflag = '-lITASL32';
25+ %
26+ % elseif strcmp(computer,'PCWIN64') || strcmp(computer,'GLNX64') % 64bit OS
27+ % runtimefolder = 'runtime64';
28+ % libflag = '-lITASL64';
29+ % end
30+ % cd([pname,filesep,'..',filesep,runtimefolder]);
31+ % try
32+ % mex('-R2018a',[pname,filesep,'FilterArray.c'],...
33+ % ['-L',pname,filesep,'lib'],libflag);
34+ % catch err
35+ % dispMatlabErr(err);
36+ % end
37+ % end
38+
39+ % compile SIF file import
40+ if exist(' SIFImport' ,' file' )~=3
41+
42+ % libraries unavailable for LINUX
43+ if strcmp(computer ,' GLNXA86' ) || strcmp(computer ,' GLNXA64' ) || ...
44+ strcmp(computer ,' MACI86' ) || strcmp(computer ,' MACI64' )
45+ disp([' import of old versions of SIF files is not supported ' ,...
46+ ' on MacOS and Linux systems' ]);
47+ else
48+ pname = fileparts(which(' SIFImport.c' ));
49+
50+ if strcmp(computer ,' PCWIN' ) || strcmp(computer ,' MACI86' ) % 32bit OS
51+ runtimefolder = ' runtime32' ;
52+ libflag = ' -lITASL32' ;
53+
54+ elseif strcmp(computer ,' PCWIN64' ) || strcmp(computer ,' MACI64' ) % 64bit OS
55+ runtimefolder = ' runtime64' ;
56+ libflag = ' -lITASL64' ;
57+ end
58+ cd([pname ,filesep ,' ..' ,filesep ,runtimefolder ]);
59+ try
60+ mex(' -R2018a' ,[pname ,filesep ,' SIFImport.c' ],...
61+ [' -L' ,pname ,filesep ,' lib' ],libflag );
62+ catch err
63+ dispMatlabErr(err );
64+ end
65+ end
66+ end
67+
68+ % compile SPE file import
69+ if exist(' SPEImport' ,' file' )~=3
70+
71+ % libraries unavailable for LINUX
72+ if strcmp(computer ,' GLNXA86' ) || strcmp(computer ,' GLNXA64' ) || ...
73+ strcmp(computer ,' MACI86' ) || strcmp(computer ,' MACI64' )
74+ disp([' import of SPE files is not supported on MacOS and Linux ' ,...
75+ ' systems' ]);
76+ else
77+ pname = fileparts(which(' SPEImport.c' ));
78+
79+ if strcmp(computer ,' PCWIN' ) % 32bit OS
80+ runtimefolder = ' runtime32' ;
81+ libflag = ' -lITASL32' ;
82+
83+ elseif strcmp(computer ,' PCWIN64' ) % 64bit OS
84+ runtimefolder = ' runtime64' ;
85+ libflag = ' -lITASL64' ;
86+ end
87+ cd([pname ,filesep ,' ..' ,filesep ,runtimefolder ]);
88+ try
89+ mex(' -R2018a' ,[pname ,filesep ,' SPEImport.c' ],...
90+ [' -L' ,pname ,filesep ,' lib' ],libflag );
91+ catch err
92+ dispMatlabErr(err );
93+ end
94+ end
95+ end
96+
97+ % compile DPH training algorithm
98+ if exist(' trainPH' ,' file' )~=3
99+ cd(fileparts(which(' trainPH.c' )));
100+ try
101+ mex - R2018a - O trainPH .c vectop .c
102+ catch err
103+ dispMatlabErr(err );
104+ end
105+ end
106+
107+ % compile Baum-Welch algorithm
108+ if exist(' baumwelch' ,' file' )~=3
109+ cd(fileparts(which(' baumwelch.c' )));
110+ try
111+ mex - R2018a - O baumwelch .c vectop .c fwdbwd .c
112+ catch err
113+ dispMatlabErr(err );
114+ end
115+ end
116+
117+ % compile model error calculation
118+ if exist(' calcmdlconfiv' ,' file' )~=3
119+ cd(fileparts(which(' calcmdlconfiv.c' )));
120+ try
121+ mex - R2018a - O calcmdlconfiv .c vectop .c fwdbwd .c
122+ catch err
123+ dispMatlabErr(err );
124+ end
125+ end
126+
0 commit comments