1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
function colamd_make
%COLAMD_MAKE compiles COLAMD2 and SYMAMD2 for MATLAB
%
% Example:
% colamd_make
%
% See also colamd, symamd
% COLAMD, Copyright (c) 1998-2022, Timothy A. Davis, and Stefan Larimore.
% SPDX-License-Identifier: BSD-3-clause
% Developed in collaboration with J. Gilbert and E. Ng.
% Acknowledgements: This work was supported by the National Science Foundation,
% under grants DMS-9504974 and DMS-9803599.
details = 0 ; % 1 if details of each command are to be printed
d = '' ;
if (~isempty (strfind (computer, '64')))
d = '-largeArrayDims' ;
end
% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
if (~verLessThan ('matlab', '8.3.0'))
d = ['-silent ' d] ;
end
if (ispc)
% disable the SuiteSparse_config timer
d = ['-DNTIMER ' d] ;
end
src = '../Source/colamd_l.c ../../SuiteSparse_config/SuiteSparse_config.c' ;
cmd = sprintf ( ...
'mex -O %s -I../../SuiteSparse_config -I../Include -output ', d) ;
s = [cmd 'colamd2mex colamdmex.c ' src] ;
if (~(ispc || ismac))
% for POSIX timing routine
s = [s ' -lrt'] ;
end
if (details)
fprintf ('%s\n', s) ;
end
eval (s) ;
s = [cmd 'symamd2mex symamdmex.c ' src] ;
if (~(ispc || ismac))
% for POSIX timing routine
s = [s ' -lrt'] ;
end
if (details)
fprintf ('%s\n', s) ;
end
eval (s) ;
fprintf ('COLAMD2 and SYMAMD2 successfully compiled.\n') ;
|