source: MML/trunk/at/atmexall.m

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

ThomX MML version on the LAL server @ 17/12/2013

File size: 2.1 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%
10%
11% Modified by Jianfeng Zhang @ LAL, 13/02/2013
12% Added the mex compile for 64 bit linux platform.
13%
14
15StartDir = pwd;
16ATROOT = atroot;
17
18% Navigate to the directory that contains pass-methods
19cd(ATROOT)
20cd simulator
21cd element
22PASSMETHODDIR = pwd;
23disp(['Current directory: ',PASSMETHODDIR]);
24mexpassmethod('all');
25
26
27% User passmethods
28cd user
29disp(['Current directory: ', pwd]);
30mexuserpassmethod('all');
31
32
33% Navigate to the directory that contains tracking functions
34cd(ATROOT)
35cd simulator
36cd track
37
38disp(['Current directory:', pwd]);
39
40switch computer
41    case 'SOL2'
42        PLATFORMOPTION = ['-D',computer,' '];
43    case 'GLNX86'
44        PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Laurent April 6th, 2007; 32 bit
45        case 'GLNXA64'
46        PLATFORMOPTION = ['-ldl -D',computer,' ']; % added by Jianfeng ZHANG Feb. 13th, 2012; 64 bit platform
47    case  'PCWIN'
48        PLATFORMOPTION = ['-D',computer,' '];%windows
49    case  'MACI64'
50        PLATFORMOPTION = ['-D',computer,' LDFLAGS=''-pthread -shared -m64'' ']; %added by L. Nadolski for MAC
51    otherwise
52        error('Platform not defined');
53end
54
55MEXCOMMAND = ['mex ',PLATFORMOPTION,'atpass.c'];
56disp(MEXCOMMAND);
57eval(MEXCOMMAND);
58
59% Navigate to the directory that contains some accelerator physics functions
60cd(ATROOT)
61cd atphysics
62disp(['Current directory:', pwd]);
63
64% findmpoleraddiffmatrix.c
65disp(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
66
67%eval(['mex findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
68eval(['mex ', PLATFORMOPTION, ' findmpoleraddiffmatrix.c -I''',PASSMETHODDIR,'''']);
69
70% ADD 'MEXING' instructions for other C files
71disp('ALL mex-files created successfully')
72clear ATROOT PASSMETHODDIR WARNMSG PLATFORMOPTION MEXCOMMAND
73cd(StartDir);
Note: See TracBrowser for help on using the repository browser.