-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinstall.m
75 lines (62 loc) · 2.04 KB
/
install.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
67
68
69
70
71
72
73
74
75
%INSTALL Script used to install TVReg on the Windows/MAC/Linux platform.
%
% Compiles the mex files for the TVReg package.
%
% For Linux, tested with the gcc compiler.
%
% See readme.txt for further instructions.
args = '';
com = computer;
if strcmp(com(1:5), 'PCWIN')
% If you want to be able to break the execution of the programs, try to
% set CTRLCBREAK = 1, which uses a non-documented MATLAB API.
% If you do not have libut.lib in your Matlab dir, try CTRLCBREAK = 2.
% Default.
%
CTRLCBREAK=0;
if CTRLCBREAK==0
args = [args ''];
elseif CTRLCBREAK==1
args = [args '-DLIBUT -L"' matlabroot
'\extern\lib\win32\lcc" -llibut'];
elseif CTRLCBREAK==2
args = [args '-DLIBUT -Lexternlib -llibut'];
else
error('Not a valid option for CTRLCBREAK')
end
else % insert any unix compile args here
args = args;
end
if strcmp(com(end-1:end), '64')
args = [args ' -largeArrayDims'];
else
args = [args ' -compatibleArrayDims'];
end
any_error = false;
try
cs = sprintf('mex %s c/tvreg_upn_c.c c/tools.c c/tv_core.c ', args);
eval(cs)
catch ME
any_error= true;
rethrow(ME);
disp('-------------------------------------------------------------------')
disp('You will not be able to use tvreg_upn because the compilation failed.')
disp('You may not have a working compiler installed or mex configured correctly.')
disp('Please check readme.txt for directions.')
end
try
cs = sprintf('mex %s c/tvreg_gpbb_c.c c/tools.c c/tv_core.c ', args);
eval(cs)
catch ME
any_error= true;
rethrow(ME);
disp('-------------------------------------------------------------------')
disp('You will not be able to use tvreg_gpbb because the compilation failed.')
disp('You may not have a working compiler installed or mex configured correctly.')
disp('Please check readme.txt for directions.')
end
if any_error == false
disp('Install completed successfully.')
else
disp('Installation did not complete successfully.')
end