On GNU/Linux, pick x13 binary from the path if it is there

As a consequence, no need to download the binary on the CI runners, since it is
already there.
parent 7e1594bb
Pipeline #480 passed with stage
in 1 minute and 6 seconds
......@@ -5,9 +5,6 @@ variables:
before_script:
- git clone https://git.dynare.org/Dynare/dates
- git clone https://git.dynare.org/Dynare/m-unit-tests
- wget http://www.dynare.org/x13/x13.zip
- unzip x13.zip
- cp -r binaries/linux externals/x13
testsuite_matlab:
stage: test
......
......@@ -28,7 +28,7 @@ dseries_src_root = strrep(which('initialize_dseries_toolbox'),'initialize_dserie
% Check that the x13 binary is available
nox13 = false;
if isunix()
if ~(exist([dseries_src_root '../externals/x13/linux/64/x13as'], 'file') && exist([dseries_src_root '../externals/x13/linux/32/x13as'], 'file'))
if system('which x13as') && ~(exist([dseries_src_root '../externals/x13/linux/64/x13as'], 'file') && exist([dseries_src_root '../externals/x13/linux/32/x13as'], 'file'))
nox13 = true;
end
elseif ismac()
......@@ -43,7 +43,7 @@ else
error('Unsupported platform.')
end
if nox13
warning('X13 binary is not available. You can install it manually by running\nthe function installx13() available in:\n\n\t%s\n', [dseries_src_root(1:end-4), 'externals' filesep() 'x13']);
warning('X13 binary is not available.\nIf you are under Debian or Ubuntu, you can install it through your package manager, with ''apt install x13as''.\nOtherwise, you can install it manually by running\nthe function installx13() available in:\n\n\t%s\n', [dseries_src_root(1:end-4), 'externals' filesep() 'x13']);
end
% Set the subfolders to be added in the path.
......
......@@ -26,11 +26,16 @@ if ismac()
x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as');
end
elseif isunix()
x13_binary = sprintf('%s%s%s', dseries_x13_root, 'linux', filesep());
if is64bit()
x13_binary = sprintf('%s%s%s%s', x13_binary, '64', filesep(), 'x13as');
[status, x13_binary] = system('which x13as');
if ~status
x13_binary = deblank(x13_binary);
else
x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as');
x13_binary = sprintf('%s%s%s', dseries_x13_root, 'linux', filesep());
if is64bit()
x13_binary = sprintf('%s%s%s%s', x13_binary, '64', filesep(), 'x13as');
else
x13_binary = sprintf('%s%s%s%s', x13_binary, '32', filesep(), 'x13as');
end
end
elseif ispc()
x13_binary = sprintf('%s%s%s', dseries_x13_root, 'windows', filesep());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment