-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.m
72 lines (66 loc) · 2.25 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
% Use matlab package manager to install requirements.txt
USE_MPM = false;
% Specify path to matlab-library
MATLABLIB = fullfile(getenv('PI_HOME'),'software','matlab','matlab-library');
USE_MATLAB_LIBRARY = true;
if(USE_MPM)
if(exist('mpm'))
disp('Invoking Matlab Package Manager')
else
disp('Installing Matlab Package Manager');
disp('git clone https://github.com/mobeets/mpm.git external/mpm');
end
disp('Installing package dependencies to external/.')
PYTHON_EXE = '/usr/bin/python';
MPM_INSTALL_DIR = [pwd filesep 'external'];
try
mpm -r requirements.txt
mpm_paths(MPM_INSTALL_DIR);
catch me
disp(me)
warning('Could not install packages in requirements.txt. Please install them manually to external/ or add pre-existing packages to your path');
end
MATLABLIB = [pwd filesep 'external'];
end
if(USE_MATLAB_LIBRARY)
if(~exist(MATLABLIB,'dir'))
warning('Edit setup.m and set `MATLABLIB` to path to matlab-library');
% disp('To get matlab-library');
% disp('git clone [email protected]:TheEtkinLab/matlab-library.git');
% disp('Then follow instructions within matlab-library');
else
addpath(genpath(fullfile(MATLABLIB,'lib','ArgUtils')));
addpath(genpath(fullfile(MATLABLIB,'lib','BrewerMap')));
addpath(genpath(fullfile(MATLABLIB,'lib','gramm')));
addpath(genpath(fullfile(MATLABLIB,'test','matlab-xunit')));
end
end
% Install submodule if missing
if(exist('ggmClass') & exist('ggmClass/setup.m','file'))
warning('off')
addpath('ggmClass');
addpath('ggmClass/external');
run('ggmClass/setup.m');
warning('on');
else
warning('ggmClass package is missing');
disp('Attempting to download submodule ...');
system('git submodule update --init ggmClass');
warning('off');
run('ggmClass/setup.m');
warning('on');
end
% Install submodule if missing
if(exist('connectivity-diagnostics') & exist('connectivity-diagnostics/startup.m','file'))
addpath('connectivity-diagnostics')
if(exist('connectivity-diagnostics/startup.m'))
run('connectivity-diagnostics/startup.m');
end
else
warning('connectivity-diagnostics package is missing')
disp('Attempting to download submodule ...');
system('git submodule update --init connectivity-diagnostics');
warning('off');
run('connectivity-diagnostics/startup.m');
warning('on');
end