coccoc / coccoc-tokenizer

high performance tokenizer for Vietnamese language
GNU Lesser General Public License v3.0
393 stars 125 forks source link

build errors on Ubuntu 18.04 #2

Closed minhdc closed 5 years ago

minhdc commented 5 years ago

I followed the instructions of building this tool from README.md and encountered this error:

In file included from /home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/tokenizer/auxiliary/trie/syllable_da_trie.hpp:10,

             from /home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/tokenizer/auxiliary/trie.hpp:5,

             from /home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/tokenizer/tokenizer.hpp:10,

             from /home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/utils/tokenizer.cpp:3:

/home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/tokenizer/auxiliary/trie/da_trie.hpp: In member function ‘int DATrie<HashNode, Node>::read_from_file(const string&) [with HashNode = MultitermHashTrieNode; Node = MultitermDATrieNode]’:

/home/extreme45nm/main-projects/nlp-starter/coccoc-tokenizer/tokenizer/auxiliary/trie/da_trie.hpp:237:8: error: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Werror=unused-result]

fread(&alphabet_size, sizeof(alphabet_size), 1, in_file);

this happened several times in tokenizer.hpp file

minhdc commented 5 years ago

SOLVED: Remove the -Werror in CMakeMacro.cmake file For permission of copying files, use sudo make install

anhducle98 commented 5 years ago

Thanks for reporting the issue. Fixed with commit d5e35da.