1 | %ATMEXALL builds all AT platform deendent mex-files from C-sources |
---|
2 | % On UNIX platform, the GNU gcc compiler must be installed and |
---|
3 | % properly configured. |
---|
4 | % On Windows, Microsoft Visual C++ is required |
---|
5 | |
---|
6 | % Modification by Laurent S. Nadolski, April 6th, 2007 |
---|
7 | % For Linux platform -ldl is need (personal laptop) |
---|
8 | % PLATFORMOPTION = ['-ldl -D',computer,' ']; |
---|
9 | |
---|
10 | StartDir = pwd; |
---|
11 | ATROOT = atroot; |
---|
12 | |
---|
13 | % Navigate to the directory that contains pass-methods |
---|
14 | cd(ATROOT) |
---|
15 | cd simulator |
---|
16 | cd element |
---|
17 | PASSMETHODDIR = pwd; |
---|
18 | disp(['Current directory: ',PASSMETHODDIR]); |
---|
19 | mexpassmethod('all'); |
---|
20 | |
---|
21 | |
---|
22 | % User passmethods |
---|
23 | cd user |
---|
24 | disp(['Current directory: ', pwd]); |
---|
25 | mexuserpassmethod('all'); |
---|
26 | |
---|
27 | |
---|
28 | % Navigate to the directory that contains tracking functions |
---|
29 | cd(ATROOT) |
---|
30 | cd simulator |
---|
31 | cd track |
---|
32 | |
---|
33 | disp(['Current directory:', pwd]); |
---|
34 | |
---|
35 | switch computer |
---|
36 | case 'SOL2' |
---|
37 | PLATFORMOPTION = ['-D',computer,' ']; |
---|
38 | case 'GLNX86' |
---|
39 | PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Laurent April 6th, 2007 |
---|
40 | case 'PCWIN' |
---|
41 | PLATFORMOPTION = ['-D',computer,' ']; |
---|
42 | case 'MACI64' |
---|
43 | PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' ']; |
---|
44 | otherwise |
---|
45 | error('Platform not defined'); |
---|
46 | end |
---|
47 | |
---|
48 | MEXCOMMAND = ['mex ',PLATFORMOPTION,'atpass.c']; |
---|
49 | disp(MEXCOMMAND); |
---|
50 | eval(MEXCOMMAND); |
---|
51 | |
---|
52 | % Navigate to the directory that contains some accelerator physics functions |
---|
53 | cd(ATROOT) |
---|
54 | cd atphysics |
---|
55 | disp(['Current directory:', pwd]); |
---|
56 | |
---|
57 | % findmpoleraddiffmatrix.c |
---|
58 | disp(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']); |
---|
59 | |
---|
60 | %eval(['mex findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']); |
---|
61 | eval(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']); |
---|
62 | |
---|
63 | % ADD 'MEXING' instructions for other C files |
---|
64 | disp('ALL mex-files created successfully') |
---|
65 | clear ATROOT PASSMETHODDIR WARNMSG PLATFORMOPTION MEXCOMMAND |
---|
66 | cd(StartDir); |
---|