-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.m
66 lines (65 loc) · 2.33 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CurrentPath = pwd;
try
%% Test if files are compiled in BIF folder
cd('.\Code\_Utils\BIF');
if ispc
CompiledFiles = dir('*.mexw64');
end
if ismac
CompiledFiles = dir('*.mexmaci64');
end
if isunix
CompiledFiles = dir('*.mexglx');
end
if ~isempty(CompiledFiles)
answer = questdlg('Files seems to be already compiled, continue?','Compile?');
end
switch answer
case 'Yes'
answer = questdlg('MATLAB compiler with mex configured for an OpenMP compatible compiler is required to compile functions. These files come bundled for Windows only. Continue?','Compile?');
case 'No'
end
% Handle response
switch answer
case 'Yes'
cd('.\Code\_Utils');
FilesToCompile = dir('*.cpp');
for i = 1:length(FilesToCompile)
switch FilesToCompile(i).name
case 'LocMax3D_thr.cpp'
if ispc
disp('Compiling LocMax3D_thr.cpp');
mex -v COMPFLAGS="$COMPFLAGS /openmp" LocMax3D_thr.cpp
end
if isunix
disp('Compiling LocMax3D_thr.cpp');
mex -v CFLAGS='$CFLAGS -fopenmp' -LDFLAGS='$LDFLAGS -fopenmp' LocMax3D_thr.cpp
end
if ismac
disp('Compiling LocMax3D_thr.cpp');
mex -v CFLAGS='$CFLAGS -fopenmp' -LDFLAGS='$LDFLAGS -fopenmp' LocMax3D_thr.cpp
end
otherwise
disp(['Compiling' FilesToCompile(i).name]);
mex(FilesToCompile(i).name);
end
end
cd(CurrentPath);
cd('.\Code\_Utils\BIF');
disp('compiling oBIFsQuantization');
mex oBIFsQuantization.cpp
cd(CurrentPath);
cd('.\Code\_Utils\shortestpath');
disp('compiling rk4');
mex rk4.c
cd(CurrentPath);
cd('.\Tools\LOBSTER_Annotator\functions\RF\Random_Forests\cartree\mx_files');
disp('Compiling RF');
run('mx_compile_cartree.m');
otherwise
end
catch
disp('Error');
cd(CurrentPath);
end
cd(CurrentPath);