source: MML/trunk/at/atmexall.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.8 KB
Line 
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
10StartDir = pwd;
11ATROOT = atroot;
12
13% Navigate to the directory that contains pass-methods
14cd(ATROOT)
15cd simulator
16cd element
17PASSMETHODDIR = pwd;
18disp(['Current directory: ',PASSMETHODDIR]);
19mexpassmethod('all');
20
21
22% User passmethods
23cd user
24disp(['Current directory: ', pwd]);
25mexuserpassmethod('all');
26
27
28% Navigate to the directory that contains tracking functions
29cd(ATROOT)
30cd simulator
31cd track
32
33disp(['Current directory:', pwd]);
34
35switch 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');
46end
47
48MEXCOMMAND = ['mex ',PLATFORMOPTION,'atpass.c'];
49disp(MEXCOMMAND);
50eval(MEXCOMMAND);
51
52% Navigate to the directory that contains some accelerator physics functions
53cd(ATROOT)
54cd atphysics
55disp(['Current directory:', pwd]);
56
57% findmpoleraddiffmatrix.c
58disp(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
59
60%eval(['mex findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
61eval(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
62
63% ADD 'MEXING' instructions for other C files
64disp('ALL mex-files created successfully')
65clear ATROOT PASSMETHODDIR WARNMSG PLATFORMOPTION MEXCOMMAND
66cd(StartDir);
Note: See TracBrowser for help on using the repository browser.