-
Notifications
You must be signed in to change notification settings - Fork 14
/
compile.m
46 lines (42 loc) · 1.46 KB
/
compile.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
%compile mex functions
fprintf('Compiling mexDenseSift\n')
%setup mexDenseSift
fulltext = fileread('./methods/mexDenseSIFT/projectTemplate.h');
if ~ispc
fulltext = strrep(fulltext,'$$DEFINITION$$','#define _LINUX_MAC');
else
fulltext = strrep(fulltext,'$$DEFINITION$$','');
end
fid = fopen('./methods/mexDenseSIFT/project.h','w');
fprintf(fid,'%s',fulltext);
fclose(fid);
mex ./methods/mexDenseSIFT/mexDenseSIFT.cpp ./methods/mexDenseSIFT/Matrix.cpp ./methods/mexDenseSIFT/Vector.cpp -outdir ./methods/mexDenseSIFT/
fprintf('Compiling histtree\n')
mex ./mex/histtree.cxx -outdir ./mex/
fprintf('Compiling hogfeat\n')
mex ./mex/hogfeat.cc -outdir ./mex/
fprintf('Compiling rgbhistogram\n')
mex ./mex/mre_rgbhistogram.cxx -outdir ./mex/
fprintf('Compiling rgblookup\n')
mex ./mex/mre_rgblookup.cxx -outdir ./mex/
fprintf('Compiling mxclassify\n')
mex ./mex/mxclassify.cpp -outdir ./mex/
fprintf('Compiling mxclassify_fast\n')
mex ./mex/mxclassify_fast.cpp -outdir ./mex/
fprintf('Compiling liblinearSVM\n')
%setup rootfolder for compiling liblinear
fulltext = fileread('./methods/liblinear/matlab/Makefile_template');
rootfolder = matlabroot;
rootfolder(rootfolder =='\') = '/';
fulltext = strrep(fulltext,'$$MATLABROOT$$',rootfolder);
fid = fopen('./methods/liblinear/matlab/Makefile','w');
fprintf(fid,'%s',fulltext);
fclose(fid);
cd ./methods/liblinear/matlab/
if ispc
make
else
!make
end
cd ../../../
fprintf('Complete!\n')