mpimd-csc / flexiblas

FlexiBLAS - A BLAS and LAPACK wrapper library with runtime exchangeable backends. This is only a mirror of https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release
https://www.mpi-magdeburg.mpg.de/projects/flexiblas
GNU Lesser General Public License v3.0
36 stars 7 forks source link

Static build of FlexiBLAS #18

Closed Flamefire closed 2 years ago

Flamefire commented 3 years ago

Is it possible (technically) to have a static FlexiBLAS lib? I tried configuring with BUILD_SHARED_LIBS=OFF but that errored out in the examples due to multiple symbols in libflexiblas and libflexiblas_api

grisuthedragon commented 3 years ago

FlexiBLAS was never developed to be statically linked, because some of the design features, especially with the API rely on dynamic linkage. For example the backend must be shared libraries as well. One could try to create a version without the reference to the flexiblas_api library. This should fix the issue. I will take a look on it.

Flamefire commented 3 years ago

For example the backend must be shared libraries as well

That would be fine. But there may be software which requires BLAS to be statically linked or only search for static libs (for some reason) and as FlexiBLAS is meant(?) as a drop-in replacement it would be great if FlexiBLAS itself can be statically build (and use shared libs as backends)

If that is not possible, I'd heavily suggest to use add_library(flexiblas SHARED ...) to explicitely request a shared lib. The current usage says: "Do what the user requests" and as one of those doesn't work I'd say this is a bug or at least a possibility for improvement.

grisuthedragon commented 2 years ago

I added the SHARED argument to all related add_library in my internal development version. This will be in 3.1, which will be released within the next days.

grisuthedragon commented 2 years ago

The SHARED argument is added to all add_library commands in the build system. In this way it is clear that FlexiBLAS is shared library only.

grisuthedragon commented 2 years ago

Closed with 3.1.0