~ubuntu-branches/ubuntu/hardy/suitesparse/hardy

« back to all changes in this revision

Viewing changes to CHOLMOD/MATLAB/cholmod_make.m

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere, Rafael Laboissiere, Ondrej Certik
  • Date: 2008-02-21 14:46:50 UTC
  • mfrom: (1.1.2 upstream) (5.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080221144650-tgeppgj0t7s759i8
Tags: 3.1.0-3
[ Rafael Laboissiere ]
* Upload to unstable

[ Ondrej Certik ]
* XS-DM-Upload-Allowed: yes field added
* Ondrej Certik added to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
details = 0 ;       % 1 if details of each command are to be printed
35
35
 
36
 
[v,pc] = getversion ;
 
36
v = getversion ;
 
37
try
 
38
    % ispc does not appear in MATLAB 5.3
 
39
    pc = ispc ;
 
40
catch
 
41
    % if ispc fails, assume we are on a Windows PC if it's not unix
 
42
    pc = ~isunix ;
 
43
end
37
44
 
38
45
d = '' ;
39
46
if (~isempty (strfind (computer, '64')))
89
96
    include = ['-DNPARTITION ' include] ;
90
97
end
91
98
 
 
99
 
 
100
%-------------------------------------------------------------------------------
 
101
% BLAS option
 
102
%-------------------------------------------------------------------------------
 
103
 
 
104
% This is exceedingly ugly.  The MATLAB mex command needs to be told where to
 
105
% fine the LAPACK and BLAS libraries, which is a real portability nightmare.
 
106
 
92
107
if (pc)
93
108
    if (v < 6.5)
94
 
        % MATLAB 6.1 and earlier: use the version supplied here
95
 
        lapack = 'lcc_lib/libmwlapack.lib' ;
96
 
        fprintf ('Using %s.  If this fails with dgemm and others\n', lapack) ;
97
 
        fprintf ('undefined, then edit cholmod_make.m and modify the') ;
98
 
        fprintf (' statement:\nlapack = ''%s'' ;\n', lapack) ;
 
109
        % MATLAB 6.1 and earlier: use the version supplied here
 
110
        lapack = 'lcc_lib/libmwlapack.lib' ;
 
111
    elseif (v < 7.5)
 
112
        lapack = 'libmwlapack.lib' ;
99
113
    else
100
 
        lapack = 'libmwlapack.lib' ;
 
114
        lapack = 'libmwlapack.lib libmwblas.lib' ;
101
115
    end
102
116
else
103
 
    % For other systems, mex should find lapack on its own, but this has been
104
 
    % broken in MATLAB R2007a; the following is now required.
105
 
    lapack = '-lmwlapack' ;
 
117
    if (v < 7.5)
 
118
        lapack = '-lmwlapack' ;
 
119
    else
 
120
        lapack = '-lmwlapack -lmwblas' ;
 
121
    end
106
122
end
107
123
 
 
124
%-------------------------------------------------------------------------------
 
125
 
108
126
include = strrep (include, '/', filesep) ;
109
127
 
110
128
amd_src = { ...
337
355
eval (s) ;
338
356
 
339
357
%-------------------------------------------------------------------------------
340
 
function [v,pc] = getversion
 
358
function v = getversion
341
359
% determine the MATLAB version, and return it as a double.
342
 
% only the primary and secondary version numbers are kept.
343
 
% MATLAB 7.0.4 becomes 7.0, version 6.5.2 becomes 6.5, etc.
344
 
v = version ;
345
 
t = find (v == '.') ;
346
 
if (length (t) > 1)
347
 
    v = v (1:(t(2)-1)) ;
348
 
end
349
 
v = str2double (v) ;
350
 
try
351
 
    % ispc does not appear in MATLAB 5.3
352
 
    pc = ispc ;
353
 
catch
354
 
    % if ispc fails, assume we are on a Windows PC if it's not unix
355
 
    pc = ~isunix ;
356
 
end
357
 
 
 
360
v = sscanf (version, '%d.%d.%d') ;
 
361
v = 10.^(0:-1:-(length(v)-1)) * v ;