call python from matlab - HDF5 1.10 error - install older version w/ conda?

90 views
Skip to first unread message

Josh Hubbard

unread,
Feb 25, 2021, 10:47:35 AM2/25/21
to Cantera Users' Group

Good morning,

I have an aerosol dynamics code I've written in matlab.  I'd like to integrate Cantera to calculate gas chemistry as well.

I installed Cantera on my linux machine according to cantera.org.

conda create --name spam --channel cantera cantera ipython matplotlib

I can execute /examples/reactor1.py successfully, so I know the installation worked.

When I try to call cantera libraries in matlab, I get an HDF5 error.  I find reference to this same error on the matlab website but I don't think matlab currently supports HDF5 1.10.

----------------
h5py is running against HDF5 1.8.12 when it was built against 1.10.6, this may cause problems
  _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.10.6, library is 1.8.12
----------------

Can I build an older version of cantera that uses HDF5 1.8?  I looked on the github repository and it's not immediately clear how I'd do this.

For example...

conda create --name spam --channel cantera cantera=2.4.xx ipython matplotlib

Is it possible to build cantera with an older version of hdf5?

For example...

conda create --name spam --channel cantera cantera ipython matplotlib h5py=1.8.12

What's the recommended path?

I looked at compiling cantera from source code but it'd be nice to cross off other options first.

Thanks for your help,

Josh

Ingmar Schoegl

unread,
Feb 26, 2021, 9:21:07 AM2/26/21
to Cantera Users' Group
Hi Josua,

By default, Cantera does not require HDF, although 2.5.1 now supports an optional HDF output format when used from the Python front end. I'd suggest removing h5py from your (conda) environment, as it is of no use from the Matlab side. Hope this helps,

-ingmar-
Reply all
Reply to author
Forward
0 new messages