-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_cmextools.m
45 lines (40 loc) · 1.04 KB
/
install_cmextools.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
% This file is part of Tencalc.
%
% Copyright (C) 2012-21 The Regents of the University of California
% (author: Dr. Joao Hespanha). All rights reserved.
fprintf('Seeting up path:\n');
home=[fileparts(which('install_cmextools')),'/lib'];
folders={home};
s=path;
if ispc
old=regexp(s,'[^;]*cmextools.lib[^/;]*','match');
else
old=regexp(s,'[^:]*cmextools.lib[^/:]*','match');
end
if ~isempty(old)
fprintf(' removing from path:\n');
disp(old')
rmpath(old{:})
end
fprintf(' adding to path:\n');
addpath(folders{:});
disp(folders)
fprintf(' saving path...');
try
savepath;
catch me
fprintf('ATTENTION: unable to save path. This was probably caused because of insufficient permissions. Either change the permissions of your ''matlabroot'' folder or add following strings to the matlab path:');
disp(folders)
rethrow(me)
end
fprintf('done with path!\n\n');
if ispc
fprintf('Looking for compiler:\n');
if ispc
cmd='cl.exe';
else
cmd='gcc';
end
system_path(cmd);
end
fprintf('done!\n');