CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Compilation error on Kaldi-plugin

Open star013 opened this issue 10 years ago • 3 comments

First, we followed Source/Readers/KaldiReaderReadme strictly and compiled Kaldi successfully. But when we tried to compile in ~/CNTK/build/release, we noticed that Source/Readers/Kaldi2Reader/HTKMLFReader.cpp#L2010 lacked a '}'.

After correcting that error, there still exists a compilation error like this,

make -C /home/zhaoyue/CNTK BUILD_TOP=/home/zhaoyue/CNTK/build/release all make[1]: Entering directory /home/zhaoyue/CNTK' =-----------------------------------------------------------= creating /home/zhaoyue/CNTK/build/release/.build/Source/Readers/Kaldi2Reader/DataWriter.o for with build type release mpic++ -c Source/Readers/Kaldi2Reader/DataWriter.cpp -o /home/zhaoyue/CNTK/build/release/.build/Source/Readers/Kaldi2Reader/DataWriter.o -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -std=c++11 -DUSE_CUDNN -DUSE_ACML -DNDEBUG -DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -DHAVE_OPENFST_GE_10400 -msse3 -std=c++0x -fopenmp -fpermissive -fPIC -Werror -fcheck-new -Wno-error=literal-suffix -g -O4 -ISource/Common/Include -ISource/Math -ISource/CNTK -ISource/ActionsLib -ISource/ComputationNetworkLib -ISource/SGDLib -ISource/SequenceTrainingLib -ISource/CNTK/BrainScript -ISource/Readers/ReaderLib -I/usr/./include/nvidia/gdk -I/home/zhaoyue/cub-1.4.1 -I/usr/local/cuda-7.0/include -I/usr/local/cuda/include -I/opt/acml5.3.1/ifort64_mp/include -I/home/zhaoyue/kaldi/src -I/home/zhaoyue/kaldi/tools/ATLAS/include -I/home/zhaoyue/kaldi/tools/openfst/include -MD -MP -MF /home/zhaoyue/CNTK/build/release/.build/Source/Readers/Kaldi2Reader/DataWriter.d Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::GetWriter(Microsoft::MSR::CNTK::IDataWriter<ElemType>**) [with ElemType = float]’: Source/Readers/Kaldi2Reader/DataWriter.cpp:27:22: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:22:14: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’ *pwriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: because the following virtual functions are pure within ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’: class HTKMLFWriter : public IDataWriter<ElemType> ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:14:0: Source/Common/Include/DataWriter.h:65:18: note: bool Microsoft::MSR::CNTK::IDataWriter<ElemType>::SupportMultiUtterances() const [with ElemType = float] virtual bool SupportMultiUtterances() const = 0; ^ Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::GetWriter(Microsoft::MSR::CNTK::IDataWriter<ElemType>**) [with ElemType = double]’: Source/Readers/Kaldi2Reader/DataWriter.cpp:31:22: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:22:14: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’ *pwriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: because the following virtual functions are pure within ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’: class HTKMLFWriter : public IDataWriter<ElemType> ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:14:0: Source/Common/Include/DataWriter.h:65:18: note: bool Microsoft::MSR::CNTK::IDataWriter<ElemType>::SupportMultiUtterances() const [with ElemType = double] virtual bool SupportMultiUtterances() const = 0; ^ Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::InitFromConfig(const ConfigRecordType&) [with ConfigRecordType = Microsoft::MSR::CNTK::ConfigParameters; ElemType = double]’: Source/Common/Include/DataWriter.h:135:30: required from ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::Init(const Microsoft::MSR::CNTK::ConfigParameters&) [with ElemType = double]’ Source/Readers/Kaldi2Reader/DataWriter.cpp:98:16: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:38:18: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’ m_dataWriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: since type ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’ has pure virtual functions class HTKMLFWriter : public IDataWriter<ElemType> ^ Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::InitFromConfig(const ConfigRecordType&) [with ConfigRecordType = Microsoft::MSR::ScriptableObjects::IConfigRecord; ElemType = double]’: Source/Common/Include/DataWriter.h:139:30: required from ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::Init(const Microsoft::MSR::ScriptableObjects::IConfigRecord&) [with ElemType = double]’ Source/Readers/Kaldi2Reader/DataWriter.cpp:98:16: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:38:18: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’ m_dataWriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: since type ‘Microsoft::MSR::CNTK::HTKMLFWriter<double>’ has pure virtual functions class HTKMLFWriter : public IDataWriter<ElemType> ^ Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::InitFromConfig(const ConfigRecordType&) [with ConfigRecordType = Microsoft::MSR::CNTK::ConfigParameters; ElemType = float]’: Source/Common/Include/DataWriter.h:135:30: required from ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::Init(const Microsoft::MSR::CNTK::ConfigParameters&) [with ElemType = float]’ Source/Readers/Kaldi2Reader/DataWriter.cpp:99:16: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:38:18: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’ m_dataWriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: since type ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’ has pure virtual functions class HTKMLFWriter : public IDataWriter<ElemType> ^ Source/Readers/Kaldi2Reader/DataWriter.cpp: In instantiation of ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::InitFromConfig(const ConfigRecordType&) [with ConfigRecordType = Microsoft::MSR::ScriptableObjects::IConfigRecord; ElemType = float]’: Source/Common/Include/DataWriter.h:139:30: required from ‘void Microsoft::MSR::CNTK::DataWriter<ElemType>::Init(const Microsoft::MSR::ScriptableObjects::IConfigRecord&) [with ElemType = float]’ Source/Readers/Kaldi2Reader/DataWriter.cpp:99:16: required from here Source/Readers/Kaldi2Reader/DataWriter.cpp:38:18: error: cannot allocate an object of abstract type ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’ m_dataWriter = new HTKMLFWriter<ElemType>(); ^ In file included from Source/Readers/Kaldi2Reader/DataWriter.cpp:15:0: Source/Readers/Kaldi2Reader/HTKMLFWriter.h:15:7: note: since type ‘Microsoft::MSR::CNTK::HTKMLFWriter<float>’ has pure virtual functions class HTKMLFWriter : public IDataWriter<ElemType> ^ make[1]: *** [/home/zhaoyue/CNTK/build/release/.build/Source/Readers/Kaldi2Reader/DataWriter.o] Error 1 make[1]: Leaving directory/home/zhaoyue/CNTK' make: *** [all] Error 2

Could anyone give any suggestions? Thanks in advance.

star013 avatar Feb 27 '16 13:02 star013

Hello!

It looks exactly like #154. We're currently reviewing the fix proposed, but you're free to try it.

Thank you, Alexey

alexeyo26 avatar Feb 27 '16 16:02 alexeyo26

Thank you so much. I have tried that and it seems to work now.

star013 avatar Feb 28 '16 01:02 star013

Great. Watch the pull request to be aware when fix goes to master. I will close this issue now.

Thank you, Alexey

alexeyo26 avatar Feb 28 '16 11:02 alexeyo26