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

[FEATURE] Add support for BLAS and LAPACK libraries discovery #227

Open
ccoulombe opened this issue May 8, 2024 · 9 comments
Open

[FEATURE] Add support for BLAS and LAPACK libraries discovery #227

ccoulombe opened this issue May 8, 2024 · 9 comments
Assignees

Comments

@ccoulombe
Copy link

Please add support for discovering BLAS and LAPACK libraries through cmake mechanisms.

We use Flexiblas and this is supported through -DBLA_VENDOR (https://cmake.org/cmake/help/latest/module/FindBLAS.html)

By asking CMake to find required libraries, this add flexibity and avoid custom patching of CMakeLists.txt

@atztogo
Copy link
Member

atztogo commented May 8, 2024

I am not very familiar with cmake. Do you have anything in your mind how to modify the phono3py setup system?

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

Note, FlexiBLAS does not support Lapacke. Other than that you can pass BLA_VENDOR as a environment variable during the pip install.

@atztogo I think one solution would be to conditionally use lapacke interface and if not found default to the original ones. But it's been quite some time since I looked into the difference between those, I could use some help explaining the differences.

@atztogo
Copy link
Member

atztogo commented Nov 22, 2024

I think one solution would be to conditionally use lapacke interface and if not found default to the original ones.

@LecrisUT, what do you mean the original ones?

@LecrisUT
Copy link
Collaborator

I think one solution would be to conditionally use lapacke interface and if not found default to the original ones.

@LecrisUT, what do you mean the original ones?

Linking against the fortran interface or bundle the (relevant part of) lapacke library statically.

@atztogo
Copy link
Member

atztogo commented Nov 24, 2024

I am planning to release a new version of phono3py that can eliminate the dependency on BLAS and LAPACK(E) in C. This means there is no need to link these libraries during compilation. For more details, see #301. Instead, scipy will be required.

@ccoulombe
Copy link
Author

Note, FlexiBLAS does not support Lapacke. Other than that you can pass BLA_VENDOR as a environment variable during the pip install.

Note that in our installation of FlexiBLAS, we also installed lapacke, but this is not the default FlexiBLAS installation.

@atztogo When do you plan on releasing a version with scipy ? In many cases, scipy and numpy will be built+linked with MKL or Flexiblas, this should still show nice performance I believe.

@atztogo
Copy link
Member

atztogo commented Nov 28, 2024

@ccoulombe, it has been released as experimental support. For more details, please refer to: https://phonopy.github.io/phono3py/install.html#building-without-linking-lapacke .

@atztogo
Copy link
Member

atztogo commented Dec 26, 2024

@ccoulombe, please try the latest phono3py release. Now the compilation without direct linking BLAS and LAPACK libraries is the default setting.

@ccoulombe
Copy link
Author

This built and seems to work properly. It would still be nice to add support for the libraries discovery, but less important now that it can use numpy/scipy which are in turn linked on desired librairies.

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