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

3.4.2 build fails with Intel compiler #49

Closed krefson closed 3 months ago

krefson commented 3 months ago

I am attempting to build flexiblas for use with the Intel compilers, but the build fails.

cmake -B build-if-tst -DCMAKE_C_COMPILER=icx -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_INSTALL_PREFIX=/usr/local/intel cmake --build build-if -j 16

results in a compile failure

[ 38%] Building C object src/CMakeFiles/flexiblas.dir/wrapper_blas_intel.c.o
/home/kr/build/flexiblas-3.4.2/src/wrapper_blas_intel.c:229:2: error: use of undeclared identifier 'hook_pos_caxpy'
  229 |         hook_pos_caxpy = 0;
      |         ^
/home/kr/build/flexiblas-3.4.2/src/wrapper_blas_intel.c:259:2: error: use of undeclared identifier 'hook_pos_ccopy'
  259 |         hook_pos_ccopy = 0;
      |         ^
...

Is this a supported configuration/build?

On a slightly deeper investigation:

> grep hook_pos_daxpy src/wrapper_blas_*.c
src/wrapper_blas_gnu.c:static TLS_STORE uint8_t hook_pos_daxpy = 0;
src/wrapper_blas_gnu.c: hook_pos_daxpy = 0;
src/wrapper_blas_gnu.c:    hook_pos_daxpy++;
src/wrapper_blas_gnu.c:    if ( hook_pos_daxpy < __flexiblas_hooks->daxpy.nhook ) {
src/wrapper_blas_gnu.c:        *(void **) &fn = __flexiblas_hooks->daxpy.f77_hook_function[hook_pos_daxpy];
src/wrapper_blas_gnu.c:        hook_pos_daxpy = 0;
src/wrapper_blas_intel.c:       hook_pos_daxpy = 0;

it does appear that these hook_pos_<blasname> variables are not used in the intel interface, and the attempt to set them likely comes from a mistaken patch or the like. Just deleting all of the references seems to work around the compile failure.

cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.5"
...

icx --version
Intel(R) oneAPI DPC++/C++ Compiler 2024.0.2 (2024.0.2.20231213)
grisuthedragon commented 3 months ago

@krefson That seems a strange bug from our side. I will take a closer look on this asap.

Beside the bug, one hint. If you are using the icx compiler the Fortran counter part is ifx and not ifort.

grisuthedragon commented 3 months ago

Fixed in 3.4.3