-
Notifications
You must be signed in to change notification settings - Fork 317
/
install.m
129 lines (114 loc) · 5.11 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
% INSTALL Installs the hctsa code package from scratch.
% ------------------------------------------------------------------------------
% Copyright (C) 2020, Ben D. Fulcher <[email protected]>,
% <http://www.benfulcher.com>
%
% If you use this code for your research, please cite the following two papers:
%
% (1) B.D. Fulcher and N.S. Jones, "hctsa: A Computational Framework for Automated
% Time-Series Phenotyping Using Massive Feature Extraction, Cell Systems 5: 527 (2017).
% DOI: 10.1016/j.cels.2017.10.001
%
% (2) B.D. Fulcher, M.A. Little, N.S. Jones, "Highly comparative time-series
% analysis: the empirical structure of time series and their methods",
% J. Roy. Soc. Interface 10(83) 20130048 (2013).
% DOI: 10.1098/rsif.2013.0048
%
% This work is licensed under the Creative Commons
% Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of
% this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send
% a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View,
% California, 94041, USA.
% ------------------------------------------------------------------------------
function install(silentInstall)
if nargin < 1
silentInstall = false;
end
fprintf(1,['This script will set up the Highly Comparative Time-Series ' ...
'Analysis (hctsa) code package from scratch!\n']);
fprintf(1,['We will:' ...
'\n-1- Add the paths needed for the repository,' ...
'\n-2- Check toolboxes,' ...
'\n-3- Compile the external time-series toolboxes for this system.\n\n']);
% ------------------------------------------------------------------------------
% 0. Check that the latest git submodules are loaded (catch22)
% ------------------------------------------------------------------------------
if exist(fullfile(pwd,'Toolboxes','catch22','wrap_Matlab'),'dir')==0
if ~silentInstall
input('You may not have added the git submodule for catch22... Press any key to attempt this now...')
end
system('git submodule update --init --recursive');
end
% ------------------------------------------------------------------------------
%% 1. Add the paths:
% ------------------------------------------------------------------------------
fprintf(1,'-1- Adding paths needed for the repository...\n');
if ~silentInstall
input('<<Press any key to continue>>')
end
try
startup
catch emsg
fprintf(1,'error.\n%s\n',emsg.message);
end
fprintf(1,'\n');
% ------------------------------------------------------------------------------
%% 2. Check the toolboxes:
% ------------------------------------------------------------------------------
fprintf(1,'-2- Checking installation of relevant Matlab Toolboxes...\n');
% Essential:
noStatToolbox = BF_CheckToolbox('statistics_toolbox',true,true);
if noStatToolbox
fprintf(1,'The Statistics and Machine Learning Toolbox is required for hctsa and needs to be installed.\n');
end
% For distributed computing
noDistributedToolbox = BF_CheckToolbox('parallel_computing_toolbox',true,true);
if noDistributedToolbox
fprintf(1,'Matlab''s Parallel Computing Toolbox is required for distributed calculation but is not installed.\n');
end
% Desirable (needed for some hctsa features):
toolboxCodes = {'curve_fitting_toolbox','signal_toolbox','identification_toolbox',...
'wavelet_toolbox','econometrics_toolbox','financial_toolbox'};
flags = zeros(8,1);
names = cell(8,1);
for i = 1:length(toolboxCodes)
[flags(i),names{i}] = BF_CheckToolbox(toolboxCodes{i},true,true);
end
fprintf(1,'%u/%u hctsa-relevant Matlab toolboxes are installed.\n',sum(~flags),length(flags));
if any(flags)
fprintf(1,'For full functionality, please install:\n');
theNo = find(flags);
numNo = length(theNo);
for i = 1:numNo
fprintf(1,'%s\n',names{theNo(i)});
end
else
fprintf(1,'Looking good for Matlab toolbox installation! :)\n');
end
fprintf(1,'\n');
if ~silentInstall
input('<<Press any key to continue>>')
end
% ------------------------------------------------------------------------------
%% 3. Attempt to compile the executables required by the periphery Toolboxes:
% ------------------------------------------------------------------------------
fprintf(1,['\n-2- Compile the binary executables needed for evaluating ' ...
'some operations.\n']);
fprintf(1,['Please make sure that mex is set up with the right compilers for' ...
' this system.\n']);
fprintf(1,['Note that errors here are not the end of the world,\nbut mean that ' ...
'some operations may fail to execute correctly...\n']);
if ~silentInstall
input('<<Press any key to continue>>')
end
cd Toolboxes
compile_mex
cd('../');
%-------------------------------------------------------------------------------
%
fprintf(1,'Hope everything compiled ok?!\n\n');
fprintf(1,['All done! Ready when you are to initiate hctsa analysis\nusing a time-series dataset: ' ...
'e.g.: TS_Init(''INP_test_ts.mat'')\n']);
% Attempt to add a time series
% SQL_Add('ts','INP_test_ts.txt')
end