diff SMALLboxSetup.m @ 133:a4e255cfb113 ivand_dev

CVX added to the list of the 3rd party toolboxes
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Mon, 11 Jul 2011 13:41:00 +0100
parents 850e90bbf4b0
children 31d2864dfdd4 8d866d96f006
line wrap: on
line diff
--- a/SMALLboxSetup.m	Mon Jun 13 15:04:06 2011 +0100
+++ b/SMALLboxSetup.m	Mon Jul 11 13:41:00 2011 +0100
@@ -24,9 +24,9 @@
 FS=filesep;
 
 fprintf('\n ********************************************************************');
-fprintf('\n\n This script will install the SMALLbox Evaluation Framework v.0.4');
+fprintf('\n\n This script will install the SMALLbox Evaluation Framework v.1.1');
 fprintf('\n\n It contains the following toolboxes:');
-fprintf('\n Sparco version 1.2, incorporating Rice Wavelet Toolbox version 2.4');
+fprintf('\n Sparco version 1.2');
 fprintf('\n SPGL1 Toolbox version 1.7 ');
 fprintf('\n SparseLab Toolbox version 2.1');
 fprintf('\n Sparsify Toolbox version 0.4');
@@ -35,6 +35,8 @@
 fprintf('\n OMPSbox version 1');
 fprintf('\n KSVDbox version 13');
 fprintf('\n KSVDSbox version 11');
+fprintf('\n Rice Wavelet toolbox');
+fprintf('\n CVX version 1.21');
 fprintf('\n\n ********************************************************************');
 
 fprintf('\n\n The toolbox will be installed in: ');
@@ -230,6 +232,46 @@
     fprintf('\n ******************************************************************');
     fprintf('\n\n GPSR is already installed');
 end
+%%
+if ~exist('cvx_setup.m','file')
+    fprintf('\n ******************************************************************');
+    fprintf('\n\n Initialising CVX Setup');
+    
+    try
+        CVX_path = [pwd,FS,'toolboxes',FS,'CVX'];
+        machine=computer;
+        if (strcmp(machine,'PCWIN')||strcmp(machine,'PCWIN64'))
+            if exist([CVX_path, FS, 'cvx.zip'],'file'),
+                CVX_zip=[CVX_path, FS,'cvx.zip'];
+            else
+                CVX_zip='http://cvxr.com/cvx/cvx.zip';
+                fprintf('\n\n Downloading toolbox, please be patient\n\n');
+            end
+            unzip(CVX_zip,CVX_path);
+        else
+            if exist([CVX_path, FS, 'cvx.tar.gz'],'file'),
+                CVX_tar=[CVX_path, FS,'cvx.tar.gz'];
+            else
+                CVX_tar='http://cvxr.com/cvx/cvx.tar.gz';
+                fprintf('\n\n Downloading toolbox, please be patient\n\n');
+            end
+            untar(CVX_tar,CVX_path);
+        end
+        cd([CVX_path,FS,'cvx']);
+        fprintf('\n\n Running cvx_setup.m script \n\n');
+        cvx_setup;
+        fprintf('\n\n Ignore the cvx_setup note about adding the path. It is done automatically in SMALLbox  \n\n');
+        CVX_p=genpath(CVX_path);
+        addpath(CVX_p);
+        fprintf('\n CVX Installation Successful\n');
+    catch
+        fprintf('\n CVX Installation Failed');
+    end
+    cd(SMALL_path);
+else
+    fprintf('\n ******************************************************************');
+    fprintf('\n\n CVX is already installed');
+end
 
 %%
 
@@ -258,9 +300,9 @@
             fprintf('\n\n Downloading toolbox, please be patient\n\n');
         end
         unzip(KSVD_zip,[KSVD_path, FS, 'ksvdbox']);
-        cd([KSVD_path, FS, 'ksvdbox', FS, 'private']);
-        make;
-        cd(SMALL_path);
+%         cd([KSVD_path, FS, 'ksvdbox', FS, 'private']);
+%         make;
+%         cd(SMALL_path);
         KSVD_p=genpath(KSVD_path);
         addpath(KSVD_p);
         fprintf('\n KSVDBox and OMPBox Installation Successful\n');
@@ -348,13 +390,19 @@
 else
     fprintf('\n ******************************************************************');
     fprintf('\n\n matlab_midi (http://www.kenschutte.com/midi/) is already installed');
-end 
+end
 
-cd([SMALL_path,FS,'util',FS,'ksvd utils']);
-make
-cd(SMALL_path);
-%%
-cd([SMALL_path, FS, 'util', FS, 'Rice Wavelet Toolbox'])
+%% KSVD utils setup
+
+if ~(exist('addtocols')==3)
+    cd([SMALL_path,FS,'util',FS,'ksvd utils']);
+    make
+    cd(SMALL_path);
+end
+
+%% RWT setup
+if ~(exist('mdwt')==3)
+    cd([SMALL_path, FS, 'util', FS, 'Rice Wavelet Toolbox'])
     fprintf('Compiling the Rice Wavelet Toolbox MEX interfaces...');
     try
         if exist('mdwt'  ,'file')~=3, mex mdwt.c;   end
@@ -365,8 +413,9 @@
     catch
         warning('Could not compile Rice Wavelet Toolbox MEX interfaces.\n');
     end
-cd(SMALL_path);
-
+    cd(SMALL_path);
+end
+%%
 fprintf('\n ******************************************************************');
 fprintf('\n\n Initialising SMALLbox Examples Setup');
 
@@ -396,6 +445,7 @@
 fprintf('\n\n SparseLab: http://sparselab.stanford.edu/   (PLEASE REGISTER SPARSELAB!)');
 fprintf('\n\n Sparsify: http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify.html');
 fprintf('\n\n GPSR: http://www.lx.it.pt/~mtf/GPSR/');
+fprintf('\n\n CVX: http://cvxr.com/cvx/');
 fprintf('\n\n OMPbox and KSVDBox: http://www.cs.technion.ac.il/~ronrubin/\n');