0
|
1 function [engine, environment, basedir, mccdir, license_type] = determine_engine()
|
|
2 % DETERMINES_ENGINE Determines used interpreter.
|
|
3 %
|
|
4 % [engine, environment, basedir, mccdir, license_type] = determine_engine() ;
|
|
5 %
|
|
6 % returns either 'matlab' or 'octave' in variable engine
|
|
7 % and 'internal' or 'galaxy' in variable environment
|
|
8 % basedir is the directory of the matlab or octave instance
|
|
9 % mccdir is the directory of the matlab compiler (does not yet exist for octave)
|
|
10 %
|
|
11 %
|
|
12 % This program is free software; you can redistribute it and/or modify
|
|
13 % it under the terms of the GNU General Public License as published by
|
|
14 % the Free Software Foundation; either version 3 of the License, or
|
|
15 % (at your option) any later version.
|
|
16 %
|
|
17 % Written (W) 2009-2010 Gunnar Raetsch
|
|
18 % Copyright (C) 2009-2010 Max Planck Society
|
|
19 %
|
|
20
|
|
21
|
|
22 global g_license_type ;
|
|
23
|
|
24 if isempty(g_license_type),
|
|
25 g_license_type = 'academic' ;
|
|
26 end ;
|
|
27 license_type = g_license_type ;
|
|
28
|
|
29 lic=license ;
|
|
30 if ~isequal(lic, 'GNU General Public License'),
|
|
31 engine='matlab' ;
|
|
32 else
|
|
33 engine='octave' ;
|
|
34 end ;
|
|
35
|
|
36 environment='internal' ;
|
|
37 if isequal(whoami, 'galaxy'),
|
|
38 environment='galaxy' ;
|
|
39 end ;
|
|
40
|
|
41 if isequal(engine, 'matlab') && isequal(environment, 'internal'),
|
|
42 basedir = '' ;
|
|
43 elseif isequal(engine, 'matlab') && isequal(environment, 'galaxy'),
|
|
44 basedir = '' ;
|
|
45 elseif isequal(engine, 'octave') && isequal(environment, 'internal'),
|
|
46 basedir = '' ;
|
|
47 elseif isequal(engine, 'octave') && isequal(environment, 'galaxy'),
|
|
48 basedir = '' ;
|
|
49 end ;
|
|
50
|
|
51 if isequal(environment, 'internal'),
|
|
52 mccdir = '' ;
|
|
53 elseif isequal(environment, 'galaxy'),
|
|
54 mccdir = '' ;
|
|
55 end ;
|
|
56
|
|
57 return
|