PDA

View Full Version : [ubuntu] g++ 4.4.1 causing trouble when building the SRI Language Modelling toolkit



thejdev
November 9th, 2009, 02:38 AM
Hello there,

I've been trying to install the SRI Language Modelling toolkit (http://www.speech.sri.com/projects/srilm/) on my Dell Inspiron 1525 (3 GB RAM, 250 GB SATA HD, Core2Duo T6400 2.1 GHz, 2 MB Cache ) running Ubuntu 9.10 (gcc ver. 4.4.1). Here are my platform and compiler specs:




$ uname -a
Linux jubuntu-laptop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)


When running the makefile, it gives me the following error:


g++ -mtune=pentium3 -Wreturn-type -Wimplicit -DINSTANTIATE_TEMPLATES -D_FILE_OFFSET_BITS=64 -I. -I../../include -c -g -O3 -o ../obj/i686/NgramLM.o NgramLM.cc
In file included from Ngram.h:14,
from NgramLM.cc:36:
/usr/include/stdio.h:754: error: declaration of C function ‘int fseek(FILE*, __off64_t, int)’ conflicts with
/usr/include/stdio.h:722: error: previous declaration ‘int fseek(FILE*, long int, int)’ here
/usr/include/stdio.h:757: error: declaration of C function ‘__off64_t ftell(FILE*)’ conflicts with
/usr/include/stdio.h:727: error: previous declaration ‘long int ftell(FILE*)’ here
make[2]: *** [../obj/i686/NgramLM.o] Error 1
make[2]: Leaving directory `/home/jubuntu/srilm/lm/src'
make[1]: *** [release-libraries] Error 1
make[1]: Leaving directory `/home/jubuntu/srilm'
make: *** [World] Error 2


It looks like the fseek() function definition is conflicting with the fseeko() function . (I don't know why it's happening. It doesn't happen when I compile any other program using g++)

Can someone please help me get around this ? I need to build SRILM for use in a project of mine. Please help.

thejdev
November 9th, 2009, 06:11 AM
Hi there,

I managed to get it to compile (though I'm not getting the correct results after running the included test suite). I had to set a makefile variable (MACHINE_TYPE) to i686-gcc4 instead of i686 ... My thanks to all those who had a look ...