2012-01-16 12:30:50 +00:00
|
|
|
function setup()
|
|
|
|
% function setup()
|
|
|
|
%
|
|
|
|
% setup openEMS Matlab/octave interface
|
|
|
|
%
|
|
|
|
% openEMS matlab/octave interface
|
|
|
|
% -----------------------
|
2017-02-11 16:25:58 +00:00
|
|
|
% author: Thorsten Liebig (2011-2017)
|
2012-01-16 12:30:50 +00:00
|
|
|
|
|
|
|
disp('setting up openEMS matlab/octave interface')
|
|
|
|
|
|
|
|
% cd to directory of this file and restore current path at the end
|
|
|
|
current_path = pwd;
|
|
|
|
dir = fileparts( mfilename('fullpath') );
|
|
|
|
cd(dir);
|
|
|
|
|
|
|
|
if isOctave()
|
|
|
|
disp('compiling oct files')
|
2017-02-11 16:25:58 +00:00
|
|
|
fflush(stdout);
|
2013-01-02 18:21:08 +00:00
|
|
|
if isunix
|
2017-02-11 16:25:58 +00:00
|
|
|
[res, fn_so] = unix('find /usr/lib -name libhdf5.so');
|
|
|
|
[res, fn_h] = unix('find /usr/include -name hdf5.h');
|
|
|
|
if length(fn_so)>0 && length(fn_h)>0
|
|
|
|
[hdf5lib_dir, hdf5lib_fn] = fileparts(fn_so);
|
2015-05-04 18:02:21 +00:00
|
|
|
disp(["HDF5 library path found at: " hdf5lib_dir])
|
2017-02-11 16:25:58 +00:00
|
|
|
|
|
|
|
[hdf5inc_dir, hdf5inc_fn] = fileparts(fn_h);
|
|
|
|
disp(["HDF5 include path found at: " hdf5inc_dir])
|
|
|
|
mkoctfile(["-L" hdf5lib_dir " -I" hdf5inc_dir],"-lhdf5", "h5readatt_octave.cc")
|
2015-05-04 18:02:21 +00:00
|
|
|
else
|
2016-09-26 13:33:29 +00:00
|
|
|
mkoctfile -lhdf5 h5readatt_octave.cc
|
2015-05-04 18:02:21 +00:00
|
|
|
end
|
2013-01-02 18:21:08 +00:00
|
|
|
else
|
2016-09-26 13:33:29 +00:00
|
|
|
mkoctfile -lhdf5 h5readatt_octave.cc
|
2013-01-02 18:21:08 +00:00
|
|
|
end
|
2012-01-16 12:30:50 +00:00
|
|
|
else
|
2012-03-26 19:46:08 +00:00
|
|
|
disp('Matlab does not need this function. It is Octave only.')
|
2012-01-16 12:30:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
cd(current_path);
|