fmodpy icon indicating copy to clipboard operation
fmodpy copied to clipboard

Using the BLAS/LAPACK while compiling with fmodpy

Open FMEduardo opened this issue 7 months ago • 4 comments

Greetings! I am writing this issue seeking for assistance. I intend in using fortran for number-crunching sections of my code for that I found this wrapper. However, when I tried testing the execution time of two random 5000x5000 matrices, the results weren't exepected. The running time for the Fortran multiplication function was higher by a factor of 3 in most cases. I imagine that the numpy uses the fast and optimized implementations of BLAS/LAPACK, it was strange to me that the default compiler settings of Fortran do not use it. I had some alterating the configurations so that my code compiles with the BLAS/LAPACK packages. I have tried this sections of code in the terminal to achieve my goal:

python3 -c "import fmodpy; fmodpy.configure(link_blas='-lopenblas')";

python3 -c "import fmodpy; fmodpy.configure(lapack=True, blas=True)";

and still had the same execution time issue.

I am using the gfortran compiler. I would like to know if there is any open source compiler that could be used that already uses the BLAS/LAPACK packages as default and how could I make it happen through the fmodpy wrapper.

Thank you :)

FMEduardo avatar Jul 04 '25 18:07 FMEduardo