comparison SMALLboxSetup.m @ 1:7750624e0c73 version0.5

(none)
author idamnjanovic
date Thu, 05 Nov 2009 16:36:01 +0000
parents
children b6d8f2c4f5fa
comparison
equal deleted inserted replaced
0:5181bee80bc1 1:7750624e0c73
1 function SMALLboxSetup(varargin)
2 %
3 % SMALLboxSetup
4 %
5 % Will automatically download and install existing toolboxes
6 % on sparse representations and dictionary learning
7 %
8 % For this function an internet connection is required.
9 %
10 % SMALLbox initialisation
11 % Ivan Damnjanovic, Matthew Davies 2009
12
13
14 clc;
15
16 FS=filesep;
17
18 fprintf('\n ********************************************************************');
19 fprintf('\n\n This script will install the SMALLbox Evaluation Framework v.0.4');
20 fprintf('\n\n It contains the following toolboxes:');
21 fprintf('\n Sparco version 1.2, incorporating Rice Wavelet Toolbox version 2.4');
22 fprintf('\n SPGL1 Toolbox version 1.7 ');
23 fprintf('\n SparseLab Toolbox version 2.1');
24 fprintf('\n Sparsify Toolbox version 0.4');
25 fprintf('\n GPSR Toolbox version 5.0');
26 fprintf('\n OMPbox version 9');
27 fprintf('\n KSVDbox version 10');
28 fprintf('\n\n ********************************************************************');
29
30 fprintf('\n\n The toolbox will be installed in: ');
31 fprintf('\n %s%s\n',pwd,FS);
32 fprintf('\n ********************************************************************');
33 fprintf('\n\n IMPORTANT: To successfully install all toolboxes');
34 fprintf('\n you will need to have MEX setup to compile C files.');
35 fprintf('\n\n If this is not already setup, please type "n" to exit and then ');
36 fprintf('\n run "mex -setup" or type "help mex" in the MATLAB command prompt.');
37 fprintf('\n\n ********************************************************************');
38
39
40 fprintf('\n ********************************************************************');
41 fprintf('\n\n IMPORTANT: YOU MUST HAVE AN INTERNET CONNECTION');
42 fprintf('\n YOU CANNOT INSTALL SMALLBOX WITHOUT ONE!');
43 fprintf('\n\n ********************************************************************');
44 install_ack = input('\n\n Do you wish to continue: ([y]/n)? ','s');
45
46 if strcmp(install_ack,'"n"'),
47 install_ack = 'n';
48 end
49
50 if install_ack == 'n',
51 return;
52 else
53 fprintf('\n\n Installation now beginning...');
54 % fprintf('\n\nFor further information on the toolboxes see SMALLbox documentation\n\n');
55 end
56
57
58
59
60 SMALL_path=pwd;
61 SMALL_p=genpath(SMALL_path);
62 addpath(SMALL_p);
63
64
65 fprintf('\n ******************************************************************');
66 fprintf('\n\n Initialising SPARCO and Rice Wavelet Toolbox Setup');
67
68
69 Sparco_path = [SMALL_path,FS,'toolboxes',FS,'SPARCO'];
70 if exist([Sparco_path, FS, 'sparco-1.2.zip'],'file'),
71 Sparco_zip=[Sparco_path, FS, 'sparco-1.2.zip'];
72 else
73 Sparco_zip='http://www.cs.ubc.ca/labs/scl/sparco/downloads.php?filename=sparco-1.2.zip';
74 fprintf('\n\n Downloading toolbox, please be patient\n\n');
75 end
76 unzip(Sparco_zip,Sparco_path);
77 Sparco_p=genpath(Sparco_path);
78 addpath(Sparco_p);
79 cd(SMALL_path)
80
81
82
83 if exist('curvelab.pdf','file')
84 crvroot = fileparts(which('curvelab.pdf'));
85 addtopath(crvroot,'fdct_usfft_matlab');
86 addtopath(crvroot,'fdct_wrapping_matlab');
87 addtopath(crvroot,'fdct_wrapping_cpp/mex');
88 addtopath(crvroot,'fdct3d/mex');
89 else
90 fprintf(['\nWarning: CurveLab is not in the path. Sparco Problems 50-51 ' ...
91 'will not work.\n\n']);
92 end
93
94 cd([Sparco_path, FS, 'sparco-1.2', FS, 'tools' ,FS, 'rwt'])
95 fprintf('Compiling the Rice Wavelet Toolbox MEX interfaces...');
96 try
97 if exist('mdwt' ,'file')~=3, mex mdwt.c mdwt_r.c; end
98 if exist('midwt' ,'file')~=3, mex midwt.c midwt_r.c; end
99 if exist('mrdwt' ,'file')~=3, mex mrdwt.c mrdwt_r.c; end
100 if exist('mirdwt','file')~=3, mex mirdwt.c mirdwt_r.c; end
101 fprintf('SPARCO Installation Successful!\n');
102 catch
103 warning('Could not compile Rice Wavelet Toolbox MEX interfaces.');
104 end
105 cd(SMALL_path)
106
107
108
109 fprintf('\n ******************************************************************');
110 fprintf('\n\n Initialising SPGL1 Setup');
111
112 try
113 SPGL1_path = [SMALL_path,FS,'toolboxes',FS,'SPGL1'];
114 if exist([SPGL1_path, FS, 'spgl1-1.7.zip'],'file'),
115 SPGL1_zip=[SPGL1_path, FS, 'spgl1-1.7.zip'];
116 else
117 SPGL1_zip='http://www.cs.ubc.ca/labs/scl/spgl1/downloads.php?filename=spgl1-1.7.zip';
118 fprintf('\n\n Downloading toolbox, please be patient\n\n');
119 end
120 unzip(SPGL1_zip,SPGL1_path);
121 SPGL1_p=genpath(SPGL1_path);
122 addpath(SPGL1_p);
123
124
125 cd([SPGL1_path,FS,'spgl1-1.7']);
126 fprintf('Compiling SPGL1 MEX interfaces ...');
127 try
128 spgsetup;
129 fprintf('\n SPGL1 Installation Successful!\n');
130 catch
131 warning('Could not compile SPGL1 MEX interfaces.');
132 end
133 catch
134 fprintf('\n SPGL1 Installation Failed\n');
135 end
136 cd(SMALL_path);
137
138 fprintf('\n ******************************************************************');
139 fprintf('\n\n Initialising SparseLab Setup');
140
141 try
142 SL_path = [pwd,FS,'toolboxes',FS,'SparseLab'];
143 if exist([SL_path, FS, 'SparseLab21-Core.zip'],'file'),
144 SL_zip=[SL_path, FS, 'SparseLab21-Core.zip'];
145 else
146 SL_zip='http://sparselab.stanford.edu/SparseLab_files/Download_files/SparseLab21-Core.zip';
147 fprintf('\n\n Downloading toolbox, please be patient\n\n');
148 end
149 unzip(SL_zip,SL_path);
150 SL_p=genpath(SL_path);
151 addpath(SL_p);
152 fprintf('\n SparseLab Installation Successful!\n');
153 catch
154 fprintf('\n SparseLab Installation Failed\n');
155 cd(SMALL_path);
156 end
157
158
159 fprintf('\n ******************************************************************');
160 fprintf('\n\n Initialising Sparsify Setup');
161
162 try
163 Sparsify_path = [pwd,FS,'toolboxes',FS,'Sparsify'];
164 if exist([Sparsify_path, FS, 'sparsify_0_4.zip'],'file'),
165 Sparsify_zip=[Sparsify_path, FS, 'sparsify_0_4.zip'];
166 else
167 Sparsify_zip='http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify_0_4.zip';
168 fprintf('\n\n Downloading toolbox, please be patient\n\n');
169 end
170 unzip(Sparsify_zip,Sparsify_path);
171 Sparsify_p=genpath(Sparsify_path);
172 addpath(Sparsify_p);
173 fprintf('\n Sparsify Installation Successful\n');
174 catch
175 fprintf('\n Sparsify Installation Failed\n');
176 cd(SMALL_path);
177 end
178
179 fprintf('\n ******************************************************************');
180 fprintf('\n\n Initialising GPSR Setup');
181
182 try
183 GPSR_path = [pwd,FS,'toolboxes',FS,'GPSR'];
184 if exist([GPSR_path, FS, 'GPSR_6.0.zip'],'file'),
185 GPSR_zip=[GPSR_path, FS,'GPSR_6.0.zip'];
186 else
187 GPSR_zip='http://www.lx.it.pt/~mtf/GPSR/GPSR_6.0.zip';
188 fprintf('\n\n Downloading toolbox, please be patient\n\n');
189 end
190 unzip(GPSR_zip,GPSR_path);
191 GPSR_p=genpath(GPSR_path);
192 addpath(GPSR_p);
193 fprintf('\n GPSR Installation Successful\n');
194 catch
195 fprintf('\n GPSR Installation Failed');
196 cd(SMALL_path);
197 end
198
199
200 fprintf('\n ******************************************************************');
201 fprintf('\n\n Initialising OMPbox and KSVDBox Setup');
202
203 try
204 KSVD_path = [pwd,FS,'toolboxes',FS,'KSVD'];
205 if exist([KSVD_path, FS, 'ompbox9.zip'],'file'),
206 omp_zip=[KSVD_path, FS, 'ompbox9.zip'];
207 else
208 omp_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ompbox9.zip';
209 fprintf('\n\n Downloading toolbox, please be patient\n\n');
210 end
211 unzip(omp_zip,[KSVD_path, FS, 'ompbox']);
212
213 cd([KSVD_path, FS, 'ompbox', FS, 'private']);
214 make;
215 cd(SMALL_path);
216
217 if exist([KSVD_path, FS, 'ksvdbox10.zip'],'file'),
218 KSVD_zip=[KSVD_path, FS, 'ksvdbox10.zip'];
219 else
220 KSVD_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ksvdbox10.zip';
221 fprintf('\n\n Downloading toolbox, please be patient\n\n');
222 end
223 unzip(KSVD_zip,[KSVD_path, FS, 'ksvdbox']);
224 cd([KSVD_path, FS, 'ksvdbox', FS, 'private']);
225 make;
226 cd(SMALL_path);
227 KSVD_p=genpath(KSVD_path);
228 addpath(KSVD_p);
229 fprintf('\n KSVDBox and OMPBox Installation Successful\n');
230 catch
231 fprintf('\n KSVDBox and OMPBox Installation Failed');
232 cd(SMALL_path);
233 end
234
235
236
237
238 fprintf('\n ******************************************************************');
239 fprintf('\n\n Initialising SMALLbox Examples Setup');
240
241 % Need to do a bit of temporary housekeeping first.
242 cd(SMALL_path);
243 try
244 cd(['examples',FS,'private']);
245 if exist('addtocols' ,'file')~=3,
246 fprintf('\n Compiling MEX interfaces for SMALL examples \n');
247 make;
248 end
249 fprintf('\n SMALLbox Examples Installation Successful! \n');
250 catch
251 fprintf('\n SMALLbox Examples Installation Failed \n');
252 end
253 cd(SMALL_path);
254
255
256
257 fprintf('\n ******************************************************************');
258 fprintf('\n\n SMALLbox Installation Complete!');
259
260
261 fprintf('\n\n For more information on the installed toolboxes see');
262 fprintf('\n\n Sparco: http://www.cs.ubc.ca/labs/scl/sparco/');
263 fprintf('\n\n SPGL1: http://www.cs.ubc.ca/labs/spgl1/?n=HomePage');
264 fprintf('\n\n SparseLab: http://sparselab.stanford.edu/ (PLEASE REGISTER SPARSELAB!)');
265 fprintf('\n\n Sparsify: http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify.html');
266 fprintf('\n\n GPSR: http://www.lx.it.pt/~mtf/GPSR/');
267 fprintf('\n\n OMPbox and KSVDBox: http://www.cs.technion.ac.il/~ronrubin/\n');
268
269
270 % LIST DEMOS FROM EXAMPLE DIRECTORY...
271
272 demo_ack = input('\n\n Would you like to run a demo: ([y]/n)? ','s');
273
274 if demo_ack == 'n',
275 fprintf('\n Thank you for installing SMALLbox.');
276 fprintf('\n For information on the SMALLbox example scripts');
277 fprintf('\n Please see the examples directory. \n');
278 return;
279 else
280
281 demo_choice = input('\n Enter 1 to run SMALL_solver_test, 2 to run SMALL_solver_test_Audio or q to quit: ','s');
282 switch(demo_choice)
283 case{'1'}
284 fprintf('\n Running SMALL_solver_test problem');
285 SMALL_solver_test;
286 case{'2'}
287 fprintf('\n Running SMALL_solver_test_Audio problem');
288 SMALL_solver_test_Audio;
289 otherwise
290 return;
291 end
292
293 end
294
295
296