Closed Meng-37 closed 4 years ago
Can you check your g++ version ? g++ --version
Thank you for replying! Information against the g++ version is:
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
I can tell that 2012
seems out-dated. Do I need to install a newer version, and which version shall I choose if so?
I have the following: g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Let me know how it goes.
Hi there! Sorry to report this late, but I still encounter problems compiling fasttext.cc
even after updating g++ to 7.3.0. Detailed information is as below:
src/fasttext.cc: In member function ‘void fasttext::FastText::printLabelStats(std::istream&, int32_t, fasttext::real) const’: src/fasttext.cc:445:40: warning: ‘void fasttext::FastText::writePerLabelMetrics(std::ostream&, fasttext::Meter&) const’ is deprecated: This function is deprecated and will be removed along with
printLabelStats
. [-Wdeprecated-declarations] writePerLabelMetrics(std::cout, meter); ^ In file included from src/fasttext.cc:10:0: src/fasttext.h:126:8: note: declared here void writePerLabelMetrics(std::ostream&, Meter&) const; ^~~~~~~~ c++ -pthread -std=c++0x -O3 -funroll-loops args.o dictionary.o productquantizer.o matrix.o qmatrix.o vector.o model.o utils.o fasttext.o src/main.cc -o fasttext src/main.cc: In function ‘void test(const std::vector<std::__cxx11::basic_string>&)’: src/main.cc:159:51: warning: ‘void fasttext::FastText::writePerLabelMetrics(std::ostream&, fasttext::Meter&) const’ is deprecated: This function is deprecated and will be removed along with printLabelStats
. [-Wdeprecated-declarations] fasttext.writePerLabelMetrics(std::cout, meter); ^ In file included from src/main.cc:15:0: src/fasttext.h:126:8: note: declared here void writePerLabelMetrics(std::ostream&, Meter&) const; ^~~~~~~~ fasttext.o: In functionfasttext::FastText::test(std::istream&, int, float, fasttext::Meter&) const': fasttext.cc:(.text+0x1960): undefined reference to
fasttext::Meter::log(std::vector<int, std::allocator> const&, std::vector<std::pair<float, int>, std::allocator<std::pair<float, int> > > const&)' fasttext.o: In function fasttext::FastText::writePerLabelMetrics(std::ostream&, fasttext::Meter&) const': fasttext.cc:(.text+0x261b): undefined reference to
fasttext::Meter::precision(int)' fasttext.cc:(.text+0x26ca): undefined reference tofasttext::Meter::recall(int)' fasttext.cc:(.text+0x2811): undefined reference to
fasttext::Meter::f1Score(int)' fasttext.o: In functionfasttext::FastText::test(std::istream&, int, float)': fasttext.cc:(.text+0x2fb1): undefined reference to
fasttext::Meter::recall() const' fasttext.cc:(.text+0x2fc1): undefined reference tofasttext::Meter::precision() const' /tmp/ccvKyczq.o: In function
test(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator cxx11::basic_string<char, std::char_traits>, std::allocator<std:: , std::allocator > > > const&)': main.cc:(.text+0x1278): undefined reference to fasttext::Meter::writeGeneralMetrics(std::ostream&, int) const' /tmp/ccvKyczq.o: In function
quantize(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator cxx11::basic_string<char, std::char_traits>, std::allocator<std:: , std::allocator > > > const&)': main.cc:(.text+0x142e): undefined reference to fasttext::Args::parseArgs(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)' /tmp/ccvKyczq.o: In function
train(std::vector<std::cxx11::basic_string<char, std::char_traits, std::allocator cxx11::basic_string<char, std::char_traits>, std::allocator<std:: , std::allocator > > >)': main.cc:(.text+0x1999): undefined reference to `fasttext::Args::parseArgs(std::vector<std::cxx11::basic_string<char, std::char_traits , std::allocator cxx11::basic_string<char, std::char_traits>, std::allocator<std:: , std::allocator > > > const&)' collect2: error: ld returned 1 exit status make: *** [fasttext] Error 1
Suggestions of possible directions for resolving this problem are appreciated!
When I try to compile the library as Setup & Requirements suggests by running make command, errors pop up as below: c++ -pthread -std=c++0x -O3 -funroll-loops args.o dictionary.o productquantizer.o matrix.o shmem_matrix.o qmatrix.o vector.o model.o utils.o fasttext.o src/main.cc -o fasttext -lrt ld: library not found for -lrt clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [fasttext] Error 1 how to fix on macbook
I have the same exact issue as you, @nguyenxuanhoi2903, did you ever get it to work?
Closing the issue due to lack of activity. Will reopen it if the error still persists with the new versions.
Hello! When I try to compile the library as Setup & Requirements suggests by running
make
command, errors pop up as below:I assume it's about c++, but I'm not familiar with that, can someone help?
Also I tried running
python setup.py build_ext
from./sent2vec/src
, but again errors occur:Information against the OS is
Thanks in advance!