function piro_band_make % piro_band_make compiles PIRO_BAND package for MATLAB. % % Usage : % piro_band_make % % % Copyright 2009, Sivasankaran Rajamanickam, Timothy A. Davis % http://www.cise.ufl.edu/research/sparse details = 0 ; % 1 if details of each command are to be printed d = '' ; if (~isempty (strfind (computer, '64'))) d = '-largeArrayDims' ; end if (ispc) %----------------------------------------------------------------------- % edit this definition, if necessary: lapack = 'libmwlapack.lib' ; %----------------------------------------------------------------------- fprintf ('Using LAPACK library:\n%s\n', lapack) ; fprintf ('If this does not work, edit piro_band_make.m and\n') ; fprintf ('modify the definition of lapack.\n') ; else % For other systems, mex can find lapack on its own. lapack = '-lmwlapack' ; end fprintf('Compiling PIRO_BAND ...') ; include = '-I. -I../Include -I../../UFconfig' ; piro_band_src = { ... '../Source/piro_band_main', ... '../Source/piro_band_blocksize_main', ... '../Source/piro_band_lapack_main', ... '../Source/piro_band_uv_update_main', ... 'piro_band_qr_main', ... 'storeband' } ; piro_band_mex_src = { ... 'piro_band', ... 'piro_band_svd', ... 'piro_band_qr', ... 'storeband', ... 'piro_band_lapack' } ; if (ispc) obj_extension = '.obj' ; include = [include ' -IWindows'] ; else obj_extension = '.o' ; end obj = '' ; for f = piro_band_src f = strrep (f {1}, '/', filesep) ; slash = strfind (f, filesep) ; if (isempty (slash)) slash = 1 ; else slash = slash (end) + 1 ; end o = f (slash:end) ; obj = [obj ' ' o obj_extension] ; % should be except piro_band_main, piro_band_qr_main mainstr = strfind(f, 'main') ; if (isempty (mainstr)) s = sprintf ('mex -DLONG -O %s -c %s.c', include, f); else s = sprintf ('mex -O %s -c %s.c', include, f); end fprintf('.') if (details) fprintf ('%s\n', s) ; end eval (s) ; end % compile each mexFunction for f = piro_band_mex_src s = sprintf('mex -O %s %smex.c -output %s', include, f{1}, f{1}) ; s = [s ' ' obj ' ' lapack ' ' d] ; fprintf('.') if (details) fprintf ('%s\n', s) ; end eval (s) ; end fprintf ('PIRO_BAND successfully compiled.\n') ; piro_band_path = pwd ; addpath (piro_band_path) ; cd ../Test/ piro_band_test_path = pwd ; addpath (piro_band_test_path) ; cd ../MATLAB/ fprintf ('\nThe following paths have been added. You may wish to add \n') ; fprintf ('them permanently, using the MATLAB pathtool command.\n') ; fprintf ('%s\n', piro_band_path) ; fprintf ('%s\n', piro_band_test_path) ; fprintf('\nTo run the basic tests of the mexfunctions cut-and-paste the\n'); fprintf('\ncommands test_piro_band, test_piro_band_svd, test_piro_band_qr,\n') ; fprintf('\ncommands test_piro_band_special,\n') ;