Kaldi toolkit Installation Error on Ubuntu 16.04 - linux

Hi I am trying to install Kaldi toolkit for speech recognition on Ubuntu 16.04. I have followed instructions in INSTALL file.
(1) go to tools/ and follow INSTALL instructions there.
Followed procedure in INSTALL file in tools and got following output,
$ extras/check_dependencies.sh
../tools/extras/check_dependencies.sh: all OK.
and executed make without any errors. Here are last few lines in case if you want to take a look
$ make
rm -f openfst
ln -s openfst-1.6.1 openfst
Warning: IRSTLM is not installed by default anymore. If you need IRSTLM
Warning: use the script extras/install_irstlm.sh
All done OK.
Now I moved on to next step
(2) go to src/ and follow INSTALL instructions there.
in src folder, executed configure with following output
$ ./configure
Configuring ...
Backing up kaldi.mk to kaldi.mk.bak ...
Checking compiler g++-4.9 ...
Checking OpenFst library in /home/xxx/Downloads/kaldi/tools/openfst ...
Doing OS specific configurations ...
On Linux: Checking for linear algebra header files ...
Using ATLAS as the linear algebra library.
Successfully configured for Debian/Ubuntu Linux [dynamic libraries] with ATLASLIBS =/usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3
CUDA will not be used! If you have already installed cuda drivers
and cuda toolkit, try using --cudatk-dir=... option. Note: this is
only relevant for neural net experiments
Info: configuring Kaldi not to link with Speex (don't worry, it's only needed if you
intend to use 'compress-uncompress-speex', which is very unlikely)
SUCCESS
To compile: make clean -j; make depend -j; make -j
... or e.g. -j 10, instead of -j, to use a specified number of CPUs
debug mode enabled...
+ exit 0
$ make depend also executed without any errors. But when I execute make, I get following error (I'm not copying everything because it is very long, if anyone wants I can post full output)
$ make
make[2]: Entering directory '/home/srinivas/Downloads/kaldi/src/online2'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/srinivas/Downloads/kaldi/src/online2'
make -C bin
make[2]: Entering directory '/home/srinivas/Downloads/kaldi/src/bin'
g++-4.9 -Wl,-rpath=/home/srinivas/Downloads/kaldi/tools/openfst/lib -rdynamic align-equal.o ../decoder/kaldi-decoder.a ../lat/kaldi-lat.a ../lm/kaldi-lm.a ../fstext/kaldi-fstext.a ../hmm/kaldi-hmm.a ../transform/kaldi-transform.a ../gmm/kaldi-gmm.a ../tree/kaldi-tree.a ../util/kaldi-util.a ../thread/kaldi-thread.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a /home/srinivas/Downloads/kaldi/tools/openfst/lib/libfst.so /usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3 -lm -lpthread -ldl -o align-equal
align-equal.o: In function `fst::internal::FstImpl<fst::ArcTpl<fst::TropicalWeightTpl<float> > >::WriteFstHeader(fst::Fst<fst::ArcTpl<fst::TropicalWeightTpl<float> > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../decoder/kaldi-decoder.a(training-graph-compiler.o): In function `fst::internal::FstImpl<fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > > >::WriteFstHeader(fst::Fst<fst::ReverseArc<fst::ArcTpl<fst::TropicalWeightTpl<float> > > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../decoder/kaldi-decoder.a(training-graph-compiler.o): In function `fst::internal::FstImpl<fst::ArcTpl<fst::LogWeightTpl<float> > >::WriteFstHeader(fst::Fst<fst::ArcTpl<fst::LogWeightTpl<float> > > const&, std::ostream&, fst::FstWriteOptions const&, int, std::string const&, unsigned long, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:745: undefined reference to `fst::FstHeader::Write(std::ostream&, std::string const&) const'
../fstext/kaldi-fstext.a(kaldi-fst-io.o): In function `fst::ReadFstKaldi(std::string)':
/home/srinivas/Downloads/kaldi/src/fstext/kaldi-fst-io.cc:34: undefined reference to `fst::FstHeader::Read(std::istream&, std::string const&, bool)'
/home/srinivas/Downloads/kaldi/src/fstext/kaldi-fst-io.cc:37: undefined reference to `fst::FstReadOptions::FstReadOptions(std::string const&, fst::FstHeader const*, fst::SymbolTable const*, fst::SymbolTable const*)'
../fstext/kaldi-fstext.a(kaldi-fst-io.o): In function `fst::internal::FstImpl<fst::ArcTpl<fst::TropicalWeightTpl<float> > >::ReadHeader(std::istream&, fst::FstReadOptions const&, int, fst::FstHeader*)':
/home/srinivas/Downloads/kaldi/tools/openfst/include/fst/fst.h:796: undefined reference to `fst::FstHeader::Read(std::istream&, std::string const&, bool)'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'align-equal' failed
make[2]: *** [align-equal] Error 1
make[2]: Leaving directory '/home/srinivas/Downloads/kaldi/src/bin'
Makefile:142: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/home/srinivas/Downloads/kaldi/src'
Makefile:35: recipe for target 'all' failed
make: *** [all] Error 2
I've even manually searched for libraries and they are present in the location ../tools/openfst. I even tried system wide installation of openfst, but nothing worked. Any help would be appriciated. Thanks!

Srinivas
I am also using ubuntu 16.04 LTS and I would suggest you to take a look into this website and follow step by step procedure. I think it will solve your problem.
http://jrmeyer.github.io/kaldi/2016/01/26/Installing-Kaldi.html

I solved it using g++-5. Ubuntu 16.04 by default uses g++-5 for pre-installed packages and when I try to compile Kaldi with g++-4.9 and link with Ubuntu packages that used g++-5, linker caused undefined references. I was facing similar issue with other libraries as well

To solve any such errors, I've always followed these steps:
use g++-4.8 to compile kaldi source.
add shared flag to your configure command e.g. CXX=g++-4.8 ./configure --shared
before making in src directory also make the dependencies as well e.g. sudo make depend CXX=g++-4.8
use root privileges while making and also add g++-4.8 directive to your command as well e.g. sudo make CXX=g++-4.8
after that compile the online extensions using sudo make ext CXX=g++-4.8
hopefully this will solve your problems.

You can indeed use g++-5 to compile kaldi. It will not support cuda then, as ubuntu 16.04 ships with cuda 7.5 which is incomptatible with gcc 5.
To build with support of CUDA from ubuntu 16.04 :
sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit libcupti-dev g++-4.8
cd tools; make CXX=g++-4.8
cd src; CXX=g++-4.8 ./configure --shared && make-j8

Related

How to solve "cstring: No such file or directory" when compiling gcc from source?

I am trying to compile a gcc from source since I cannot use yum, apt-get and so forth. My steps are simple:
-I download the source GCC (I tried gcc-4.8.4 and gcc-5.3.0) in my pc and I used:
./contrib/download_prerequisites
-After this, I send this my gcc source file to my system using powerPC y Linux.
mkdir objdir
cd objdir
../gcc-4.6.2/configure --prefix=/usr --enable-languages=c,c++,fortran,go
make
I have got the next error:
In file included from ../../gcc-4.9.2/gcc/genmddeps.c:19:0:
../../gcc-4.9.2/gcc/system.h:205:20: fatal error: cstring: No such file or directory
# include <cstring>
^
compilation terminated.
make[3]: *** [build/genmddeps.o] Error 1
make[3]: Leaving directory `/home/root/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/root/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/root/build'
make: *** [all] Error 2
Any idea about what it is going wrong?
Best regards
Some advice: first, compile (notably for learning purposes) something simpler than GCC, e.g. GNU make if you never compiled GNU stuff from source code.
Then compile a recent GCC (so 5.3 in january 2016) - building issues would be the same with 4.8, and GCC 5 is better! You need the gcc & libc-dev & g++ & libstdc++-dev for your host machine (the one running your future cross-compiler). I am not sure your --prefix=/usr is a good idea. Consider perhaps a --program-suffix=-mine option (otherwise, your system's /usr/bin/gcc could be overwritten, which you don't want to happen)
You could leave the default --prefix=/usr/local and later add appropriately /usr/local/bin/ into your PATH

Compile NSIS under Ubuntu 12.04

I download nsis-2.46-src.tar.bz2 from https://sourceforge.net/projects/nsis/files/ and I'm trying to compile makensis but get the errors like:
/usr/bin/ld: i386 architecture of input file `build/release/makensis/winchar.o' is incompatible with i386:x86-64 output
build.cpp:(.text+0x35eb): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned int)'
What is wrong? And where I can get Stubs, Plugins, Include components after compilation of makensis? Help me please.
Before compilation I have install mingw-w64, gcc, g++

undefined reference to symbol 'boost::future_category()'

I have installed boost along with other dependencies needed for Cassandra cpp driver on my ubuntu 12.04 LTS. When I try to run command below it ends up with two errors. I have looked for solutions but can't find any. Some say to link in the libboost_system by adding the option -lboost_system which I tried, but doesn't help.
Here is the cmd: cmake . && make && make cql_demo && make cql_test && make test && make install -lboost_system
All i want to do is to run the demo from the driver and to communicate with the cassandra database!
Errors:
-- info CMAKE_BINARY_DIR: /home/pi/experiments/cpp-driver-master2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/experiments/cpp-driver-master2
[ 42%] Built target cql
[ 85%] Built target cql_static
[ 87%] Built target CCMBridge
Linking CXX executable cql_integration_tests
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by /usr/local/lib/libboost_log.so, may conflict with libboost_thread.so.1.46.1
/usr/bin/ld: CMakeFiles/cql_integration_tests.dir/src/test_utils.cpp.o: undefined reference to symbol 'boost::future_category()'
/usr/bin/ld: note: 'boost::future_category()' is defined in DSO /usr/local/lib/libboost_thread.so.1.55.0 so try adding it to the linker command line
/usr/local/lib/libboost_thread.so.1.55.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [test/integration_tests/cql_integration_tests] Error 1
make[1]: *** [test/integration_tests/CMakeFiles/cql_integration_tests.dir/all] Error 2
make: *** [all] Error 2
The following error:
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by /usr/local/lib/libboost_log.so, may conflict with libboost_thread.so.1.46.1
is basically saying that you have two versions of Boost installed:
Custom built one in /usr/local/lib/, probably version 1.55.0.
Another one in system directories, probably version 1.46.1.
and when they both get linked to your binary version 1.46.1 wins.
You need to see all complete command lines that CMake invokes for you to tell exactly where the problem is.

gcc 4.8.1 will not make

I have a new installation of Ubuntu linux and I am trying to update my gcc complier. The latest gcc compiler depends on gmp, mpfr, and mpc, so I downloaded those and placed the source into the gcc 4.8.1 source folder, as instructed.
configure seems to have run just fine. I did not include any options, because none seemed appropriate. I just ran with the defaults.
When I run make, I get the following error:
configure: error: C++ compiler missing or inoperational
make[2]: \*** [configure-stage1-libcpp] Error 1
make[2]: Leaving directory `/home/clay/programming/C++/gcc-4.8.1'
make[1]: \*** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/clay/programming/C++/gcc-4.8.1'
make: \*** [all] Error 2
I am running out of a terminal window as root, and I did a make distclean and tried a second time, but no dice. I know it can find both gcc and cc because it says so in the make output.
Any ideas?
You need a C++ compiler to build GCC. On Ubuntu, the C++ compiler is in the package g++, separate from gcc (which is a C compiler, not a C++ compiler), so be sure to:
sudo apt-get install g++
first you should ensure a C++ compiler to build on your machine
yum install gcc-c++

Building icu4c fails due to missing findBasename

I try to cross-compiler icu4c 51.1 with Emscripten (clang) via
emconfigure source/configure --host=i386-pc-linux-gnu --prefix=${myprefix} --enable-static --disable-shared --disable-dyload --disable-renaming CXXFLAGS='-DU_USING_ICU_NAMESPACE=0' CPPFLAGS='-DU_DISABLE_RENAMING=1'
emmake make
emmake make install
It compiles most of the sources fine, but fails with
Unpacking ../source/data/in/icudt51l.dat and generating out/tmp/icudata.lst (list of data files)
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH ../bin/icupkg -d ./out/build/icudt51l --list -x \* ../source/data/in/icudt51l.dat -o out/tmp/icudata.lst
run-detectors: warning: unable to exec /usr/bin/lli-2.8: No such file or directory
run-detectors: warning: unable to exec /usr/bin/lli-2.9: No such file or directory
LLVM ERROR: Program used external function 'findBasename' which could not be resolved!
make[1]: *** [out/tmp/icudata.lst] Error 1
make[1]: Leaving directory `/home/andreas/.emscripten-libs/sources/icu4c/51.1/data'
make: *** [all-recursive] Error 2
So I am wondering, where it tries to find findBasename and what this data compiling is all about.
EDIT:
The error messages come from icupkg being built with clang, which does not make sense in this case. How can I specifc that the libraries are built with clang, but the tools with another compiler?
Sounds like it wasn't able to find, I'm guessing, ICU tool utilities lib in ../lib - might try running ldd or equivalent on icupkg

Resources