New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNTK+Kaldi plugin on RH7 #119

Closed
mravanelli opened this Issue Feb 15, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@mravanelli

mravanelli commented Feb 15, 2016

Hi,
I'm trying to compile CNTK+kaldi plugin on linux (REDHAT 7). First of all I have downloaded the latest version of Kaldi and I've compiled it without errors. Unfortunately, when compiling CNTK I met an issue. In particular at this point:

mpic++ -c Source/Readers/Kaldi2Reader/HTKMLFWriter.cpp -o /home/mravanelli/CNTK-master/build/release/.build/Source/Readers/Kaldi2Reader/HTKMLFWriter.o -D_POSIX_SOURCE -D_XOPEN_SOURCE=600 -D__USE_XOPEN2K -DUSE_CUDNN -DUSE_ACML -DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -DHAVE_OPENFST_GE_10400 -DNDEBUG -msse3 -std=c++0x -std=c++11 -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/mravanelli/cub-1.4.1 -I/home/mravanelli/cuda-7.5/include -I/usr/local/cudnn-4.0/cuda/include -I/opt/acml5.3.1/ifort64_mp/include -I/home/mravanelli/kaldi-trunk/src -I/home/mravanelli/kaldi-trunk/tools/ATLAS/include -I/home/mravanelli/kaldi-trunk/tools/openfst/include -MD -MP -MF /home/mravanelli/CNTK-master/build/release/.build/Source/Readers/Kaldi2Reader/HTKMLFWriter.d

I have obtained the following error:

