Open cdluminate opened 5 years ago
@cdluminate Thanks for volunteering to work on this. Just let me know if you have any questions about the inner workings of the top-level Makefile or build system. I always assume it may be a little trickier to decipher code that you did not write yourself. :)
BLIS provides compat code for the BLAS/CBLAS API, which means we can use BLIS as an binary-compatible alternative to the reference BLAS/CBLAS. However, symlinking
libblis.so.*
intolibblas.so.*
andlibcblas.so.*
is questionable because during compilation, a program linked to the "libblas.so" will eventually require a library calledlibblis.so*
due to the SONAME. For linux distributions that provide sort or "alternatives" mechanism such as Debian and Gentoo, being able to build seperate shared objects such aslibblas.so*
andlibcblas.so*
without downstream patches is a wonderful feature.Debian's patch and Gentoo's patch are similar (same author). The current patches build libblis.so more than once with different SONAMEs, and hide some symbols with a customized linker script (see https://github.com/flame/blis/issues/301). This solution is working well but is not good enough.
For Gentoo, the most ideal solution is to build a
libblas.so
(SONAME=libblas.so.3) withBASE_OBJ_BLAS_PATH/%.o
(excluding the CBLAS symbols) and alibcblas.so
(SONAME=libcblas.so.3) with CBLAS objects. Both the two separate shared objects are linked against thelibblis.so.*
to avoid unnecessary redundant code.For Debian, I think I have to stay at the "linker script" solution, because Debian is currently trying to introduce BLAS implementations compiled with different threadding model (e.g. blis-pthread, blis-openmp, blis-serial). These "variants" provide the samely-named
libblis.so.2
which could be switched with the update-alternatives mechanism. Due to this design, linking seperatedlibblas.so*
againstlibblis*
would be quite ambiguous. So separatedlibblas.so
should contain all the code in this case.I tried to write a patch for building separated shared objects for Gentoo, but obviously I still need to manually select some object files from
./frame/base
to avoid potential undefined symbol error.This feature is for linux distribution integration, so please leave the actual work to me. I'll submit a PR when I have worked out a fine patch. Any comment?
CC: @heroxbd