compilation problem with openblas

291 views
Skip to first unread message

Lawrence

unread,
Aug 4, 2015, 1:48:54 PM8/4/15
to kaldi-help
I downloaded the latest Kaldi, and compiled successfully with the default, i.e. ATLAS + CLAPACK

I followed the instruction under tools/ to install the latest OpenBlas. However, I got the following errors when I compiled it with OpenBlas. Thanks for the help.

test -d  || mkdir 

The version of configure script matches kaldi.mk version. Good.

make -C base 

make[1]: Entering directory `/home/Tools/kaldi/builds/test/src/base'

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 /home/Tools/OpenBLAS/build/install/include -I /home/Tools/openfst-1.4.1/include -DHAVE_OPENFST_GE_10400 -std=c++0x -g  -DHAVE_CUDA -I/usr/local/cuda/include    -c -o kaldi-math.o kaldi-math.cc

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 /home/Tools/OpenBLAS/build/install/include -I /home/Tools/openfst-1.4.1/include -DHAVE_OPENFST_GE_10400 -std=c++0x -g  -DHAVE_CUDA -I/usr/local/cuda/include    -c -o kaldi-error.o kaldi-error.cc

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 /home/Tools/OpenBLAS/build/install/include -I /home/Tools/openfst-1.4.1/include -DHAVE_OPENFST_GE_10400 -std=c++0x -g  -DHAVE_CUDA -I/usr/local/cuda/include    -c -o io-funcs.o io-funcs.cc

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 /home/Tools/OpenBLAS/build/install/include -I /home/Tools/openfst-1.4.1/include -DHAVE_OPENFST_GE_10400 -std=c++0x -g  -DHAVE_CUDA -I/usr/local/cuda/include    -c -o kaldi-utils.o kaldi-utils.cc

In file included from ../base/kaldi-common.h:35,

                 from kaldi-error.cc:31:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

In file included from ../base/kaldi-common.h:35,

                 from ../base/io-funcs.h:33,

                 from io-funcs.cc:20:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

kaldi-error.cc:173: error: expected initializer before ‘noexcept’

kaldi-error.cc:189: error: expected ‘}’ at end of input

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

In file included from ../base/kaldi-common.h:35,

                 from ../base/kaldi-math.h:33,

                 from kaldi-math.cc:22:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

make[1]: *** [kaldi-error.o] Error 1

make[1]: *** Waiting for unfinished jobs....

make[1]: *** [io-funcs.o] Error 1

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

make[1]: *** [kaldi-math.o] Error 1

In file included from ../base/kaldi-common.h:35,

                 from kaldi-utils.cc:20:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

make[1]: *** [kaldi-utils.o] Error 1

make[1]: Leaving directory `/home/Tools/kaldi/builds/test/src/base'

make: *** [base] Error 2

Daniel Povey

unread,
Aug 4, 2015, 2:12:48 PM8/4/15
to kaldi-help, Dogan Can
I just pushed a fix for this.
It didn't relate super-specifically to OpenBLAS, it was an issue where the "noexcept" feature of C++11 was being used but the define guard to prevent it being used for unsupported versions of C++ had the wrong value.   Possibly the configuration options changed a bit vs. your ATLAS install.
Dan


--
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lawrence

unread,
Aug 4, 2015, 2:59:30 PM8/4/15
to kaldi-help, doga...@usc.edu, dpo...@gmail.com
I just pulled, but didn't see the related changes. Here are what I did.

I checked that the make test on OpenBLAS all passed without reporting report error. And then 

cd src/
./configure --fst-root=/home/Tools/openfst-1.4.1 --openblas-root=/home/Tools/OpenBLAS/build/install

make depend -j 20

make -j 20


And the compilation stopped with the errors I posted before. Any suggestions?

Daniel Povey

unread,
Aug 4, 2015, 3:01:34 PM8/4/15
to Lawrence, kaldi-help, Dogan Can
Sorry, committed but forgot to push.  Try now
Dan

Lawrence

unread,
Aug 4, 2015, 3:51:10 PM8/4/15
to kaldi-help, vjd...@hotmail.com, doga...@usc.edu, dpo...@gmail.com
I got the nearly same error lines as follows

In file included from ../base/kaldi-common.h:35,

                 from kaldi-error.cc:31:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

In file included from ../base/kaldi-common.h:35,

                 from ../base/kaldi-math.h:33,

                 from kaldi-math.cc:22:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

kaldi-error.cc:173: error: expected initializer before ‘noexcept’

kaldi-error.cc:189: error: expected ‘}’ at end of input

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

In file i*** [kaldi-error.o] Error 1

make[1]: *** Waiting for unfinished jobs....

In file included from ../base/kaldi-common.h:35,

                 from ../base/io-funcs.h:33,

                 from io-funcs.cc:20:

../base/kaldi-error.h:106: error: expected ‘;’ before ‘noexcept’

make[1]: *** [kaldi-math.o] Error 1

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

make[1]: *** [kaldi-utils.o] Error 1

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

make[1]: *** [io-funcs.o] Error 1

Jan Trmal

unread,
Aug 4, 2015, 3:54:45 PM8/4/15
to kaldi-help, vjd...@hotmail.com, doga...@usc.edu, Dan Povey
What version of gcc is it? Or is it clang?
y.

Lawrence

unread,
Aug 4, 2015, 4:00:59 PM8/4/15
to kaldi-help, doga...@usc.edu, dpo...@gmail.com

gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)

clang version 3.3

Daniel Povey

unread,
Aug 4, 2015, 4:04:43 PM8/4/15
to Jan Trmal, kaldi-help, vjdtao, Dogan Can

