Issue with libblosc2 when installing dolfinx via conda v24.3.0

Hi

I am facing a strange error running dolfinx in a conda env after a fresh install due to an upgrade to conda v24.3.0 with Python 3.12.2. Install steps are:

conda create -n fenicsx
conda activate fenicsx
conda install -c conda-forge fenics-dolfinx mpich pyvista

and running the demo_mixed-poisson.py raises the following error:

(fenicsx) username@ test_fenicsx % python demo_mixed-poisson.py 
Traceback (most recent call last):
  File "/Users/username/Desktop/test_fenicsx/demo_mixed-poisson.py", line 93, in <module>
    from dolfinx import fem, io, mesh
  File "/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/__init__.py", line 38, in <module>
    from dolfinx import common
  File "/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/common.py", line 11, in <module>
    from dolfinx import cpp as _cpp
ImportError: dlopen(/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/cpp.cpython-312-darwin.so, 0x0002): Library not loaded: @rpath/libblosc2.2.dylib
  Referenced from: <1FB3FC19-B57A-3B60-B00E-82EB3169B92A> /Users/username/anaconda3/envs/fenicsx/lib/libadios2_core.2.9.2.dylib
  Reason: tried: '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/../../../libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/../../../libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/bin/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/bin/../lib/libblosc2.2.dylib' (no such file), '/usr/local/lib/libblosc2.2.dylib' (no such file), '/usr/lib/libblosc2.2.dylib' (no such file, not in dyld cache)

Any idea how to get rid of this?

Best

Rolando

1 Like

@minrk Any idea? I’ve not seen this file missing before

Hello,
I have the same issue when installing dolfinx0.7.3 with conda outside $HOME.
Did you figure out was wrong?
thanks

It always helps to include conda info and conda env export output when debugging conda installation issues.

I believe you are running into this issue.

The workaround is to add to your package list 'c-blosc2<2.14' to pin-down libblosc2 to the right version.

Confirming I had this issue with a fresh install today. I also fixed it with “mamba install ‘c-blosc2<2.14’” as described above. (conda will work in place of mamba).

The command downgraded c-blosc2 from 2.14.4 to 2.13.2 on my system (mac).

same for me, using conda I did
conda install -c conda-forge c-blosc2=2.13
with my fenicsx environment active, this downgraded the library to the compatible version

Thank you all.
Downgrading c-blosc2 to 2.13 solved our issue.
Best regards