From 29ecc4b6c5cf00059748ded4e7a9384ec3daeebe Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Sat, 11 Feb 2017 17:25:58 +0100 Subject: [PATCH] octave: find hdf5 header for setup too Signed-off-by: Thorsten Liebig --- matlab/setup.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/matlab/setup.m b/matlab/setup.m index 9a400a2..e208ad4 100644 --- a/matlab/setup.m +++ b/matlab/setup.m @@ -5,7 +5,7 @@ function setup() % % openEMS matlab/octave interface % ----------------------- -% author: Thorsten Liebig (2011) +% author: Thorsten Liebig (2011-2017) disp('setting up openEMS matlab/octave interface') @@ -16,13 +16,17 @@ cd(dir); if isOctave() disp('compiling oct files') - fflush(stdout) + fflush(stdout); if isunix - [res, fn] = unix('find /usr/lib -name libhdf5.so'); - if length(fn)>0 - [hdf5lib_dir, hdf5lib_fn] = fileparts(fn); + [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); disp(["HDF5 library path found at: " hdf5lib_dir]) - mkoctfile(["-L" hdf5lib_dir ],"-lhdf5", "h5readatt_octave.cc") + + [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") else mkoctfile -lhdf5 h5readatt_octave.cc end