This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
/
setup.m
49 lines (45 loc) · 1.58 KB
/
setup.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
function setup(doCompile, matconvnetOpts)
% SETUP Setup paths, dependencies, etc.
%
% doCompile:: false
% Set to true to compile the libraries
% matconvnetOpts:: struct('enableGpu',false)
% Options for vl_compilenn
if nargin==0,
doCompile = false;
elseif nargin<2,
matconvnetOpts = struct('enableGpu', false);
end
if doCompile && gpuDeviceCount()==0 ...
&& isfield(matconvnetOpts,'enableGpu') && matconvnetOpts.enableGpu,
fprintf('No supported gpu detected! ');
return;
end
addpath(genpath('dataset'));
addpath(genpath('utils'));
addpath(genpath('init'));
% -------------------------------------------------------------------------
% vlfeat
% -------------------------------------------------------------------------
if doCompile,
cmd = 'make -C dependencies/vlfeat/ clean';
if system(cmd),
error('Error while excution: %s', cmd);
end
cmd = sprintf('make -C dependencies/vlfeat/ MEX=%s', ...
fullfile(matlabroot,'bin','mex'));
if system(cmd),
error('Error while excution: %s', cmd);
end
end
run dependencies/vlfeat/toolbox/vl_setup.m
% -------------------------------------------------------------------------
% matconvnet
% -------------------------------------------------------------------------
if doCompile,
run dependencies/matconvnet/matlab/vl_setupnn.m
cd dependencies/matconvnet
vl_compilenn(matconvnetOpts);
cd ../..
end
run dependencies/matconvnet/matlab/vl_setupnn.m