In file included from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/weight.h:82:0,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/pair-weight.h:29,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/expectation-weight.h:36,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/arc.h:28,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/fst.h:34,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/fstlib.h:49,
from /home/mravanelli/kaldi-trunk/src/fstext/lattice-utils.h:24,
from Source/Readers/Kaldi2Reader/kaldi.h:4,
from Source/Readers/Kaldi2Reader/htkfeatio.h:25,
from Source/Readers/Kaldi2Reader/DataWriter.cpp:11:
/home/mravanelli/kaldi-trunk/tools/openfst/include/fst/util.h:164:21: error: reference to ‘unordered_map’ is ambiguous
READ_STL_ASSOC_TYPE(unordered_map);
^
/home/mravanelli/kaldi-trunk/tools/openfst/include/fst/util.h:149:41: note: in definition of macro ‘READ_STL_ASSOC_TYPE’
inline istream &ReadType(istream &strm, C<S, T, U> *c) { \
^
In file included from /usr/include/c++/4.8.2/tr1/unordered_map:42:0,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/util.h:24,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/weight.h:82,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/pair-weight.h:29,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/expectation-weight.h:36,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/arc.h:28,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/fst.h:34,
from /home/mravanelli/kaldi-trunk/tools/openfst/include/fst/fstlib.h:49,
from /home/mravanelli/kaldi-trunk/src/fstext/lattice-utils.h:24,
from Source/Readers/Kaldi2Reader/kaldi.h:4,
from Source/Readers/Kaldi2Reader/htkfeatio.h:25,
from Source/Readers/Kaldi2Reader/DataWriter.cpp:11:
/usr/include/c++/4.8.2/tr1/unordered_map.h:180:11: note: candidates are: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::tr1::unordered_map
class unordered_map
^
In file included from /usr/include/c++/4.8.2/unordered_map:48:0,
from Source/Readers/Kaldi2Reader/basetypes.h:27,
from Source/Readers/Kaldi2Reader/DataWriter.cpp:9:
/usr/include/c++/4.8.2/bits/unordered_map.h:97:11: note: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::unordered_map
class unordered_map : __check_copy_constructible<_Alloc>

This is then followed by many other similar errors. This seems weird because I recently compiled CNTK with kaldi plugin on Ubuntu without any error.

Any idea?

Thank you!

@eldakms

This comment has been minimized.

Show comment
Hide comment
@eldakms

eldakms Feb 15, 2016

Contributor

Hi mirco86,

We are using gcc 4.8.4. Could you try to compile with this compiler?
It seems you have an older version.
Thanks!

Contributor

eldakms commented Feb 15, 2016

Hi mirco86,

We are using gcc 4.8.4. Could you try to compile with this compiler?
It seems you have an older version.
Thanks!

@mravanelli

This comment has been minimized.

Show comment
Hide comment
@mravanelli

mravanelli Feb 15, 2016

I'm actually using gcc 4.8.5.
Is this a problem?

gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.

ll /usr/include/c++

total 4
drwxr-xr-x. 12 root root 4096 Feb 10 13:54 4.8.2
lrwxrwxrwx. 1 root root 5 Feb 10 13:54 4.8.5 -> 4.8.2

(The /usr/include/c++/4.8.2/ you find in the log file is a folder created
when installing gcc 4.8.5)

Mirco

On Mon, Feb 15, 2016 at 4:18 PM, eldakms notifications@github.com wrote:

Hi mirco86,

We are using gcc 4.8.4. Could you try to compile with this compiler?
It seems you have an older version.
Thanks!


Reply to this email directly or view it on GitHub
#119 (comment).

mravanelli commented Feb 15, 2016

I'm actually using gcc 4.8.5.
Is this a problem?

gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
Copyright (C) 2015 Free Software Foundation, Inc.

ll /usr/include/c++

total 4
drwxr-xr-x. 12 root root 4096 Feb 10 13:54 4.8.2
lrwxrwxrwx. 1 root root 5 Feb 10 13:54 4.8.5 -> 4.8.2

(The /usr/include/c++/4.8.2/ you find in the log file is a folder created
when installing gcc 4.8.5)

Mirco

On Mon, Feb 15, 2016 at 4:18 PM, eldakms notifications@github.com wrote:

Hi mirco86,

We are using gcc 4.8.4. Could you try to compile with this compiler?
It seems you have an older version.
Thanks!


Reply to this email directly or view it on GitHub
#119 (comment).

@jren2012

This comment has been minimized.

Show comment
Hide comment
@jren2012

jren2012 Feb 15, 2016

@mirco86 I'm working around this problem, my email is
j.ren@massey.ac.nz

hope we can communicate in depth

jren2012 commented Feb 15, 2016

@mirco86 I'm working around this problem, my email is
j.ren@massey.ac.nz

hope we can communicate in depth

@mravanelli

This comment has been minimized.

Show comment
Hide comment
@mravanelli

mravanelli Feb 15, 2016

Do you already have an insight of the solution? In this case it would be
good to share it with the other guys...

Mirco

On Mon, Feb 15, 2016 at 10:09 PM, JUN REN notifications@github.com wrote:

@mirco86 https://github.com/mirco86 I'm working around this problem, my
email is
j.ren@massey.ac.nz

hope we can communicate in depth


Reply to this email directly or view it on GitHub
#119 (comment).

mravanelli commented Feb 15, 2016

Do you already have an insight of the solution? In this case it would be
good to share it with the other guys...

Mirco

On Mon, Feb 15, 2016 at 10:09 PM, JUN REN notifications@github.com wrote:

@mirco86 https://github.com/mirco86 I'm working around this problem, my
email is
j.ren@massey.ac.nz

hope we can communicate in depth


Reply to this email directly or view it on GitHub
#119 (comment).

@raaaar

This comment has been minimized.

Show comment
Hide comment
@raaaar

raaaar Feb 15, 2016

Contributor

it seems the unordered_map ends up being included twice. The first time around from openfst/include/fst/util.h:

#include <tr1/unordered_map>
using std::tr1::unordered_map;

The second - from Kaldi2Reader/basetypes.h:

#include <unordered_map>
...
using namespace std; // Ugh!

Contributor

raaaar commented Feb 15, 2016

it seems the unordered_map ends up being included twice. The first time around from openfst/include/fst/util.h:

#include <tr1/unordered_map>
using std::tr1::unordered_map;

The second - from Kaldi2Reader/basetypes.h:

#include <unordered_map>
...
using namespace std; // Ugh!

@raaaar raaaar added the bug label Feb 15, 2016

@mravanelli

This comment has been minimized.

Show comment
Hide comment
@mravanelli

mravanelli Feb 16, 2016

I solved the compilation issue by strictly following the instruction
written in the "KaldiReaderReadme" file:

  1. In kaldi-trunk/tools/Makefile, uncomment # OPENFST_VERSION = 1.4.1, and
    re-install OpenFst using the makefile.
  2. In kaldi-trunk/src/, do ./configure --shared; make depend -j 8; make -j
    8;
    and re-compile Kaldi (the -j option is for parallelization).

If you don't follow it, there are the compilation problem described above.

Mirco

On Mon, Feb 15, 2016 at 11:11 PM, raaaar notifications@github.com wrote:

it seems the unordered_map ends up being included twice. The first time
around from openfst/include/fst/util.h:

#include <tr1/unordered_map>
using std::tr1::unordered_map;

The second - from Kaldi2Reader/basetypes.h:

#include <unordered_map>
...
using namespace std; // Ugh!


Reply to this email directly or view it on GitHub
#119 (comment).

mravanelli commented Feb 16, 2016

I solved the compilation issue by strictly following the instruction
written in the "KaldiReaderReadme" file:

  1. In kaldi-trunk/tools/Makefile, uncomment # OPENFST_VERSION = 1.4.1, and
    re-install OpenFst using the makefile.
  2. In kaldi-trunk/src/, do ./configure --shared; make depend -j 8; make -j
    8;
    and re-compile Kaldi (the -j option is for parallelization).

If you don't follow it, there are the compilation problem described above.

Mirco

On Mon, Feb 15, 2016 at 11:11 PM, raaaar notifications@github.com wrote:

it seems the unordered_map ends up being included twice. The first time
around from openfst/include/fst/util.h:

#include <tr1/unordered_map>
using std::tr1::unordered_map;

The second - from Kaldi2Reader/basetypes.h:

#include <unordered_map>
...
using namespace std; // Ugh!


Reply to this email directly or view it on GitHub
#119 (comment).

@mradmila

This comment has been minimized.

Show comment
Hide comment
@mradmila

mradmila Mar 14, 2016

Contributor

It seems like this issue is resolved. Please re-open if it still reproes, and provide the latest context.

Contributor

mradmila commented Mar 14, 2016

It seems like this issue is resolved. Please re-open if it still reproes, and provide the latest context.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 26, 2017

Hi, I had the same problem and solved it by updating openfst to 1.6.2.
hope that helps anyone who faces the same issue.

ghost commented Apr 26, 2017

Hi, I had the same problem and solved it by updating openfst to 1.6.2.
hope that helps anyone who faces the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment