Created
February 7, 2019 12:20
-
-
Save gramian/3bc06a63cfdc7e400aefe1278caf1980 to your computer and use it in GitHub Desktop.
Clone of Julia's versioninfo for Octave and MATLAB on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function v = versioninfo() | |
%%% project: versioninfo (clone of Julia's versioninfo for Octave and MATLAB) | |
%%% version: 1.0 ( 2019-02-07 ) | |
%%% authors: C. Himpe ( 0000-0003-2194-6754 ) | |
%%% license: BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause ) | |
%%% summary: Collect compute environment and version information on Linux | |
% Interpreter name | |
if(exist('OCTAVE_VERSION','builtin')) | |
v.name = 'OCTAVE'; | |
else | |
v.name = 'MATLAB'; | |
end | |
% Interpreter version | |
v.ver = version(); | |
% Operating system | |
[s,o] = system('cat /etc/os-release | grep "PRETTY_NAME="'); | |
v.os = strtrim(o(14:end-2)); | |
% System word width | |
[s,c] = system('uname -m'); | |
v.arch = strtrim(c); | |
% Basic hardware info | |
[s,p] = system('cat /proc/cpuinfo | grep "model name" | head -1'); | |
y = find(p==':'); | |
v.cpu = strtrim(p(y(1)+1:end-1)); | |
[s,m] = system('cat /proc/meminfo | grep "MemTotal" | head -1'); | |
y = find(m==':'); | |
v.mem = strtrim(m(y(1)+1:end-1)); | |
% BLAS / LAPACK library backends | |
v.blas = version('-blas'); | |
v.lapack = version('-lapack'); | |
% Toolboxes | |
v.pkg = ver(); | |
if(nargout==0) | |
fprintf('\n'); | |
fprintf(' Interpreter: %s\n',v.name); | |
fprintf(' Version: %s\n',v.ver); | |
fprintf(' System: %s\n',v.os); | |
fprintf(' Architecture: %s\n',v.arch); | |
fprintf(' Processor: %s\n',v.cpu); | |
fprintf(' Memory: %s\n',v.mem); | |
fprintf(' BLAS: %s\n',v.blas); | |
fprintf(' LAPACK: %s\n',v.lapack); | |
fprintf('\n'); | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment