undefined reference to external BLAS when compiling with '--enable-goto-interfaces'

92 views
Skip to first unread message

fabr...@versatushpc.com.br

unread,
May 16, 2016, 9:50:01 PM5/16/16
to libflame-discuss
Hello there

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

Field G. Van Zee

unread,
May 17, 2016, 4:35:33 PM5/17/16
to libflame...@googlegroups.com
Fabricio,

The "--enable-goto-interfaces" was also an experimental feature, and
obviously we cannot reference those external symbols if they are not
exported into the final library.

The OpenBLAS maintainer(s) may no longer support those symbols, but
there is perhaps a small chance that they are supposed to be exported
into the libopenblas library and are not for some reason.

I suggest querying them. But in the meantime, you should probably
disable that configure-time option in libflame.

Field

Fabricio

unread,
May 17, 2016, 7:25:27 PM5/17/16
to libflame-discuss
Em terça-feira, 17 de maio de 2016 17:35:33 UTC-3, Field Van Zee escreveu:
> Fabricio,
>
> The "--enable-goto-interfaces" was also an experimental feature, and
> obviously we cannot reference those external symbols if they are not
> exported into the final library.
>
> The OpenBLAS maintainer(s) may no longer support those symbols, but
> there is perhaps a small chance that they are supposed to be exported
> into the libopenblas library and are not for some reason.
>
> I suggest querying them. But in the meantime, you should probably
> disable that configure-time option in libflame.
>
> Field

Hello Field,

I've opened an issue on openblas' github, let's see what they answer.
https://github.com/xianyi/OpenBLAS/issues/881

[ ]'s
Reply all
Reply to author
Forward
0 new messages