kaldi-asr / kaldi

kaldi-asr/kaldi is the official location of the Kaldi project.
http://kaldi-asr.org
Other
14.24k stars 5.32k forks source link

make: *** [cudadecoder] Error 2 #4613

Closed kotinigor closed 3 years ago

kotinigor commented 3 years ago

I try to build Kaldi with MKL. I did these steps:

git clone -b lookahead-1.8.0 --single-branch https://github.com/alphacep/kaldi
cd kaldi/tools
./extras/install_mkl.sh
./extras/check_dependencies.sh
make
cd ../src
./configure --shared --mkl-libdir=/opt/intel/mkl/lib/intel64_lin/
make clean depend
make

And at the last step I get this error:

In file included from batched-threaded-nnet3-cuda-online-pipeline.cc:24:
../cudadecoder/batched-threaded-nnet3-cuda-online-pipeline.h:126:36: error: ‘string’ does not name a type; did you mean ‘stdin’?
   typedef std::function<void(const string &, bool, bool)> BestPathCallback;
                                    ^~~~~~
                                    stdin
batched-threaded-nnet3-cuda-online-pipeline.cc: In member function ‘void kaldi::cuda_decoder::BatchedThreadedNnet3CudaOnlinePipeline::RunCallbacksAndFinalize(const std::vector<long unsigned int>&, const std::vector<int>&, const std::vector<bool>&)’:
batched-threaded-nnet3-cuda-online-pipeline.cc:381:68: error: no match for call to ‘(const std::function<void(const int&, bool, bool)>) (const string&, bool&, bool&)’
           it_callback->second(best_path, partial, endpoint_detected);
                                                                    ^
In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/functional:59,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/tuple-weight.h:25,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/power-weight.h:28,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/arc.h:33,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/fst.h:41,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/expanded-fst.h:33,
                 from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/fstlib.h:42,
                 from ../fstext/fstext-lib.h:22,
                 from ../lat/kaldi-lattice.h:24,
                 from ../cudadecoder/cuda-fst.h:22,
                 from ../cudadecoder/cuda-decoder.h:23,
                 from ../cudadecoder/batched-threaded-nnet3-cuda-online-pipeline.h:30,
                 from batched-threaded-nnet3-cuda-online-pipeline.cc:24:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:682:5: note: candidate: ‘_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {const int&, bool, bool}]’
     function<_Res(_ArgTypes...)>::
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:682:5: note:   no known conversion for argument 1 from ‘const string’ {aka ‘const std::basic_string<char>’} to ‘const int&’
make[1]: *** [batched-threaded-nnet3-cuda-online-pipeline.o] Error 1
make[1]: Leaving directory `/home/ds/DataScience/kotin/vosk/kaldi/src/cudadecoder'
make: *** [cudadecoder] Error 2

Can you help me to resolve the error?

my system: Centos 7 gcc 8.3.1 cuda 11.4

danpovey commented 3 years ago

Likely it's because the string should be std::string. We should fix that.

On Thu, Aug 19, 2021 at 9:20 PM Igor @.***> wrote:

I try to build Kaldi with MKL. I did these steps:

git clone -b lookahead-1.8.0 --single-branch https://github.com/alphacep/kaldi

cd kaldi/tools

./extras/install_mkl.sh

./extras/check_dependencies.sh ОК!

make

cd ../src

./configure --shared --mkl-libdir=/opt/intel/mkl/lib/intel64_lin/

make clean depend

make

And at the last step I get this error:

In file included from batched-threaded-nnet3-cuda-online-pipeline.cc:24:

../cudadecoder/batched-threaded-nnet3-cuda-online-pipeline.h:126:36: error: ‘string’ does not name a type; did you mean ‘stdin’?

typedef std::function<void(const string &, bool, bool)> BestPathCallback;

                                ^~~~~~

                                stdin

batched-threaded-nnet3-cuda-online-pipeline.cc: In member function ‘void kaldi::cuda_decoder::BatchedThreadedNnet3CudaOnlinePipeline::RunCallbacksAndFinalize(const std::vector&, const std::vector&, const std::vector&)’:

batched-threaded-nnet3-cuda-online-pipeline.cc:381:68: error: no match for call to ‘(const std::function<void(const int&, bool, bool)>) (const string&, bool&, bool&)’

       it_callback->second(best_path, partial, endpoint_detected);

                                                                ^

In file included from /opt/rh/devtoolset-8/root/usr/include/c++/8/functional:59,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/tuple-weight.h:25,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/power-weight.h:28,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/arc.h:33,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/fst.h:41,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/expanded-fst.h:33,

             from /home/ds/DataScience/kotin/vosk/kaldi/tools/openfst-1.8.0/include/fst/fstlib.h:42,

             from ../fstext/fstext-lib.h:22,

             from ../lat/kaldi-lattice.h:24,

             from ../cudadecoder/cuda-fst.h:22,

             from ../cudadecoder/cuda-decoder.h:23,

             from ../cudadecoder/batched-threaded-nnet3-cuda-online-pipeline.h:30,

             from batched-threaded-nnet3-cuda-online-pipeline.cc:24:

/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:682:5: note: candidate: ‘_Res std::function<_Res(_ArgTypes ...)>::operator()(_ArgTypes ...) const [with _Res = void; _ArgTypes = {const int&, bool, bool}]’

 function<_Res(_ArgTypes...)>::

 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:682:5: note: no known conversion for argument 1 from ‘const string’ {aka ‘const std::basic_string’} to ‘const int&’

make[1]: *** [batched-threaded-nnet3-cuda-online-pipeline.o] Error 1

make[1]: Leaving directory `/home/ds/DataScience/kotin/vosk/kaldi/src/cudadecoder'

make: *** [cudadecoder] Error 2

Can you help me to resolve the error?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4613, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZFLO3XWXLVTBMQPH7SMFDT5UAJLANCNFSM5COG2ODA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

hugovbraun commented 3 years ago

The std:: are there in master, it looks like you are using the branch "lookahead-1.8.0" on some 3rd party repo, maybe it's not up to date?

kotinigor commented 3 years ago

The std:: are there in master, it looks like you are using the branch "lookahead-1.8.0" on some 3rd party repo, maybe it's not up to date?

I do the following: git clone -b lookahead-1.8.0 --single-branch https://github.com/alphacep/kaldi

kkm000 commented 3 years ago

Please open the issue in https://github.com/alphacep/kaldi then.