Home > RAVEN > install.m

install

PURPOSE ^

install

SYNOPSIS ^

function install()

DESCRIPTION ^

 install
   Lets the user choose a path for libSBML and Mosek, and checks that
   everything seems to be working. The paths to RAVEN Toolbox, libSBML and
   Mosek are then stored in the Matlab path list  

   Usage: install()

   Rasmus Agren, 2013-03-05

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function install()
0002 % install
0003 %   Lets the user choose a path for libSBML and Mosek, and checks that
0004 %   everything seems to be working. The paths to RAVEN Toolbox, libSBML and
0005 %   Mosek are then stored in the Matlab path list
0006 %
0007 %   Usage: install()
0008 %
0009 %   Rasmus Agren, 2013-03-05
0010 %
0011 
0012 %Get the directory of this file
0013 [ST I]=dbstack('-completenames');
0014 ravenDir=fileparts(ST(I).file);
0015 
0016 %Choose the Mosek folder
0017 mosekDir=uigetdir('','Select the Mosek home directory');
0018 mosekDir=fullfile(mosekDir,'6','toolbox','r2009b');
0019 if ~exist(fullfile(mosekDir,'mosekopt.m'),'file')
0020     throw(MException('','Not the correct MOSEK directory'));
0021 end
0022 
0023 %Choose the libSBML folder
0024 sbmlDir=uigetdir('','Select the libSBML home directory');
0025 sbmlDir=fullfile(sbmlDir,'bindings','matlab');
0026 if ~exist(fullfile(sbmlDir,'TranslateSBML.m'),'file')
0027     if exist(fullfile(sbmlDir,'matlab','TranslateSBML.m'),'file')
0028         sbmlDir=fullfile(sbmlDir,'matlab');
0029     else
0030         throw(MException('','Not the correct libSBML directory'));
0031     end
0032 end
0033 
0034 %Add the folders to the PATH
0035 addpath(ravenDir);
0036 addpath(mosekDir);
0037 addpath(sbmlDir);
0038 savepath
0039 
0040 %Test Mosek
0041 a=optimset();
0042 if isfield(a,'TolFun')
0043     throw(MException('','Wrong path list for Mosek'));
0044 end
0045 
0046 excelFile=fullfile(ravenDir,'tutorial','empty.xlsx');
0047 xmlFile=fullfile(ravenDir,'tutorial','empty.xml');
0048 try
0049     SBMLFromExcel(excelFile,xmlFile,false,false);
0050 catch
0051     if ispc==1
0052         fprintf('ERROR: Could not import from Excel. Some functionality of the RAVEN Toolbox will not be available\n');
0053     else
0054         fprintf('ERROR: Could not import from Excel. This functionality uses Excel COM server, which works best for the Windows version of Matlab. Some functionality of the RAVEN Toolbox will not be available\n');
0055     end
0056 end
0057 try
0058     smallModel=importModel(xmlFile);
0059 catch
0060     fprintf('ERROR: Could not use libSBML. Some functionality of the RAVEN Toolbox will not be available\n');
0061 end
0062 try
0063     sol=solveLP(smallModel);
0064 catch
0065     fprintf('ERROR: Could not use Mosek. Some functionality of the RAVEN Toolbox will not be available\n');
0066 end
0067 
0068 %Everything is hunky dory
0069 fprintf('INSTALLATION OF THE RAVEN TOOLBOX v1.02 COMPLETED\n');
0070 end

Generated on Tue 23-Apr-2013 15:18:37 by m2html © 2005