The problem is as follows:
The command line is

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 /home/Tools/OpenBLAS/build/install/include -I /home/Tools/openfst-1.4.1/include -DHAVE_OPENFST_GE_10400 -std=c++0x -g  -DHAVE_CUDA -I/usr/local/cuda/include    -c -o kaldi-error.o kaldi-error.cc

Notice it says std=c++0x... oh, wait!  c++0x is the same as c++11!  So it should allow the noexcept keyword!

The line with an error reads:
  ~KaldiErrorMessage() KALDI_NOEXCEPT(false);  // defined in kaldi-error.cc                                                                                          

We have defined:

#if _MSC_VER >= 1900 || (!defined(_MSC_VER) && __cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define KALDI_NOEXCEPT(Predicate) noexcept((Predicate))
#else
#define KALDI_NOEXCEPT(Predicate)
#endif

So this is getting expanded to:
  ~KaldiErrorMessasge() noexcept((false));
This seems to be giving an error due to the noexcept keyword not being supported
However, the -std=c++0x flag should be causing it to accept c++11 syntax.
That flag is required because you have installed a new version of OpenFst.
Can you try replacing the -std=c++0x flag with -std=c++11 ?  



Dan


Jan Trmal

unread,
Aug 4, 2015, 4:10:41 PM8/4/15
to Dan Povey, kaldi-help, vjdtao, Dogan Can
Dan, I think gcc 4.4.1 does not have fully conforming c++11 implementation -- noexcept seems to added in gcc-4.6?
https://gcc.gnu.org/projects/cxx0x.html

it does have __GXX_EXPERIMENTAL_CXX0X__

I'd say:
either make the noexcept strictly for compiler with C++11 support (__cplusplus=201103L) or we will have to add more tests asking about the gcc version in case __GXX_EXPERIMENTAL_CXX0X__ is defined...

y.
 

Daniel Povey

unread,
Aug 4, 2015, 4:12:31 PM8/4/15
to Jan Trmal, kaldi-help, vjdtao, Dogan Can
How about you add another test for the gcc version in case __GXX_EXPERIMENTAL_CXX0X__ is defined.

I have to go somewhere this afternoon so go ahead and merge it yourself.
Dan

Jan Trmal

unread,
Aug 4, 2015, 4:34:56 PM8/4/15
to Dan Povey, kaldi-help, vjdtao, Dogan Can
ok, committed -- Lawrence, please pull and check.
y.

Lawrence

unread,
Aug 5, 2015, 11:45:54 AM8/5/15
to kaldi-help, dpo...@gmail.com, doga...@usc.edu
The compilation works mostly, but here are the lines with errors from the screen output. There's no binary generated under nnet2bin/ 

In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:66,

                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/char_traits.h:41,

                 from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/string:42,

                 from ../base/kaldi-common.h:26,

                 from nnet-shuffle-egs.cc:21:

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = const char (&)[1], _U2 = long int, _T1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _T2 = kaldi::nnet2::NnetExample*]’:

nnet-shuffle-egs.cc:78:   instantiated from here

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:90: error: invalid conversion from ‘long int’ to ‘kaldi::nnet2::NnetExample*’

../base/kaldi-math.h: At global scope:

../base/kaldi-math.h:126: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used

cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"

make[1]: *** [nnet-shuffle-egs.o] Error 1

g++ -msse*** Waiting for unfinished jobs....

make[1]: Leaving directory `/home/nlp-speech/dynamic/Resources/Tools/kaldi/builds/test/src/nnet2bin'

make: *** [nnet2bin] Error 2

g++ -m*** Waiting for unfinished jobs....

Jan Trmal

unread,
Aug 5, 2015, 11:47:40 AM8/5/15
to kaldi-help, Dan Povey, Dogan Can
I will look into it -- apparently gcc 4.4 does not know that class of warnings.
y.

Lawrence

unread,
Aug 5, 2015, 11:58:51 AM8/5/15
to kaldi-help, dpo...@gmail.com, doga...@usc.edu
Thank you for doing this. It's been reported that OpenBLAS is faster than ATLAS+CLAPACK, therefore my main purpose is to see the speedup after Kaldi installation against OpenBLAS and newer OpenFST.

If you experience that there is no such gain in speed, I do at least have a working compilation against ATLAS+CLAPACK.

Jan Trmal

unread,
Aug 5, 2015, 12:04:53 PM8/5/15
to kaldi-help, Dan Povey, Dogan Can
The general issue is that you are trying to compile something that need C++11 support using this quite old compiler -- if you'd use 4.7 or 4.8, all of these problems would be gone.
y.

Lawrence

unread,
Aug 5, 2015, 12:08:23 PM8/5/15
to kaldi-help, dpo...@gmail.com, doga...@usc.edu
OK, let me try updating g++ and see how it goes. Thanks.

Jan Trmal

unread,
Aug 5, 2015, 12:16:39 PM8/5/15
to kaldi-help, Dan Povey, Dogan Can
I'm fixing this nevertheless...
BTW, if you happen to create any speed benchmark, please share it with us.
y.

Jan Trmal

unread,
Aug 5, 2015, 12:49:32 PM8/5/15
to kaldi-help, Dan Povey, Dogan Can
OK, I ushed the fix -- should compile now even with gcc 4.4
y.

Lawrence

unread,
Aug 5, 2015, 2:55:06 PM8/5/15
to kaldi-help, dpo...@gmail.com, doga...@usc.edu
Thank you for the fix! I tried before the gcc upgrade, and passed the compilation. I'll report if I see anything strange or exiting :)
Reply all
Reply to author
Forward
0 new messages