win32: fixes for nf2ff calc and hdf5 handling

pull/1/head
Thorsten Liebig 2012-02-06 14:26:06 +01:00
parent 645ef9a38b
commit 755ff7f420
4 changed files with 25 additions and 6 deletions

View File

@ -72,7 +72,7 @@ try
% remove LD_LIBRARY_PATH set by matlab % remove LD_LIBRARY_PATH set by matlab
system(['export LD_LIBRARY_PATH=; ' openEMS_Path 'nf2ff/nf2ff ' filename '.xml']); system(['export LD_LIBRARY_PATH=; ' openEMS_Path 'nf2ff/nf2ff ' filename '.xml']);
else else
system([openEMS_Path 'nf2ff/nf2ff ' filename '.xml']); system([openEMS_Path 'nf2ff.exe ' filename '.xml']);
end end
nf2ff.hdf5; nf2ff.hdf5;

View File

@ -27,14 +27,25 @@ DEFUN_DLD (h5readatt_octave, args, nargout, "h5readatt_octave(<File_Name>,<DataS
return retval; return retval;
} }
hid_t ds = H5Oopen(file, args(1).string_value().c_str(), H5P_DEFAULT); #ifdef WIN32
if (ds==-1) // this special treatment is necessary because Win32-Octave ships with a very old hdf5 version (1.6.10)
hid_t obj = -1;
//try opening the group
obj = H5Gopen(file, args(1).string_value().c_str());
//try opening the dataset if group failed
if (obj==-1)
obj = H5Dopen(file, args(1).string_value().c_str());
#else
hid_t obj = H5Oopen(file, args(1).string_value().c_str(), H5P_DEFAULT);
#endif
if (obj==-1)
{ {
error("h5readatt_octave: opening the given Object failed"); error("h5readatt_octave: opening the given Object failed");
return retval; return retval;
} }
hid_t attr = H5Aopen_name(ds, args(2).string_value().c_str()); hid_t attr = H5Aopen_name(obj, args(2).string_value().c_str());
if (attr==-1) if (attr==-1)
{ {
error("h5readatt_octave: opening the given Attribute failed"); error("h5readatt_octave: opening the given Attribute failed");
@ -63,7 +74,13 @@ DEFUN_DLD (h5readatt_octave, args, nargout, "h5readatt_octave(<File_Name>,<DataS
} }
H5Aclose(attr); H5Aclose(attr);
H5Dclose(ds); #ifdef WIN32
// try group close, than Dataset close
if (H5Gclose(obj)<0)
H5Dclose(obj);
#else
H5Oclose(obj);
#endif
H5Fclose(file); H5Fclose(file);
Matrix mat(numVal,1); Matrix mat(numVal,1);
for (size_t n=0;n<numVal;++n) for (size_t n=0;n<numVal;++n)

View File

@ -8,6 +8,7 @@ INCLUDEPATH += ../../tinyxml
CONFIG += debug_and_release CONFIG += debug_and_release
win32 { win32 {
QMAKE_CXXFLAGS += -DH5_USE_16_API
INCLUDEPATH += ../../hdf5/include ../../hdf5/include/cpp ../../boost/include/boost-1_42 INCLUDEPATH += ../../hdf5/include ../../hdf5/include/cpp ../../boost/include/boost-1_42
LIBS += ../../hdf5/lib/hdf5.lib LIBS += ../../hdf5/lib/hdf5.lib
LIBS += ../../boost/lib/libboost_thread-mgw44-mt.lib LIBS += ../../boost/lib/libboost_thread-mgw44-mt.lib

View File

@ -28,8 +28,9 @@ CONFIG += debug_and_release
############################################################################### ###############################################################################
win32 { win32 {
QMAKE_CXXFLAGS += -DH5_USE_16_API
INCLUDEPATH += ../hdf5/include ../hdf5/include/cpp ../boost/include/boost-1_42 INCLUDEPATH += ../hdf5/include ../hdf5/include/cpp ../boost/include/boost-1_42
LIBS += ../hdf5/lib/hdf5_cpp.lib ../hdf5/lib/hdf5.lib LIBS += ../hdf5/lib/hdf5.lib
LIBS += ../boost/lib/libboost_thread-mgw44-mt.lib LIBS += ../boost/lib/libboost_thread-mgw44-mt.lib
LIBS += -L../CSXCAD/release LIBS += -L../CSXCAD/release
LIBS += ../fparser/release/libfparser4.a LIBS += ../fparser/release/libfparser4.a