1 | function mml_cc_appli(ApplicationName) |
---|
2 | %MM_CC_APPLI - Compile a standalone MML/AT application |
---|
3 | % |
---|
4 | % NOTES: |
---|
5 | % Each compiled programme is stored in a directory with the date of the day |
---|
6 | % Then a symbolic link has to be done to point on the new application |
---|
7 | % A shortcut to the application is done in the mouse menu |
---|
8 | % Available applications: plotfamily and SOFB |
---|
9 | |
---|
10 | % |
---|
11 | %% Written by Laurent S. Nadolski |
---|
12 | |
---|
13 | ConfigFlag = 0; |
---|
14 | |
---|
15 | if nargin == 0 |
---|
16 | ApplicationName = questdlg('Choose programme to compile or deploy as a standalone application', ... |
---|
17 | 'Compilation dialog box', ... |
---|
18 | 'Plotfamily','SOFB', 'TuneFB', 'default'); |
---|
19 | if isempty(ApplicationName) |
---|
20 | error('Abort: Unknown answer') |
---|
21 | end |
---|
22 | end |
---|
23 | |
---|
24 | % save current directory |
---|
25 | CurrentDir = pwd; |
---|
26 | |
---|
27 | % Directory to store application |
---|
28 | DirName = getfamilydata('Directory', 'Standalone'); |
---|
29 | |
---|
30 | ApplicationName = lower(ApplicationName); |
---|
31 | |
---|
32 | switch ApplicationName |
---|
33 | case 'plotfamily' |
---|
34 | ApplicationName = 'plotfamily'; |
---|
35 | case 'sofb' |
---|
36 | ApplicationName = 'orbitcontrol'; |
---|
37 | case 'fofb' |
---|
38 | ApplicationName = 'FOFBguiTango'; |
---|
39 | case 'tunefb' |
---|
40 | ApplicationName = 'tuneFBgui'; |
---|
41 | otherwise |
---|
42 | error('Unknown application name %s', ApplicationName); |
---|
43 | end |
---|
44 | |
---|
45 | % check development directory name |
---|
46 | |
---|
47 | if ~isdir(DirName) |
---|
48 | fprintf('Abort: directory %s does not exist!\n', DirName); |
---|
49 | return; |
---|
50 | end |
---|
51 | |
---|
52 | % Create and go to the directory |
---|
53 | DirName = fullfile(DirName, ApplicationName); |
---|
54 | gotodirectory(DirName); |
---|
55 | |
---|
56 | if ~ConfigFlag |
---|
57 | DirDevName = [ApplicationName '_standalone_' datestr(date,29)]; |
---|
58 | |
---|
59 | fullName = [DirName filesep DirDevName]; |
---|
60 | if exist(fullName, 'dir') == 7 |
---|
61 | answer = questdlg('Directory exists already!','Compilation dialog box','Continue','Abort','Default'); |
---|
62 | switch answer |
---|
63 | case 'Continue' |
---|
64 | fprintf('Data will be erased\n') |
---|
65 | case 'Abort' |
---|
66 | fprintf('Application stopped on user request\n') |
---|
67 | return; |
---|
68 | otherwise |
---|
69 | fprintf('Application stopped on user request\n') |
---|
70 | return; |
---|
71 | end |
---|
72 | end |
---|
73 | |
---|
74 | gotodirectory(fullName); |
---|
75 | |
---|
76 | % Compilation part |
---|
77 | if strcmpi(ApplicationName,'synchro') |
---|
78 | % Does not work as it should yet |
---|
79 | % eval(['mcc -mv -a AperturePass -a BndMPoleSymplectic4Pass -a BndMPoleSymplectic4RadPass ' ... |
---|
80 | % '-a CavityPass -a CorrectorPass -a DriftPass -a EAperturePass -a IdentityPass ' ... |
---|
81 | % '-a Matrix66Pass -a QuadLinearPass -a SolenoidLinearPass -a StrMPoleSymplectic4Pass ' ... |
---|
82 | % '-a StrMPoleSymplectic4RadPass -a ThinMPolePass -a findmpoleraddiffmatrix ' ... |
---|
83 | % '-a IdentityPass -a BendLinearPass ', 'synchro_injecteur7_rafale']); |
---|
84 | else |
---|
85 | % Add files in StorageRing (*.txt), AT, MML (wave files) |
---|
86 | eval(['mcc -mv -a AperturePass -a BndMPoleSymplectic4Pass -a BndMPoleSymplectic4RadPass ' ... |
---|
87 | '-a CavityPass -a CorrectorPass -a DriftPass -a EAperturePass -a IdentityPass ' ... |
---|
88 | '-a Matrix66Pass -a QuadLinearPass -a SolenoidLinearPass -a StrMPoleSymplectic4Pass ' ... |
---|
89 | '-a StrMPoleSymplectic4RadPass -a ThinMPolePass -a findmpoleraddiffmatrix ' ... |
---|
90 | '-a IdentityPass -a BendLinearPass ', ApplicationName]); |
---|
91 | end |
---|
92 | |
---|
93 | |
---|
94 | [pathstr, name, ext, versn] = fileparts(DirName); |
---|
95 | fprintf('\nApplication %s compiled and saved in directory: %s\n', name, DirName) |
---|
96 | fprintf('Directory name is: %s\n\n', DirDevName); |
---|
97 | else % Deploy programme |
---|
98 | cd(DirName); |
---|
99 | VersionName = uigetdir; |
---|
100 | if isempty(VersionName) |
---|
101 | cd(CurrentDir); |
---|
102 | error('Abort: Unknown answer') |
---|
103 | end |
---|
104 | [tmp Appli2deploy] = fileparts(VersionName); |
---|
105 | system(sprintf('rm -v %s', ApplicationName)); |
---|
106 | system(sprintf('ln -s -v %s %s', Appli2deploy, ApplicationName)); |
---|
107 | end |
---|
108 | |
---|
109 | cd(CurrentDir); |
---|
110 | |
---|
111 | %export |
---|
112 | %LD_LIBRARY_PATH=/usr/Local/matlab/runtime/glnx86:/usr/Local/matlab/bin/glnx86:/usr/Local/matlab/sys/os/glnx86:/usr/Loca |
---|
113 | %l/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/native_threads:/usr/Local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/server:/usr/Local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client:/usr/Local/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386:/lib:/lib/tls:/usr/lib:/usr/X11R6/lib:/usr/Local/soleil-root/tango/lib:/usr/Local/soleil-root/omniorb/lib:/usr/Local/soleil-root/bindings/python/python23:/usr/Local/soleil-root/hw-support/ace/lib:/usr/Local/DeviceServer |
---|