-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall_tenscalc.m
46 lines (39 loc) · 1.34 KB
/
install_tenscalc.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
% 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_tenscalc')),'/lib'];
folders={home;[home,'/csparse']};
s=path;
if ispc
old=regexp(s,'[^;]*(tenscalc.lib.csparse|tenscalc.lib)[^/;]*','match');
else
old=regexp(s,'[^:]*(tenscalc.lib.csparse|tenscalc.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');
fprintf('Compiling...\n');
compileInstructionsTable;
fprintf('done!\n');
pth=findSuiteSparse();
if isempty(pth.include_paths)
fprintf('The umfpack not installed or not in the path, ''umfpack'' option will not be available. This should not be a problem. However, if you have umfpack installed add ''SuiteSparse/UMFPACK/MATLAB/'' to your matlab path\n');
else
fprintf('umfpack found at \"%s\"\n',pth)
end