~ubuntu-branches/ubuntu/natty/suitesparse/natty

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/cs_install.m

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function cs_install (do_pause)
 
2
%CS_INSTALL: compile and install CXSparse for use in MATLAB.
 
3
%   Your current working directory must be CXSparse/MATLAB in order to use this
 
4
%   function.
 
5
%   
 
6
%   The directories
 
7
%
 
8
%       CXSparse/MATLAB/CSparse
 
9
%       CXSparse/MATLAB/Demo
 
10
%       CXSparse/MATLAB/UFget
 
11
%
 
12
%   are added to your MATLAB path (see the "pathtool" command to add these to
 
13
%   your path permanently, for future MATLAB sessions).
 
14
%
 
15
%   Next, the MATLAB CXSparse demo program, CXSparse/MATLAB/cs_demo is executed.
 
16
%   To run the demo with pauses so you can see the results, use cs_install(1).
 
17
%   To run the full MATLAB test programs for CXSparse, run testall in the
 
18
%   Test directory.
 
19
%
 
20
%   Example:
 
21
%       cs_install          % install and run demo with no pauses
 
22
%       cs_install(1)       % install and run demo with pauses
 
23
%
 
24
%   See also: cs_demo
 
25
%
 
26
%   Copyright 2006-2007, Timothy A. Davis.
 
27
%   http://www.cise.ufl.edu/research/sparse
 
28
 
 
29
fprintf ('Compiling and installing CXSparse\n') ;
 
30
if (nargin < 1)
 
31
    do_pause = 0 ;
 
32
end
 
33
 
 
34
if (do_pause)
 
35
    input ('Hit enter to continue: ') ;
 
36
end
 
37
addpath ([pwd filesep 'CSparse']) ;
 
38
addpath ([pwd filesep 'Demo']) ;
 
39
 
 
40
v = getversion ;
 
41
if (v >= 7.0)
 
42
    addpath ([pwd filesep 'UFget']) ;
 
43
else
 
44
    fprintf ('UFget not installed (MATLAB 7.0 or later required)\n') ;
 
45
end
 
46
 
 
47
cd ('CSparse') ;
 
48
cs_make (1) ;
 
49
cd ('../Demo') ;
 
50
cs_demo (do_pause)
 
51
 
 
52
%-------------------------------------------------------------------------------
 
53
function [v,pc] = getversion
 
54
% determine the MATLAB version, and return it as a double.
 
55
% only the primary and secondary version numbers are kept.
 
56
% MATLAB 7.0.4 becomes 7.0, version 6.5.2 becomes 6.5, etc.
 
57
v = version ;
 
58
t = find (v == '.') ;
 
59
if (length (t) > 1)
 
60
    v = v (1:(t(2)-1)) ;
 
61
end
 
62
v = str2double (v) ;
 
63
try
 
64
    % ispc does not appear in MATLAB 5.3
 
65
    pc = ispc ;
 
66
catch
 
67
    % if ispc fails, assume we are on a Windows PC if it's not unix
 
68
    pc = ~isunix ;
 
69
end