Skip to content

Commit

Permalink
MATLAB in Windows: set NO_SSIZE_T for METIS
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 30, 2023
1 parent 8473668 commit 1c95f6e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
5 changes: 5 additions & 0 deletions KLU/MATLAB/klu_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
d = ['-silent ' d] ;
end

if (ispc)
% MSVC does not define ssize_t
d = [d ' -DNO_SSIZE_T'] ;
end

fprintf ('Compiling KLU ') ;
kk = 0 ;

Expand Down
5 changes: 5 additions & 0 deletions ParU/MATLAB/paru_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
% use all of CHOLMOD except for the Modify module
flags = [flags ' -DNMODIFY -DBLAS64' ] ;

if (ispc)
% MSVC does not define ssize_t
flags = [flags ' -DNO_SSIZE_T'] ;
end

suitesparse_src = { ...
'../../SuiteSparse_config/SuiteSparse_config', ...
'../../AMD/Source/amd_l1', ...
Expand Down
18 changes: 4 additions & 14 deletions SPQR/MATLAB/spqr_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
v = version ;
fprintf ('Compiling SuiteSparseQR on MATLAB Version %s\n', v);

try
% ispc does not appear in MATLAB 5.3
pc = ispc ;
mac = ismac ;
catch %#ok
% if ispc fails, assume we are on a Windows PC if it's not unix
pc = ~isunix ;
mac = 0 ;
end

flags = '' ;
is64 = (~isempty (strfind (computer, '64'))) ;
if (is64)
Expand All @@ -49,7 +39,7 @@
flags = ['-silent ' flags] ;
end

if (pc)
if (ispc)
% MSVC does not define ssize_t
flags = [flags ' -DNO_SSIZE_T'] ;
end
Expand All @@ -76,7 +66,7 @@
% find the LAPACK and BLAS libraries, which is a real portability nightmare.
% The correct option is highly variable and depends on the MATLAB version.

if (pc)
if (ispc)
% BLAS/LAPACK functions have no underscore on Windows
flags = [flags ' -DBLAS_NO_UNDERSCORE'] ;
if (verLessThan ('matlab', '6.5'))
Expand Down Expand Up @@ -115,7 +105,7 @@
% GPU not yet supported for the spqr MATLAB mexFunction
% flags = [flags ' -DSPQR_HAS_CUDA'] ;

if (~(pc || mac))
if (~(ispc || ismac))
% for POSIX timing routine
lib = [lib ' -lrt'] ;
end
Expand Down Expand Up @@ -440,7 +430,7 @@
% SuiteSparseQR mexFunctions
spqr_mex_cpp_src = { 'spqr', 'spqr_qmult', 'spqr_solve', 'spqr_singletons' } ;

if (pc)
if (ispc)
obj_extension = '.obj' ;
else
obj_extension = '.o' ;
Expand Down
20 changes: 8 additions & 12 deletions UMFPACK/MATLAB/umfpack_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,16 @@
flags = ['-silent ' flags] ;
end

v = version ;
try
% ispc does not appear in MATLAB 5.3
pc = ispc ;
mac = ismac ;
catch
% if ispc fails, assume we are on a Windows PC if it's not unix
pc = ~isunix ;
mac = 0 ;
if (ispc)
% MSVC does not define ssize_t
flags = [flags ' -DNO_SSIZE_T'] ;
end

v = version ;

fprintf ('Compiling UMFPACK for MATLAB Version %s\n', v) ;

if (pc)
if (ispc)
obj = 'obj' ;
else
obj = 'o' ;
Expand All @@ -62,7 +58,7 @@
% This is exceedingly ugly. The MATLAB mex command needs to be told where to
% find the LAPACK and BLAS libraries, which is a real portability nightmare.

if (pc)
if (ispc)
% BLAS/LAPACK functions have no underscore on Windows
flags = [flags ' -DBLAS_NO_UNDERSCORE'] ;
if (verLessThan ('matlab', '7.5'))
Expand Down Expand Up @@ -91,7 +87,7 @@
flags = [flags ' -DBLAS32'] ;
end

if (~(pc || mac))
if (~(ispc || ismac))
% for POSIX timing routine
lapack = [lapack ' -lrt'] ;
end
Expand Down

0 comments on commit 1c95f6e

Please sign in to comment.