OpenBLAS undefined symbols

1,090 views
Skip to first unread message

Kirill Katsnelson

unread,
Aug 17, 2015, 3:24:34 PM8/17/15
to kaldi-developers
Not likely a kaldi problem; looks like I am having a wrong dependency
somewhere. I am getting a few undefined symbols when compiling against
OpenBLAS. I thought these were defined in libgfortran, but it is
certainly referenced in the command line. Has anyone seen that?

kkm@yupana:~/work/travis-temp/src[master *]$ make
. . . . .
g++ -msse -msse2 -Wall -I.. -pthread -DKALDI_DOUBLEPRECISION=0
-DHAVE_POSIX_MEMALIGN -Wno-sign-compare -Wno-unused-local-typedefs
-Winit-self -DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H
-DHAVE_OPENBLAS -I /usr/include -I
/home/kkm/work/travis-temp/tools/openfst/include -Wno-sign-compare -g
-rdynamic -Wl,-rpath=/home/kkm/work/travis-temp/tools/openfst/lib
align-equal.cc ../lm/kaldi-lm.a ../decoder/kaldi-decoder.a
../lat/kaldi-lat.a ../hmm/kaldi-hmm.a ../transform/kaldi-transform.a
../gmm/kaldi-gmm.a ../tree/kaldi-tree.a ../matrix/kaldi-matrix.a
../util/kaldi-util.a ../base/kaldi-base.a ../thread/kaldi-thread.a
-L/home/kkm/work/travis-temp/tools/openfst/lib -lfst -L/usr/lib
-lopenblas -lgfortran -Wl,-rpath=/usr/lib -lm -lpthread -ldl -o align-equal
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgetrf2(int*, int*, float*, int*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:395:
undefined reference to `sgetrf_'
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgetrf2(int*, int*, double*, int*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:400:
undefined reference to `dgetrf_'
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgetri2(int*, float*, int*, int*, float*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:407:
undefined reference to `sgetri_'
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgetri2(int*, double*, int*, int*, double*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:412:
undefined reference to `dgetri_'
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgesvd(char*, char*, int*, int*, float*, int*, float*,
float*, int*, float*, int*, float*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:423:
undefined reference to `sgesvd_'
../matrix/kaldi-matrix.a(kaldi-matrix.o): In function
`kaldi::clapack_Xgesvd(char*, char*, int*, int*, double*, int*, double*,
double*, int*, double*, int*, double*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:433:
undefined reference to `dgesvd_'
../matrix/kaldi-matrix.a(sp-matrix.o): In function
`kaldi::clapack_Xsptri(int*, float*, int*, float*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:438:
undefined reference to `ssptri_'
../matrix/kaldi-matrix.a(sp-matrix.o): In function
`kaldi::clapack_Xsptri(int*, double*, int*, double*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:442:
undefined reference to `dsptri_'
../matrix/kaldi-matrix.a(sp-matrix.o): In function
`kaldi::clapack_Xsptrf(int*, float*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:447:
undefined reference to `ssptrf_'
../matrix/kaldi-matrix.a(sp-matrix.o): In function
`kaldi::clapack_Xsptrf(int*, double*, int*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:451:
undefined reference to `dsptrf_'
../matrix/kaldi-matrix.a(tp-matrix.o): In function
`kaldi::clapack_Xtptri(int*, float*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:386:
undefined reference to `stptri_'
../matrix/kaldi-matrix.a(tp-matrix.o): In function
`kaldi::clapack_Xtptri(int*, double*, int*)':
/home/kkm/work/travis-temp/src/matrix/../matrix/cblas-wrappers.h:389:
undefined reference to `dtptri_'
. . . . .
kkm@yupana:~/work/travis-temp/src[master *]$ find /usr -name 'libgfortran*'
/usr/lib/x86_64-linux-gnu/libgfortran.so.3
/usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.spec
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.so
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortran.a
/usr/lib/gcc/x86_64-linux-gnu/4.9/libgfortranbegin.a
/usr/share/doc/libgfortran-4.9-dev
/usr/share/doc/libgfortran3

Daniel Povey

unread,
Aug 17, 2015, 3:47:54 PM8/17/15
to kaldi-developers
These are from LAPACK rather than BLAS per se, but a web search reveals that they seem to be implemented in OpenBLAS, and they must have been working before.  Grep in the OpenBLAS libraries, maybe they have split up the OpenBLAS library into BLAS and LAPACK portions.
Dan




--
You received this message because you are subscribed to the Google Groups "kaldi-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-develope...@googlegroups.com.
To post to this group, send email to kaldi-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/kaldi-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaldi-developers/55D234E9.1030200%40smartaction.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Povey

unread,
Aug 17, 2015, 4:03:50 PM8/17/15
to kaldi-developers
BTW, doing "make clean" and "make" in the matrix/ directory is a good practice if you change things like the BLAS library- just to make sure it's not an error due to that.
Dan

Kirill Katsnelson

unread,
Aug 17, 2015, 5:41:40 PM8/17/15
to kaldi-de...@googlegroups.com
I am using Ubuntu packages, since prepackaged libraries will make CI
turnaround shorter. I do not know how the packages are made.

But thanks anyway, -llapack solved it. Does it make sense to add this to
the linker flags in the Kaldi Makefile, or should we consider it just a
packaging quirk and leave Makefile alone?

-kkm
> <mailto:kaldi-developers%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> kaldi-de...@googlegroups.com
> <mailto:kaldi-de...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google
> Groups "kaldi-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to kaldi-develope...@googlegroups.com
> <mailto:kaldi-develope...@googlegroups.com>.
> To post to this group, send email to kaldi-de...@googlegroups.com
> <mailto:kaldi-de...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/kaldi-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/kaldi-developers/CAEWAuySCZ495PyfE%3Dkb4okf9Hd_M19aUNOtMTe1zCAaktMS05w%40mail.gmail.com
> <https://groups.google.com/d/msgid/kaldi-developers/CAEWAuySCZ495PyfE%3Dkb4okf9Hd_M19aUNOtMTe1zCAaktMS05w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Daniel Povey

unread,
Aug 17, 2015, 5:50:17 PM8/17/15
to kaldi-developers
If you install OpenBLAS the normal way, from source, it just produces a single library.  So adding that flag might produce linking errors on a normal Kaldi install.
Dan

--
ls -l OpenBLAS/lib*
-rw-r--r-- 1 dpovey fax        0 Aug  4 14:06 OpenBLAS/lib.grd
lrwxrwxrwx 1 dpovey fax       34 Aug  4 14:06 OpenBLAS/libopenblas.a -> libopenblas_sandybridgep-r0.2.14.a
lrwxrwxrwx 1 dpovey fax       35 Aug  4 14:07 OpenBLAS/libopenblas.so -> libopenblas_sandybridgep-r0.2.14.so
lrwxrwxrwx 1 dpovey fax       35 Aug  4 14:07 OpenBLAS/libopenblas.so.0 -> libopenblas_sandybridgep-r0.2.14.so
-rw-r--r-- 1 dpovey fax 54231058 Aug  4 14:06 OpenBLAS/libopenblas_sandybridgep-r0.2.14.a
-rwxr-xr-x 1 dpovey fax 25541935 Aug  4 14:07 OpenBLAS/libopenblas_sandybridgep-r0.2.14.so



To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-develope...@googlegroups.com.
To post to this group, send email to kaldi-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages