error: boost/unordered_map.hpp: No such file or directory

596 views
Skip to first unread message

LeoNa

unread,
Aug 5, 2010, 10:53:12 AM8/5/10
to cdec users
Hi all,

I got errors compiling cdec as follows.

$ make
Making all in decoder
make[2]: Entering directory `/toolkit/cdec/decoder'
g++ -DHAVE_CONFIG_H -I. -I.. -W -Wall -Wno-sign-compare -I/toolkit/
srilm//include -g -O2 -MT tromble_loss.o -MD -MP -MF .deps/
tromble_loss.Tpo -c -o tromble_loss.o tromble_loss.cc
tromble_loss.cc:9:35: error: boost/unordered_map.hpp: No such file or
directory
tromble_loss.cc:31: error: expected initializer before ‘<’ token
tromble_loss.cc:37: error: ‘NGramMap’ has not been declared
tromble_loss.cc: In function
‘void<unnamed>::MakeNGramMapFromReferences(const
std::vector<std::vector<int, std::allocator<int> >,
std::allocator<std::vector<int, std::allocator<int> > > >&, int,
std::vector<<unnamed>::RefCounts, std::allocator<<unnamed>::RefCounts>
>*, int*)’:
tromble_loss.cc:38: error: request for member ‘clear’ in ‘* ngrams’,
which is of non-class type ‘int’
tromble_loss.cc:53: error: ‘NGramMap’ was not declared in this scope
tromble_loss.cc:53: error: wrong number of template arguments (1,
should be 2)
/usr/include/c++/4.3/bits/stl_pair.h:72: error: provided for
‘template<class _T1, class _T2> struct std::pair’
tromble_loss.cc:53: error: invalid type in declaration before ‘(’
token
tromble_loss.cc:53: error: request for member ‘insert’ in ‘* ngrams’,
which is of non-class type ‘int’
tromble_loss.cc:54: error: request for member ‘second’ in ‘ret’, which
is of non-class type ‘int’
tromble_loss.cc:63: error: request for member ‘first’ in ‘ret’, which
is of non-class type ‘int’
tromble_loss.cc: At global scope:
tromble_loss.cc:102: error: expected ‘,’ or ‘...’ before ‘&’ token
tromble_loss.cc:102: error: ISO C++ forbids declaration of ‘NGramMap’
with no type
tromble_loss.cc:102: warning: unused parameter ‘NGramMap’
tromble_loss.cc:280: error: ‘NGramMap’ was not declared in this scope
tromble_loss.cc:280: error: template argument 1 is invalid
tromble_loss.cc:280: error: template argument 2 is invalid
tromble_loss.cc: In constructor
‘TrombleLossComputerImpl::TrombleLossComputerImpl(const
std::string&)’:
tromble_loss.cc:164: error: request for member ‘resize’ in
‘((TrombleLossComputerImpl*)this)->TrombleLossComputerImpl::ref_ids_’,
which is of non-class type ‘int’
tromble_loss.cc:166: error: request for member ‘back’ in
‘((TrombleLossComputerImpl*)this)->TrombleLossComputerImpl::ref_ids_’,
which is of non-class type ‘int’
tromble_loss.cc:167: error: request for member ‘back’ in
‘((TrombleLossComputerImpl*)this)->TrombleLossComputerImpl::ref_ids_’,
which is of non-class type ‘int’
tromble_loss.cc: In member function ‘double
TrombleLossComputerImpl::Traversal(const SentenceMetadata&, const
TRule&, const std::vector<const void*, std::allocator<const void*> >&,
void*) const’:
tromble_loss.cc:184: error: request for member ‘size’ in ‘((const
TrombleLossComputerImpl*)this)->TrombleLossComputerImpl::ref_ids_’,
which is of non-class type ‘const int’
tromble_loss.cc:185: error: request for member ‘size’ in ‘((const
TrombleLossComputerImpl*)this)->TrombleLossComputerImpl::ref_ids_’,
which is of non-class type ‘const int’
tromble_loss.cc:188: error: expected initializer before ‘&’ token
tromble_loss.cc:204: error: ‘ngrams’ was not declared in this scope
tromble_loss.cc:220: error: ‘ngrams’ was not declared in this scope
tromble_loss.cc:237: error: ‘ngrams’ was not declared in this scope
tromble_loss.cc:256: error: ‘ngrams’ was not declared in this scope
make[2]: *** [tromble_loss.o] 오류 1
make[2]: Leaving directory `/toolkit/cdec/decoder'
make[1]: *** [all-recursive] 오류 1
make[1]: Leaving directory `/toolkit/cdec'
make: *** [all] 오류 2

From the following configure result, it seems that I have the boost
library for the compiler.

# ./configure --with-srilm=/toolkit/srilm/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking dependency style of g++... (cached) gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for Boost headers version >= 0... yes
checking for Boost's header version... 1_35
checking for the toolset name used by Boost for g++... gcc43 -gcc
checking boost/program_options.hpp usability... yes
checking boost/program_options.hpp presence... yes
checking for boost/program_options.hpp... yes
checking for the Boost program_options library... yes
checking boost/math/special_functions/digamma.hpp usability... yes
checking boost/math/special_functions/digamma.hpp presence... yes
checking for boost/math/special_functions/digamma.hpp... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gtest-config... no
checking Ngram.h usability... yes
checking Ngram.h presence... yes
checking for Ngram.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating extools/Makefile
config.status: creating decoder/Makefile
config.status: creating training/Makefile
config.status: creating vest/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

Should I specify the --with-boost option?

Chris Dyer

unread,
Aug 5, 2010, 11:06:25 AM8/5/10
to cdec-...@googlegroups.com
Hi, you can remove tromble_loss.cc from decoder/Makefile.am to solve
this. This code is not used, and it compiles only with certain
versions of boost.

LeoNa

unread,
Aug 5, 2010, 8:27:31 PM8/5/10
to cdec users
OK. It works now.

Thanks for your prompt reply.
> ...
>
> 추가 정보 »
Reply all
Reply to author
Forward
0 new messages