phonopy / phono3py

A simulation package of phonon-phonon interaction related properties
http://phonopy.github.io/phono3py/
BSD 3-Clause "New" or "Revised" License
125 stars 55 forks source link

ImportError of LAPACKE_zheev in starting phono3py #228

Open FurinaWai77 opened 6 months ago

FurinaWai77 commented 6 months ago

Check the develop branch The latest phonopy and phono3py

Describe the bug Whenever I start phono3py it occurs Traceback (most recent call last): File "/home/kawaiinahida/.local/bin/phono3py", line 45, in <module> main(**argparse_control) File "/home/kawaiinahida/phono3py/phono3py/cui/phono3py_script.py", line 837, in main args, log_level = start_phono3py(**argparse_control) File "/home/kawaiinahida/phono3py/phono3py/cui/phono3py_script.py", line 225, in start_phono3py import phono3py._phono3py as phono3c ImportError: /home/kawaiinahida/phono3py/phono3py/_phono3py.cpython-310-x86_64-linux-gnu.so: undefined symbol: LAPACKE_zheev

To Reproduce Steps to reproduce the behavior: Python 3.10, WSL2 Ubuntu 22.02 I installed from source code refering to the instructions. LAPACKE is installed through sudo apt-get install liblapack-dev liblapacke-dev And phono3py is installed using pip install -e . -vvv I don't know whether LAPACKE is incorrectly imported. Phonopy works fine.

atztogo commented 6 months ago

In phonopy, lapacke is not used and lapack is not used directly.

I expect it works on ubuntu on WSL2, too. But since I don't have windows system here right now, it is not possible to examine it.

You may have to set LD_LIBRARY_PATH to let your python interpreter find the library location. On my usual ubuntu 22.04, lapacke seems to be installed /usr/lib/x86_64-linux-gnu. But in this system, I didn't need to set up LD_LIBRART_PATH.

These issues are sometimes tough to solve from the developer side. So could you try the conda version if it is possible?

LecrisUT commented 2 days ago

It is used here: https://github.com/phonopy/phono3py/blob/de083046d2bca34e4306cf16e9dac040fcb040bb/c/lapack_wrapper.h#L44-L46 https://github.com/phonopy/phono3py/blob/de083046d2bca34e4306cf16e9dac040fcb040bb/c/lapack_wrapper.c#L56-L62

I am investigating this issue in the refactoring and it would be appreciated if @FurinaWai77 can help test some things out. One immediate issue is to find what blas/lapack library it is being linked to since FlexiBLAS which is the recent default does not support Lapacke. @FurinaWai77 can you run readelf -d on the compiled libraries?