File: grbmake.m

package info (click to toggle)
suitesparse 1%3A5.12.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 176,720 kB
  • sloc: ansic: 1,193,914; cpp: 31,704; makefile: 6,638; fortran: 1,927; java: 1,826; csh: 765; ruby: 725; sh: 529; python: 333; perl: 225; sed: 164; awk: 35
file content (62 lines) | stat: -rw-r--r-- 2,044 bytes parent folder | download
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
58
59
60
61
62
function grbmake
%GBMAKE compile the GraphBLAS library for statement coverage testing
%
% This function compiles ../Source to create the
% libgraphblas_tcov.so (or *.dylib) library, inserting code code for statement
% coverage testing.  It does not compile the mexFunctions.
%
% See also: grbcover, grbcover_edit

% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0

if (ispc)
    error ('The tests in Tcov are not ported to Windows') ;
end

% copy the GB_rename.h file
copyfile ('../GraphBLAS/rename/GB_rename.h', 'tmp_include/GB_rename.h') ;

% create the include files and place in tmp_include
hfiles = [ dir('../Include/*') ; ...
           dir('../Source/*.h') ; ...
           dir('../lz4/*.h') ; ...
           dir('../lz4/*.c') ; ...
           dir('../Source/Template') ; ...
           dir('../Source/Generated1/*.h') ; ...
           dir('../Source/Generated2/*.h') ; ] ;
count = grbcover_edit (hfiles, 0, 'tmp_include') ;
fprintf ('hfile count: %d\n', count) ;

% create the C files and place in tmp_source
cfiles = [ dir('../Source/*.c') ; ...
           dir('../Source/Generated1/*.c') ; ...
           dir('../Source/Generated2/*.c') ; ...
           dir('GB_cover_finish.c')
           ] ;
count = grbcover_edit (cfiles, count, 'tmp_source') ;
fprintf ('cfile count: %d\n', count) ;

% create the GB_cover_finish.c file and place in tmp_source
f = fopen ('tmp_source/GB_cover_finish.c', 'w') ;
fprintf (f, '#include "GB.h"\n') ;
fprintf (f, 'int64_t GB_cov [GBCOVER_MAX] ;\n') ;
fprintf (f, 'int GB_cover_max = %d ;\n', count) ;
fclose (f) ;

% compile the libgraphblas_tcov.so library

have_octave = (exist ('OCTAVE_VERSION', 'builtin') == 5) ;
if (have_octave)
    need_rename = false ;
else
    need_rename = ~verLessThan ('matlab', '9.10') ;
end

if (need_rename)
    fprintf ('Rename with -DGBRENAME=1\n') ;
    system (sprintf ('make -j%d RENAME="-DGBRENAME=1"', feature ('numcores'))) ;
else
    system (sprintf ('make -j%d', feature ('numcores'))) ;
end