-
Notifications
You must be signed in to change notification settings - Fork 7
/
de_deploy.m
56 lines (45 loc) · 1.47 KB
/
de_deploy.m
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
function de_deploy(varargin)
% DE_DEPLOY Deploy the binary command line interface of the VLB-deteval
% Copyright (C) 2018 Karel Lenc
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
de_setup();
opts.verbose = false;
opts = vl_argparse(opts, varargin);
target_dir = fullfile(de_path, 'bin');
vl_xmkdir(target_dir);
helpstr = evalc('help de');
helpstr = strrep(helpstr, '<strong>de</strong>', 'bin/de_run.sh MCRPATH');
helpstr = strrep(helpstr, ' ', '');
helpstr = strrep(helpstr, ' `', '`');
fd = fopen(fullfile(target_dir, 'README.md'), 'w');
fprintf(fd, '#%s', helpstr);
fclose(fd);
addargs = vl_deps();
if opts.verbose
addargs{end+1} = '-v';
end
% Add all datasets, as they are called based on a string
dsets = utls.listfiles(fullfile(vlb_path(), 'matlab', '+dset', '*.m'), ...
'keepext', true, 'fullpath', true);
for di = 1:numel(dsets)
addargs{end+1} = '-a';
addargs{end+1} = dsets{di};
end
mcc('-m', 'de.m', '-d', target_dir, '-o', 'de', addargs{:});
end
function depargs = vl_deps()
archs = struct();
archs.mexw64 = '*.dll'; archs.mexw32 = '*.dll';
archs.mexmaci64 = '*.dylib'; archs.mexmaci32 = '*.dylib';
archs.mexa64 = '*.so'; archs.mexaglx = '*.so';
depargs = {};
mexdir = fullfile(vl_root, 'toolbox', 'mex', mexext);
libs = dir(fullfile(mexdir, archs.(mexext)));
for li = 1:numel(libs)
depargs{end+1} = '-a';
depargs{end+1} = fullfile(mexdir, libs(li).name);
end
end