Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError of LAPACKE_zheev in starting phono3py #228

Open
FurinaWai77 opened this issue May 17, 2024 · 3 comments
Open

ImportError of LAPACKE_zheev in starting phono3py #228

FurinaWai77 opened this issue May 17, 2024 · 3 comments
Assignees

Comments

@FurinaWai77
Copy link

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
Copy link
Collaborator

atztogo commented May 17, 2024

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
Copy link
Collaborator

It is used here:

#else
#include <lapacke.h>
#endif

int phonopy_zheev(double *w, lapack_complex_double *a, const int n,
const char uplo) {
lapack_int info;
info = LAPACKE_zheev(LAPACK_ROW_MAJOR, 'V', uplo, (lapack_int)n, a,
(lapack_int)n, w);
return (int)info;
}

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?

@LecrisUT LecrisUT self-assigned this Nov 21, 2024
@atztogo
Copy link
Collaborator

atztogo commented Nov 24, 2024

I believe the best strategy for users is to provide phono3py without requiring a link to LAPACKE in C. To implement this, I have submitted a pull request (now in develop branch) and this version will be released someday soon. For details, see #301.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants