You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pkgconfig files were added, there used to be pkgconfig files for clbas, blas and lapack in addition to the openblas one. They were removed in #1096 by @martin-frbg. Discussion about it is in #598, though I don't really see any arguments against inclusion.
Currently at least sage relies on these pkgconfig files. Because of that distributions have to include them if they want to package sage. I'm the packager for nix and we just wondered (NixOS/nixpkgs#45257) why openblas doesn't provide these pc files by default.
So is there any reason not to include them? It seems useful to me to be able to abstract over blas libraries.
As I remember it, there were no arguments for inclusion of separate pkgconfig files, and my concern was that these would all end up adding the same link line to any build process that would use them. Then there was the question of parallel installations of OpenBLAS and e.g. netlib or atlas, which
might provide conflicting cblas.pc etc.
BLAS is like 20 years older than pkgconfig, and in those 20 years of pkgconfig nobody found it practical to have such .pc file
Indeed you can have synthetic openblas.pc and atlas.pc and mkl.pc files in sagemath if that is your preferred way.
in most linux distributions it is either -lblas alternatives or easily replaceable thunk to distributor's prefered blas implementation, that you can symlink to replacement of users' choice.
You can make 'ld -lblas -osageblas.so' thunk library that one can replace with openblas , or in case of ubuntu, it is already obedient to alternatives. Or in case of windows just plant openblas there?
Sort of leave easy choice to users instead of implying one implementation on them?
pkgconfig is not very good at understanding that blas.pc atlas.pc openblas.pc and mkl.pc all would provide same API in the end. Lets take ubuntu alternatives as an example where netlib blas is used for compiler linking but alternatives can be used for runtime loading.
You just link your executables to a library which imports blas, lapack and cblas
One can replace that with blas implementation of their choice, by relinking, or rewriting library file...
In turn in ubuntu or debian you can redirect -lblas that i suggest to link from your fake blas library with a blas implementation of your choice. I.e far outside sagemath. Or replace fake blas library with mkl etc
Yes, that is a possibility. However are there any reasons against just providing the pkgconfig files for cblas, blas and lapack? If you are opposed against this, is there any reason against us providing them as a distribution?
I am not opposed to reinstating the additional pkgconfig files, as long as they do not cause any new and interesting problems. Getting the recent thread memory allocating mess fixed is much higher on my list of priorities however.
Why would an implementation detail like pkgconfig-files be a part of the api? That other implementation finders exist shouldn't be an issue.
Okay, glad to hear that you are open to it. I understand that it is not high priority. I'll then add the files to our distro package for now. Let me know if I can do anything to help.
@timokau, I added them initially when I was packaging sagemath for conda and I agree with the decision that the cblas, blas, lapack files should be left to the distributions to add them. Reason is that the system-wide blas or cblas or lapack should be chosen by the distribution and openblas should not assert itself as the blas implementation for the distribution.
Activity
martin-frbg commentedon Aug 18, 2018
As I remember it, there were no arguments for inclusion of separate pkgconfig files, and my concern was that these would all end up adding the same link line to any build process that would use them. Then there was the question of parallel installations of OpenBLAS and e.g. netlib or atlas, which
might provide conflicting cblas.pc etc.
timokau commentedon Aug 18, 2018
What about the use case "link some blas library"?
That shouldn't make a difference right?
That would be remedied by prefixing the filenames like suggested in #598.
brada4 commentedon Aug 18, 2018
BLAS is like 20 years older than pkgconfig, and in those 20 years of pkgconfig nobody found it practical to have such .pc file
Indeed you can have synthetic openblas.pc and atlas.pc and mkl.pc files in sagemath if that is your preferred way.
in most linux distributions it is either -lblas alternatives or easily replaceable thunk to distributor's prefered blas implementation, that you can symlink to replacement of users' choice.
timokau commentedon Aug 19, 2018
Why would it not be practical? And what disadvantages would there be?
brada4 commentedon Aug 19, 2018
You can make 'ld -lblas -osageblas.so' thunk library that one can replace with openblas , or in case of ubuntu, it is already obedient to alternatives. Or in case of windows just plant openblas there?
Sort of leave easy choice to users instead of implying one implementation on them?
pkgconfig is not very good at understanding that blas.pc atlas.pc openblas.pc and mkl.pc all would provide same API in the end. Lets take ubuntu alternatives as an example where netlib blas is used for compiler linking but alternatives can be used for runtime loading.
timokau commentedon Aug 19, 2018
I'm sorry I still don't understand you. What is a thunk library? What is ubuntu obedient to? What do you mean with windows?
brada4 commentedon Aug 20, 2018
You just link your executables to a library which imports blas, lapack and cblas
One can replace that with blas implementation of their choice, by relinking, or rewriting library file...
In turn in ubuntu or debian you can redirect -lblas that i suggest to link from your fake blas library with a blas implementation of your choice. I.e far outside sagemath. Or replace fake blas library with mkl etc
timokau commentedon Aug 21, 2018
Yes, that is a possibility. However are there any reasons against just providing the pkgconfig files for cblas, blas and lapack? If you are opposed against this, is there any reason against us providing them as a distribution?
brada4 commentedon Aug 21, 2018
They are not part of Netlib LAPACK API?
cmake and autoconf has on their own blas implementation finders for example.
martin-frbg commentedon Aug 21, 2018
I am not opposed to reinstating the additional pkgconfig files, as long as they do not cause any new and interesting problems. Getting the recent thread memory allocating mess fixed is much higher on my list of priorities however.
timokau commentedon Aug 21, 2018
Why would an implementation detail like pkgconfig-files be a part of the api? That other implementation finders exist shouldn't be an issue.
Okay, glad to hear that you are open to it. I understand that it is not high priority. I'll then add the files to our distro package for now. Let me know if I can do anything to help.
isuruf commentedon Aug 25, 2018
@timokau, I added them initially when I was packaging sagemath for conda and I agree with the decision that the
cblas, blas, lapackfiles should be left to the distributions to add them. Reason is that the system-wide blas or cblas or lapack should be chosen by the distribution and openblas should not assert itself as the blas implementation for the distribution.timokau commentedon Aug 25, 2018
@isuruf my understanding of pkgconfig is incomplete, but shouldn't it be able to deal with multiple declarations of "blas" and "cblas"?
timokau commentedon Aug 25, 2018
Okay apparently it is not. So in that case I agree that adding those files to
lib/pkgconfigwould be a bad idea. Thanks for the explanations!