Libhdf5.dylib not found running cadet-cli

Hi all,

I am getting the attached error. Kindly help me to rectify the error.

Hey naveen567,

The error message tells us that the system is looking for the file libhdf5.200.dylib. It also tells us all the locations it has tried.

You can also search for the file: In the terminal, type

find / -iname 'libhdf5.200.dylib'

This may take some time. Please post the results of that search here.
Please also search for libhdf5.dylib by running

find / -iname 'libhdf5.dylib'

Possible causes for this problem could be:

  • You don’t have HDF5 installed (e.g., copying the cadet-cli program to a different computer)
  • The HDF5 version has changed / does not match the version CADET was compiled against
  • HDF5 has been moved to a different location

Hi s.leweke.

Thank you for your response.

Hereby, I have attached the results.

libhdf5.200.dylib

/Users/naveenj/tensorflow-n/env/lib/python3.8/site-packages/netCDF4/.dylibs/libhdf5.200.dylib
/Users/naveenj/tensorflow-n/env/lib/libhdf5.200.dylib
/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/h5py/.dylibs/libhdf5.200.dylib
/opt/homebrew/lib/libhdf5.200.dylib
/opt/homebrew/Cellar/hdf5/1.12.2_2/lib/libhdf5.200.dylib
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
find: /dev/fd/6: Not a directory

libhdf5.dylib

/Users/naveenj/miniforge3/pkgs/hdf5-1.12.1-nompi_hd9dbc9e_104/lib/libhdf5.dylib
/Users/naveenj/miniforge3/pkgs/hdf5-1.12.1-nompi_hf9525e8_104/lib/libhdf5.dylib
find: /Users/naveenj/.Trash: Operation not permitted
/Users/naveenj/tensorflow-n/env/lib/libhdf5.dylib
/Applications/MATLAB_R2022a.app/bin/maci64/libhdf5.dylib
/opt/homebrew/lib/libhdf5.dylib
/opt/homebrew/Cellar/hdf5/1.12.2_2/lib/libhdf5.dylib
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
find: /dev/fd/6: Not a directory

Thanks

I guess, this is the one that was used to compile CADET:

I suggest adding

import os
if 'DYLD_LIBRARY_PATH' in os.environ:
    os.environ['DYLD_LIBRARY_PATH'] = '/opt/homebrew/lib/:' + os.environ['DYLD_LIBRARY_PATH']
else:
    os.environ['DYLD_LIBRARY_PATH'] = '/opt/homebrew/lib/'

to the top of your Python script / code.

This will add the path /opt/homebrew/lib/ to the DYLD_LIBRARY_PATH environment variable, which is used by the dynamic linker to find missing .dylib files.

Thanks, s.leweke,

I have tried.

I am getting the below error.

CompletedProcess(args=[PosixPath('/Users/naveenj/opt/cadet/bin/cadet-cli'), '/Users/naveenj/noefbq0h.h5'], returncode=-6, stdout=b'', stderr=b"dyld[9122]: Library not loaded: @rpath/libhdf5.200.dylib\n  Referenced from: <2F2F5997-E412-3097-AAE1-FE40BF043393> /Users/naveenj/opt/cadet/bin/cadet-cli\n  Reason: tried: '/opt/homebrew/lib//libhdf5.200.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/naveenj/opt/cadet/bin/../lib/libhdf5.200.dylib' (no such file), '/Users/naveenj/opt/cadet/bin/../lib/libhdf5.200.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libhdf5.200.dylib' (no such file), '/Users/naveenj/opt/cadet/bin/../lib/libhdf5.200.dylib' (no such file), '/Users/naveenj/opt/cadet/bin/../lib/libhdf5.200.dylib' (no such file), '/usr/local/lib/libhdf5.200.dylib' (no such file), '/usr/lib/libhdf5.200.dylib' (no such file, not in dyld cache)\n")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/ipykernel_9064/1870842693.py in <cell line: 1>()
----> 1 p_1=Simulation1C(0.2,3)
      2 p_2=Simulation1C(0.78,3)
      3 p_3=Simulation1C(0.42,3)
      4 p_4=Simulation1C(1.5,4.5)
      5 p_5=Simulation1C(2.5,2.25)

~/ipykernel_9064/81328248.py in Simulation1C(c0, vel)
     13     time = model.root.output.solution.solution_times
     14 
---> 15     c = c0*model.root.output.solution.unit_001.solution_outlet/(model.root.input.model.unit_000.sec_000.const_coeff)
     16     #Set breakthrogh percentage to calculate loading time in minutes
     17     pstart = 3.49

TypeError: unsupported operand type(s) for *: 'float' and 'Dict'

Kindly help me to rectify the error.

Okay, that’s weird. It seems like your system is kind-of thrown together?
The file /opt/homebrew/lib//libhdf5.200.dylib was compiled for arm64 architecture (i.e., Macs with M1 or M2 CPU), but your system needs x86_64 architecture (i.e., it has an Intel CPU).
Maybe someone has taken the hard drive from an M1/M2 Mac and put it into your Intel Mac?

Anyway, there might be a smart solution, but I suggest the sledgehammer:

  • Uninstall homebrew
  • Install homebrew for your system / CPU
  • Install hdf5 via brew install hdf5
  • Maybe compile CADET again (if HDF5 version has changed)

No, I am using an M1 mac. But the cadet folder I am using is not compatible with mac M1. Could you pls tell me how to install CADET on Mac M1?

Kindly help me with the above.

Thanks

Hi S. Leweke

Thank you so much for your assistance. I have reconstructed the cadet using the source code, which functions well. Thanks again.

Naveen