External program that uses HDF5 fails

5 vues (au cours des 30 derniers jours)
Vasily K
Vasily K le 27 Mar 2020
Modifié(e) : Vasily K le 28 Mar 2020
Hi!
I have a home-written and compiled (VS2019 ) cpp program that I'd like to call as part of matlab script. As a part of this program, it uses HDF5 C library and HighFive wrapper to load some file (also OMP and Eigen, but the problems happens the calls tho these libs). Unfortunateley, when called from matlab (via "system"), the program fails exactly where it tries to open an HDF .h5 file (in read-only, file is not opened in matlab) wo any error message (with only windows "has stopped working" error window). When called from just windwos cmd with the same parameters, it works just fine.
Any suggestions to fix that?
Thank you in advance!
  1 commentaire
Walter Roberson
Walter Roberson le 28 Mar 2020
Is it possible that it relies on the Windows PATH environment variable to locate some exe or dll, and is not finding it when called inside of MATLAB because MATLAB is controlling the PATH environment variable itself?
I would suggest using a process monitor such as https://docs.microsoft.com/en-us/sysinternals/downloads/procmon to see what the process is trying and failing to do.

Connectez-vous pour commenter.

Réponse acceptée

Vasily K
Vasily K le 28 Mar 2020
Modifié(e) : Vasily K le 28 Mar 2020
Ok, It wasn't hard, I found out, what was the problem. Unfortunateley, windows error suppresed all the error output back to matlab. When I opened it in a new cmd window (using start command ), I discovered an HDF5 error output about version mismatch. Somwhow matlab is using a different version of HDF5, what can be fixed by either 'set HDF5_DISABLE_VERSION_CHECK=1 &' , recompiling the .exe with right version of the library or linking different version to matlab (I guess).

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by