File tree Expand file tree Collapse file tree 4 files changed +45
-17
lines changed Expand file tree Collapse file tree 4 files changed +45
-17
lines changed Original file line number Diff line number Diff line change 42
42
% CSparse, Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
43
43
% SPDX-License-Identifier: LGPL-2.1+
44
44
45
+ have_octave = (exist (' OCTAVE_VERSION' , ' builtin' ) == 5 ) ;
46
+
45
47
try
46
48
% ispc does not appear in MATLAB 5.3
47
49
pc = ispc ;
50
52
pc = ~isunix ;
51
53
end
52
54
55
+ mexcmd = ' mex'
53
56
if (~isempty (strfind (computer , ' 64' )))
54
57
fprintf (' Compiling CSparse (64-bit)\n ' ) ;
55
- mexcmd = ' mex -largeArrayDims' ;
58
+
59
+ if (~have_octave )
60
+ mexcmd = [mexcmd ' -largeArrayDims' ] ;
61
+ end
56
62
else
57
63
fprintf (' Compiling CSparse (32-bit)\n ' ) ;
58
- mexcmd = ' mex' ;
59
64
end
60
65
61
66
% MATLAB 8.3.0 now has a -silent option to keep 'mex' from burbling too much
62
- if (~verLessThan (' matlab' , ' 8.3.0' ))
63
- mexcmd = [mexcmd ' -silent' ] ;
67
+ if (have_octave )
68
+ mexcmd = [mexcmd ' --silent ' ] ;
69
+ warning(" off" , " Matlab-style short-circuit operation performed for operator |" )
70
+ elseif (~verLessThan (' matlab' , ' 8.3.0' ))
71
+ mexcmd = [mexcmd ' -silent ' ] ;
64
72
end
65
73
66
74
% CSparse source files, in ../../Source, such as ../../Source/cs_add.c.
Original file line number Diff line number Diff line change @@ -31,16 +31,18 @@ function cs_demo (do_pause, matrixpath)
31
31
help cs_demo3
32
32
cs_demo3 (do_pause , matrixpath ) ;
33
33
34
+ addpath(" ./private" )
35
+
34
36
fprintf (' \n\n -------------------------------------------------------\n ' ) ;
35
- help private/ ex_1
37
+ help ex_1
36
38
ex_1
37
39
38
40
fprintf (' \n\n -------------------------------------------------------\n ' ) ;
39
- help private/ ex2
41
+ help ex2
40
42
ex2
41
43
42
44
fprintf (' \n\n -------------------------------------------------------\n ' ) ;
43
- help private/ ex3
45
+ help ex3
44
46
ex3
45
47
46
48
fprintf (' \n All CSparse demos finished.\n ' ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ function cs_test_make (force)
9
9
% CSparse, Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
10
10
% SPDX-License-Identifier: LGPL-2.1+
11
11
12
+ have_octave = (exist (' OCTAVE_VERSION' , ' builtin' ) == 5 ) ;
13
+
12
14
try
13
15
% ispc does not appear in MATLAB 5.3
14
16
pc = ispc ;
@@ -17,12 +19,18 @@ function cs_test_make (force)
17
19
pc = ~isunix ;
18
20
end
19
21
22
+ mexcmd = ' mex'
20
23
if (~isempty (strfind (computer , ' 64' )))
21
24
fprintf (' Compiling CSparse (64-bit)\n ' ) ;
22
- mexcmd = ' mex -largeArrayDims' ;
25
+ if (~have_octave )
26
+ mexcmd = [mexcmd ' -largeArrayDims' ] ;
27
+ end
23
28
else
24
29
fprintf (' Compiling CSparse (32-bit)\n ' ) ;
25
- mexcmd = ' mex' ;
30
+ end
31
+
32
+ if (have_octave )
33
+ warning (" off" , " Octave:possible-matlab-short-circuit-operator" )
26
34
end
27
35
28
36
if (pc )
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ function cs_install (do_pause)
26
26
% Copyright (c) 2006-2022, Timothy A. Davis. All Rights Reserved.
27
27
% SPDX-License-Identifier: LGPL-2.1+
28
28
29
+ have_octave = (exist (' OCTAVE_VERSION' , ' builtin' ) == 5 ) ;
30
+
29
31
fprintf (' Compiling and installing CSparse\n ' ) ;
30
32
if (nargin < 1 )
31
33
do_pause = 0 ;
@@ -37,9 +39,23 @@ function cs_install (do_pause)
37
39
addpath ([pwd ' /CSparse' ]) ;
38
40
addpath ([pwd ' /Demo' ]) ;
39
41
40
- if (verLessThan (' matlab' , ' 8.4' ))
41
- fprintf (' ssget not installed (MATLAB 8.4 or later required)\n ' ) ;
42
+ if (have_octave )
43
+ warning (" off" , " Octave:possible-matlab-short-circuit-operator" )
44
+ install_ssget
42
45
else
46
+ if (verLessThan (' matlab' , ' 8.4' ))
47
+ fprintf (' ssget not installed (MATLAB 8.4 or later required)\n ' ) ;
48
+ else
49
+ install_ssget
50
+ end
51
+ end
52
+
53
+ cd (' CSparse' ) ;
54
+ cs_make (1 ) ;
55
+ cd (' ../Demo' ) ;
56
+ cs_demo (do_pause )
57
+
58
+ function install_ssget ()
43
59
% install ssget, unless it's already in the path
44
60
try
45
61
% if this fails, then ssget is not yet installed
@@ -59,9 +75,3 @@ function cs_install (do_pause)
59
75
fprintf (' ssget not installed\n ' ) ;
60
76
end
61
77
end
62
- end
63
-
64
- cd (' CSparse' ) ;
65
- cs_make (1 ) ;
66
- cd (' ../Demo' ) ;
67
- cs_demo (do_pause )
You can’t perform that action at this time.
0 commit comments