source: MML/trunk/machine/SOLEIL/common/configurations/mml_cc_appli.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 4.3 KB
Line 
1function 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
13ConfigFlag = 0;
14
15if 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
22end
23
24% save current directory
25CurrentDir = pwd;
26
27% Directory to store application
28DirName = getfamilydata('Directory', 'Standalone');
29
30ApplicationName = lower(ApplicationName);
31
32switch 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);
43end
44
45% check development directory name
46
47if ~isdir(DirName)
48    fprintf('Abort: directory %s does not exist!\n', DirName);
49    return;
50end
51
52% Create and go to the directory
53DirName = fullfile(DirName, ApplicationName);
54gotodirectory(DirName);
55
56if ~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);
97else % 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));
107end
108
109cd(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
Note: See TracBrowser for help on using the repository browser.