I've been having problems linking a (relatively) simple code with liflame 5.10.
libflame itself was compiled with the following options:
=======================================
--enable-debug \
--enable-static-build \
--enable-dynamic-build \
--enable-supermatrix \
--enable-vector-intrinsics=sse \
--enable-goto-interfaces \
--enable-lapack2flame \
--enable-multithreading=openmp
=======================================
When linking the code, the following error messages appear:
===========================================================
gcc test_add.o libflame/lib/libflame.a openblas/lib/libopenblaso.a -lm -lpthread -ldl -lgfortranbegin -lgfortran -fopenmp -o t
libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3a3): undefined reference to `sgemm_q'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3aa): undefined reference to `sgemm_r'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3b6): undefined reference to `sgemm_p'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3c4): undefined reference to `dgemm_q'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3ce): undefined reference to `dgemm_p'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3db): undefined reference to `cgemm_q'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3e5): undefined reference to `cgemm_p'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3ef): undefined reference to `zgemm_q'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x3f9): undefined reference to `zgemm_p'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x419): undefined reference to `dgemm_r'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x451): undefined reference to `cgemm_r'
/libflame/lib/libflame.a(FLA_Blocksize.o): In function `FLA_Query_blocksize':
(.text+0x45b): undefined reference to `zgemm_r'
collect2: error: ld returned 1 exit status
make: *** [t] Error 1
===============================================
As far as I can tell, this errors happens because this code at the beginning of 'src/base/flamec/main/FLA_Blocksize.c' :
========================================
#ifdef FLA_ENABLE_GOTO_INTERFACES
static FLA_Bool first_time = TRUE;
extern void blas_set_parameter( void );
extern long sgemm_p, sgemm_q, sgemm_r;
extern long dgemm_p, dgemm_q, dgemm_r;
extern long cgemm_p, cgemm_q, cgemm_r;
extern long zgemm_p, zgemm_q, zgemm_r;
long fla_goto_gemm_blocksize[4][4];
#endif
=======================================
These 'extern long ...' variables match with the undefined references above.
They seem to come from here:
https://github.com/xianyi/OpenBLAS/blob/develop/driver/others/parameter.c
But are not present in the final library file.
Is it a bug on openblas linking procedure or what?
TIA,
Fabricio