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

Arch-independent config header #36

Open Enchufa2 opened 1 year ago

Enchufa2 commented 1 year ago

I was taking a look at the automated checks for the latest update, and there's this warning:

Undeclared file conflicts:
flexiblas-devel-3.3.1-1.fc39.i686 provides /usr/include/flexiblas/flexiblas_config.h which is also provided by flexiblas-devel-3.3.1-1.fc39.x86_64
flexiblas-devel-3.3.1-1.fc39.x86_64 provides /usr/include/flexiblas/flexiblas_config.h which is also provided by flexiblas-devel-3.3.1-1.fc39.i686

The issue is that both the i686 and x86_64 devel packages provide the same config header, but with different contents. This creates a conflict in multilib settings. I implemented this fix that basically renames the file as flexiblas_config-%{_arch}.h and replaces the original with an arch-independent stub (see this for further info).

Please, let me know if you see any issue with this approach. If this can be solved upstream, that would be nice. Otherwise, I'll leave this fix in place if you find no shortcomings.

grisuthedragon commented 1 year ago

The reason for the changing flexiblas_config.h file is, that it contains the library search path, which are different between i686 and x86_64. Namely, these defines are affected by this:

#define FLEXIBLAS_DEFAULT_LIB_PATH "/usr/lib64/flexiblas/"
#define CMAKE_INSTALL_FULL_LIBDIR "/usr/lib64"

For now, I think your fix is ok, but for future use, e.g. in a multi-arch Debian/Ubuntu system, I have to build a similar solution into FlexiBLAS.