redpony / cdec

Decoder, aligner, and model optimizer for statistical machine translation and other structured prediction models based on (mostly) context-free formalisms
http://cdec-decoder.org/
Apache License 2.0
183 stars 77 forks source link

cannot build #76

Open nightshade427 opened 9 years ago

nightshade427 commented 9 years ago

I cannot build using "d42f17e" (current master) on ubuntu 14.10/14.04.

repo:

  1. git clone
  2. mkdir build
  3. cd build
  4. cmake ..
-- The C compiler identification is GNU 4.9.1                                                                           
-- The CXX compiler identification is GNU 4.9.1                                                                         
-- Check for working C compiler: /usr/bin/cc                                                                            
-- Check for working C compiler: /usr/bin/cc -- works                                                                   
-- Detecting C compiler ABI info                                                                                        
-- Detecting C compiler ABI info - done                                                                                 
-- Check for working CXX compiler: /usr/bin/c++                                                                         
-- Check for working CXX compiler: /usr/bin/c++ -- works                                                                
-- Detecting CXX compiler ABI info                                                                                      
-- Detecting CXX compiler ABI info - done                                                                               
-- Found LibDL: /usr/lib/x86_64-linux-gnu/libdl.so                                                                      
-- Boost version: 1.55.0                                                                                                
-- Found the following Boost libraries:                                                                                 
--   regex                                                                                                              
--   filesystem                                                                                                         
--   serialization                                                                                                      
--   program_options                                                                                                    
--   unit_test_framework                                                                                                
--   system                                                                                                             
--   thread                                                                                                             
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")                                            
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")                                                
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6")                                             
-- Looking for BZ2_bzCompressInit in /usr/lib/x86_64-linux-gnu/libbz2.so                                                
-- Looking for BZ2_bzCompressInit in /usr/lib/x86_64-linux-gnu/libbz2.so - found                                        
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so                                                
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found                                        
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so                                                
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found                                        
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so                                                 
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so - found                                         
-- Found LibLZMA: /usr/include (found version "5.1.0")                                                                  
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.8", minimum required is "2.7")                   
-- Found FLEX: /usr/bin/flex (found version "2.5.39")                                                                   
-- Looking for include file pthread.h                                                                                   
-- Looking for include file pthread.h - found                                                                           
-- Looking for pthread_create                                                                                           
-- Looking for pthread_create - not found                                                                               
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found                                                                   
-- Looking for pthread_create in pthread                                                                                
-- Looking for pthread_create in pthread - found                                                                        
-- Found Threads: TRUE                                                                                                  
-- Try OpenMP C flag = [-fopenmp]                                                                                       
-- Performing Test OpenMP_FLAG_DETECTED                                                                                 
-- Performing Test OpenMP_FLAG_DETECTED - Success                                                                       
-- Try OpenMP CXX flag = [-fopenmp]                                                                                     
-- Performing Test OpenMP_FLAG_DETECTED                                                                                 
-- Performing Test OpenMP_FLAG_DETECTED - Success                                                                       
-- Found OpenMP: -fopenmp                                                                                               
-- Found GTest: /usr/lib/libgtest.a                                                                                     
-- Found GMock: /usr/lib/libgmock.a                                                                                     
-- Configuring done                                                                                                     
-- Generating done                                                                                                      
-- Build files have been written to: /root/cdec/build
  1. make -j 2
