Linker errors, undefined reference to LAPACK subroutines while compiling library (CMU sphinx3)

StackOverflow https://stackoverflow.com/questions/18043228

문제

I'm encountering the following error messages while trying to compile the sphinx3 module of the cmu sphinx toolkit

Making all in programs
make[2]: Entering directory `/cygdrive/c/Downloads/src/cmusphinx-code/sphinx3/src/programs'
/bin/sh ../../libtool --tag=CC    --mode=link gcc  -g -O2 -Wall -fvisibility=hidden    -o sphinx3_decode.exe main_decode.o ../../src/libs3decoder/libs3decoder.la  -lsphinxbase -lsphinxad -lm 
libtool: link: gcc -g -O2 -Wall -fvisibility=hidden -o .libs/sphinx3_decode.exe main_decode.o  ../../src/libs3decoder/.libs/libs3decoder.a -lsphinxbase -lsphinxad
/usr/local/lib/libsphinxbase.a(matrix.o): In function `determinant':
/cygdrive/c/Downloads/src/cmusphinx-code/sphinxbase/src/libsphinxbase/util/matrix.c:196: undefined reference to `_spotrf_'
/usr/local/lib/libsphinxbase.a(matrix.o): In function `solve':
/cygdrive/c/Downloads/src/cmusphinx-code/sphinxbase/src/libsphinxbase/util/matrix.c:226: undefined reference to `_sposv_'
/usr/local/lib/libsphinxbase.a(matrix.o): In function `invert':
/cygdrive/c/Downloads/src/cmusphinx-code/sphinxbase/src/libsphinxbase/util/matrix.c:254: undefined reference to `_sposv_'
/usr/local/lib/libsphinxbase.a(matrix.o): In function `matrixmultiply':
/cygdrive/c/Downloads/src/cmusphinx-code/sphinxbase/src/libsphinxbase/util/matrix.c:272: undefined reference to `_ssymm_'
collect2: ld returned 1 exit status
Makefile:420: recipe for target `sphinx3_decode.exe' failed
make[2]: *** [sphinx3_decode.exe] Error 1
make[2]: Leaving directory `/cygdrive/c/Downloads/src/cmusphinx-code/sphinx3/src/programs'
Makefile:284: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/c/Downloads/src/cmusphinx-code/sphinx3/src'
Makefile:407: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1

The problem does not appear to be that the cmu sphinx library liblsphinxbase.a cannot be found. Rather that there is something wrong with that library. I've run the nm command on this library and this is all I got (seems rather empty).

nm libsphinxbase.a | grep _spotrf_
U _spotrf_

Should the flag -llapack be added to the link step?

도움이 되었습니까?

해결책

I've tested the failed step with llapack and it works. It appears that -llapack needs to be added to the link command.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top