jermp / tongrams

A C++ library providing fast language model queries in compressed space.
MIT License
128 stars 20 forks source link

Compile fails on gcc 4.9, Debian Jessie #6

Closed vthorsteinsson closed 5 years ago

vthorsteinsson commented 5 years ago

Hi y'all,

thanks for open-sourcing this code. I am looking into using Tongrams to compress 34 million trigrams for Icelandic. However, when I try to compile the code using the standard gcc 4.9 that comes with Debian Jessie, I get multiple instances of the following error or similar ones:

(p357) villi@brandur:~/github/tongrams/build$ make -j4
[ 21%] [ 21%] [ 21%] [ 21%] Built target compact_vector_test
Building CXX object CMakeFiles/build_mph_lm.dir/build_mph_lm.cpp.o
Building CXX object CMakeFiles/build_trie_lm.dir/build_trie_lm.cpp.o
Building CXX object CMakeFiles/check_count_model.dir/test/check_count_model.cpp.o
[ 26%] Built target fast_ef_sequence_test
Scanning dependencies of target hash_compact_vector_test
[ 31%] Building CXX object CMakeFiles/hash_compact_vector_test.dir/test/hash_compact_vector_test.cpp.o
In file included from /home/villi/github/tongrams/test/../mph_count_lm.hpp:6:0,
                 from /home/villi/github/tongrams/test/../lm_types.hpp:11,
                 from /home/villi/github/tongrams/test/check_count_model.cpp:4:
/home/villi/github/tongrams/test/../utils/parsers.hpp: In constructor ‘tongrams::arpa_parser::arpa_parser(const char*)’:
/home/villi/github/tongrams/test/../utils/parsers.hpp:110:31: error: use of deleted function ‘std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)’
             , m_cur_line_num(0)
                               ^

Any hints? Is this not supposed to work on gcc 4.9? Upgrading gcc in Jessie is a bit of a pain, BTW.

vthorsteinsson commented 5 years ago

Follow-up: gcc 5 is not available at all as a Debian package, not even in the unstable branch: https://tracker.debian.org/pkg/gcc-5

jermp commented 5 years ago

Hi, I did not try to compile the code with gcc 4.9, but I will check this issue myself and let you know. Can you try to compile it with a more recent distribution of gcc (current release is 8, so 4.x is far behind) on a different architecture?

PS. Are you compiling the latest version of the code?

vthorsteinsson commented 5 years ago

Yes, did a fresh git clone, cmake and make as per your instructions. I am doing a dist-upgrade of my system from Debian Jessie to Stretch, will try this again after the upgrade.

vthorsteinsson commented 5 years ago

OK, I can confirm that after the dist-upgrade to Stretch, compiling the project works (under gcc 6.3).

jermp commented 5 years ago

:)