select_x13_binary.m 1.82 KB
Newer Older
1
function x13_binary = select_x13_binary()
Stéphane Adjemian's avatar
Stéphane Adjemian committed
2

3
4
5
6
7
8
9
% Copyright (C) 2017 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
Stéphane Adjemian's avatar
Stéphane Adjemian committed
10
% Dynare dseries submodule is distributed in the hope that it will be useful,
11
12
13
14
15
16
17
18
19
20
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

dseries_src_root = strrep(which('initialize_dseries_toolbox'),'initialize_dseries_toolbox.m','');
dseries_x13_root = sprintf('%s%s%s%s%s%s%s', dseries_src_root, '..', filesep(), 'externals', filesep(), 'x13', filesep());

21
22
23
if ismac()
    x13_binary = sprintf('%s%s%s', dseries_x13_root, 'osx', filesep());
    if is64bit()
24
        x13_binary = sprintf('%s%s%s%s', x13_binary, '64', filesep(), 'x13as');
25
    else
26
        x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as');
27
28
    end
elseif isunix()
29
30
    x13_binary = sprintf('%s%s%s', dseries_x13_root, 'linux', filesep());
    if is64bit()
31
        x13_binary = sprintf('%s%s%s%s', x13_binary, '64', filesep(), 'x13as');
32
    else
33
        x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as');
34
35
36
37
    end
elseif ispc()
    x13_binary = sprintf('%s%s%s', dseries_x13_root, 'windows', filesep());
    if is64bit()
38
        x13_binary = sprintf('%s%s%s%s', x13_binary, '64', filesep(), 'x13as.exe');
39
    else
40
        x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as.exe');
Stéphane Adjemian's avatar
Stéphane Adjemian committed
41
    end
42
else
43
    error('X13 binary is not available for this plateform')
44
end