-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.m
93 lines (78 loc) · 2.32 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
% For more information, see <a href="matlab:
% web('http://www.grandmaster.colorado.edu/~parkmh')">Minho Park's Web site</a>.
cd bin
Ver = amgversion;
user = 'Minho Park';
email = 'min.park@nottingham.ac.uk';
cd ..
clc
fprintf(' ********************************************\n')
fprintf('\n')
fprintf(' Matlab Algebraic Multigrid Toolbox %s \n',Ver)
fprintf('\n')
fprintf('%20s %s\n','Written by', user);
fprintf('%13s %s\n','email :',email);
fprintf(' ********************************************\n')
cwd = pwd;
matamgroot = cwd;
% Add path
% Generate amgpath.m file
fid = fopen([pwd filesep 'bin' filesep 'amgpath.m'],'w');
fprintf(fid,'function matamgpath = amgpath\n');
addpath(matamgroot);
addpath(fullfile(matamgroot,'bin'));
fprintf(fid,'matamgpath = ''%s'';\n',matamgroot);
fclose(fid);
savepath;
% Compile mex files
cd(fullfile(cwd,'src'));
copyfile('*.c',fullfile(cwd,'bin'))
cd(fullfile(cwd,'bin'));
fprintf('\n2. Compile mex -O Files\n')
cd([cwd filesep 'bin'])
try
fprintf('Compiling crsrow.c\n')
mex -O crsrow.c
fprintf('Compiling stencil2mat_mex.c\n')
mex -O stencil2mat_mex.c
fprintf('Compiling gs.c\n');
mex -O gs.c
fprintf('Compiling jacobi.c\n');
mex -O jacobi.c
fprintf('Compiling bgs.c\n');
mex -O bgs.c
fprintf('Compiling cr.c\n');
mex -O cr.c
fprintf('Compiling sc.c\n')
mex -O sc.c
fprintf('Compiling sc_positive.c\n')
mex -O sc_positive.c
fprintf('Compiling firstcoloring.c\n')
mex -O firstcoloring.c
fprintf('Compiling secondcoloring.c\n')
mex -O secondcoloring.c
fprintf('Compiling intpsetup.c\n')
mex -O intpsetup.c
fprintf('Compiling amgp_mex.c\n')
mex -O amgp_mex.c
fprintf('Compiling aamgp_mex.c\n')
mex -O aamgp_mex.c
fprintf('Compiling rbamgp_mex.c\n')
mex -O rbamgp_mex.c
fprintf('Compiling length2strong_mex.c\n')
mex -O length2strong_mex.c
fprintf('Compiling aggfirstcoloring.c\n')
mex -O aggfirstcoloring.c
fprintf('Compiling aggsecondcoloring.c\n')
mex -O aggsecondcoloring.c
fprintf('Compiling longrangeamgp_mex.c\n')
mex -O longrangeamgp_mex.c
catch err
cd ..
error('mex -O compile error')
end
fprintf('\n3. Delete Source Files\n')
delete *.c
delete *.h
cd ..
clear all