jadooman / phonetisaurus

Automatically exported from code.google.com/p/phonetisaurus
0 stars 0 forks source link

Compilation error #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to compile in linux (g++ 4.6.2, GNU Make 3.82) the checked out code (as 
of 27th of May), I got the following error

# make
g++ -O2 -I 3rdparty/google  Phonetisaurus.cpp -c -o Phonetisaurus.o
In file included from 3rdparty/google/dense_hash_map:107:0,
                 from MBRDecoder.hpp:33,
                 from Phonetisaurus.hpp:36,
                 from Phonetisaurus.cpp:39:
3rdparty/google/sparsehash/libc_allocator_with_realloc.h:36:44: fatal error: 
google/sparsehash/sparseconfig.h: No such file or directory
compilation terminated.
make: *** [Phonetisaurus.o] Error 1
#

The simple fix that worked for me is to add "-I 3rdparty " to the EXTRA 
variavle in Makefile, as depicted in the patch below

--- Makefile.org        2012-05-27 21:12:20.000000000 +0300
+++ Makefile    2012-05-27 21:53:37.831096298 +0300
@@ -30,7 +30,7 @@
 LIBS=-lfst -ldl -lm
 OUT=../phonetisaurus-g2p ../phonetisaurus-align ../phonetisaurus-arpa2fst
 TMP=*.o
-EXTRA=-O2
+EXTRA=-O2 -I 3rdparty

 POBJS=Phonetisaurus.o FstPathFinder.o MBRDecoder.o 
 MOBJS=M2MFstAligner.o FstPathFinder.o MBRDecoder.o 

Original issue reported on code.google.com by jsala...@gmail.com on 27 May 2012 at 7:04

GoogleCodeExporter commented 9 years ago
This is the actual output of the make command (please forget the previous)

g++ -O2 FstPathFinder.cpp -c -o FstPathFinder.o
g++ -O2 Phonetisaurus.cpp -c -o Phonetisaurus.o
In file included from MBRDecoder.hpp:33:0,
                 from Phonetisaurus.hpp:36,
                 from Phonetisaurus.cpp:39:
3rdparty/google/dense_hash_map:100:44: fatal error: 
google/sparsehash/sparseconfig.h: No such file or directory
compilation terminated.
make: *** [Phonetisaurus.o] Error 1

Original comment by jsala...@gmail.com on 27 May 2012 at 7:09

GoogleCodeExporter commented 9 years ago
Hi, could you also provide the version of g++ you are running and your OS info? 
 I can't seem to duplicate this error.  

Original comment by Josef.Ro...@gmail.com on 28 May 2012 at 7:41

GoogleCodeExporter commented 9 years ago
Nevermind.  The issue was that default includes for googlehash assume that you 
have installed the library at the system level.  I edited them so that this is 
no longer necessary.

Original comment by Josef.Ro...@gmail.com on 28 May 2012 at 8:00