[ 93%] Building CXX object extractor/CMakeFiles/alignment_test.dir/alignment_test.cc.o                                  
Linking CXX executable ../../extractor/alignment_test                                                                   
libextractor.a(alignment.cc.o): In function `igzstream::~igzstream()':                                                  
alignment.cc:(.text._ZN9igzstreamD0Ev[_ZN9igzstreamD0Ev]+0x11): undefined reference to `gzstreambase::~gzstreambase()'  
libextractor.a(alignment.cc.o): In function `igzstream::~igzstream()':                                                  
alignment.cc:(.text._ZN9igzstreamD1Ev[_ZN9igzstreamD1Ev]+0x11): undefined reference to `gzstreambase::~gzstreambase()'  
libextractor.a(alignment.cc.o): In function `ReadFile::Init(std::string const&)':                                       
alignment.cc:(.text._ZN8ReadFile4InitERKSs[_ZN8ReadFile4InitERKSs]+0x42): undefined reference to `FileExists(std::strin 
g const&)'                                                                                                              
alignment.cc:(.text._ZN8ReadFile4InitERKSs[_ZN8ReadFile4InitERKSs]+0x338): undefined reference to `gzstreambase::gzstre 
ambase(char const*, int)'                                                                                               
alignment.cc:(.text._ZN8ReadFile4InitERKSs[_ZN8ReadFile4InitERKSs]+0x643): undefined reference to `gzstreambase::~gzstr 
eambase()'                                                                                                              
libextractor.a(alignment.cc.o):(.rodata._ZTI9igzstream[_ZTI9igzstream]+0x18): undefined reference to `typeinfo for gzst 
reambase'                                                                                                               
libextractor.a(alignment.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x10): undefined reference to `t 
ypeinfo for gzstreambase'                                                                                               
libextractor.a(alignment.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x38): undefined reference to `t 
ypeinfo for gzstreambase'                                                                                               
collect2: error: ld returned 1 exit status                                                                              
extractor/CMakeFiles/alignment_test.dir/build.make:99: recipe for target '../extractor/alignment_test' failed           
make[2]: *** [../extractor/alignment_test] Error 1                                                                      
CMakeFiles/Makefile2:2945: recipe for target 'extractor/CMakeFiles/alignment_test.dir/all' failed                       
make[1]: *** [extractor/CMakeFiles/alignment_test.dir/all] Error 2                                                      
make[1]: *** Waiting for unfinished jobs....                                                                            
Linking CXX executable rampion_cccp                                                                                     
[ 93%] Built target rampion_cccp                                                                                        
Makefile:102: recipe for target 'all' failed                                                                            
make: *** [all] Error 2
nightshade427 commented 9 years ago

This is the last sha I can build with aba14a7e38e61f8158b17f41309744b39fd2abdc

JunjieHu commented 8 years ago

Hi Chris @redpony

I find the same problem when I compile the program. How to fix it? Thanks.

libextractor.a(data_array.cc.o): In functionigzstream::~igzstream()': /home/jjhu/Research/cdec/extractor/../utils/gzstream.h:98: undefined reference to gzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o): In function~igzstream': /home/jjhu/Research/cdec/extractor/../utils/gzstream.h:98: undefined reference to gzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o): In functionReadFile::Init(std::string const&)': /home/jjhu/Research/cdec/extractor/../utils/filelib.h:62: undefined reference to FileExists(std::string const&)' libextractor.a(data_array.cc.o): In functionigzstream': /home/jjhu/Research/cdec/extractor/../utils/gzstream.h:102: undefined reference to gzstreambase::gzstreambase(char const*, int)' /home/jjhu/Research/cdec/extractor/../utils/gzstream.h:102: undefined reference togzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o):(.rodata._ZTI9igzstream[_ZTI9igzstream]+0x18): undefined reference to typeinfo for gzstreambase' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x10): undefined reference totypeinfo for gzstreambase' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x18): undefined reference to gzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x20): undefined reference togzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x38): undefined reference to typeinfo for gzstreambase' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x40): undefined reference tovirtual thunk to gzstreambase::~gzstreambase()' libextractor.a(data_array.cc.o):(.rodata._ZTC9igzstream0_12gzstreambase[_ZTV9igzstream]+0x48): undefined reference to virtual thunk to gzstreambase::~gzstreambase()' collect2: error: ld returned 1 exit status make[2]: *** [extractor/data_array_test] Error 1 make[1]: *** [extractor/CMakeFiles/data_array_test.dir/all] Error 2 Linking CXX executable extract [ 94%] Built target extract make: *** [all] Error 2

carolinlawrence commented 8 years ago

I don't know what the problem is exactly but I found a workaround. The error is caused by the tests in the extractor subfolder. People who don't have gtest/gmock installed, don't run into this issue. So a quick fix is to comment out the lines in extractor/CMakeLists.txt from "if(GTEST_FOUND)" to "endif(GTEST_FOUND)"