Fasttext: compile problems on OS-X

Created on 23 Aug 2018  路  5Comments  路  Source: facebookresearch/fastText

There is a binding for fastText for nodeJS, but upgrading to the latest master produces many compile time errors as below:

https://github.com/vunb/node-fasttext/issues/20

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/fasttext/src/wrapper.o
../src/wrapper.cc:206:18: error: overload resolution selected deleted operator '='
    wordVectors_ = wordVectors;
    ~~~~~~~~~~~~ ^ ~~~~~~~~~~~
../src/../fastText/src/matrix.h:34:11: note: candidate function has been explicitly deleted
  Matrix& operator=(const Matrix&) = delete;
          ^
../src/wrapper.cc:264:12: error: no matching member function for call to 'getLine'
    dict_->getLine(in, words, labels, model_->rng);
    ~~~~~~~^~~~~~~
../src/../fastText/src/dictionary.h:101:13: note: candidate function not viable: requires 3 arguments, but 4 were provided
    int32_t getLine(std::istream&, std::vector<int32_t>&, std::vector<int32_t>&)
            ^
../src/../fastText/src/dictionary.h:103:13: note: candidate function not viable: requires 3 arguments, but 4 were provided
    int32_t getLine(std::istream&, std::vector<int32_t>&,
            ^
../src/wrapper.cc:275:13: error: no matching member function for call to 'predict'
    model_->predict(words, k, modelPredictions, hidden, output);
    ~~~~~~~~^~~~~~~
../src/../fastText/src/model.h:78:10: note: candidate function not viable: requires 4 arguments, but 5 were provided
    void predict(const std::vector<int32_t>&, int32_t, real,
         ^
../src/../fastText/src/model.h:75:10: note: candidate function not viable: requires 6 arguments, but 5 were provided
    void predict(const std::vector<int32_t>&, int32_t, real,
         ^
../src/wrapper.cc:299:21: error: no viable conversion from 'std::shared_ptr<Args>' to 'fasttext::Args'
    fastText_.train(a);
                    ^
../src/../fastText/src/args.h:22:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from
      'std::shared_ptr<Args>' to 'fasttext::Args &&' for 1st argument
class Args {
      ^
../src/../fastText/src/args.h:22:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'std::shared_ptr<Args>' to 'const fasttext::Args &' for 1st argument
../src/../fastText/src/fasttext.h:113:24: note: passing argument to parameter here
  void train(const Args);
                       ^
../src/wrapper.cc:319:24: error: no viable conversion from 'std::shared_ptr<Args>' to 'fasttext::Args'
    fastText_.quantize(a);
                       ^
../src/../fastText/src/args.h:22:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from
      'std::shared_ptr<Args>' to 'fasttext::Args &&' for 1st argument
class Args {
      ^
../src/../fastText/src/args.h:22:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'std::shared_ptr<Args>' to 'const fasttext::Args &' for 1st argument
../src/../fastText/src/fasttext.h:95:27: note: passing argument to parameter here
  void quantize(const Args);
                          ^
5 errors generated.
make: *** [Release/obj.target/fasttext/src/wrapper.o] Error 1

All 5 comments

@dcsan I had the same problem, for this reason I prefer to use a simpler solution with a node.js wrapper of the latest binary - https://github.com/loretoparisi/fasttext.js
Of course a native binary through node-gyp would be the best, but there is no official release as for the python binding.

Hi @dcsan,
We do not officially maintain any javascript bindings for the moment. @loretoparisi did indeed a nice one.

I am closing this issue. Feel free to re-open it if you have a question about the fasttext library itself.

Best regards,
Onur

haha nearly a one year anniversary on this issue 馃ぃ
well I was just using a simple exec wrapper thanks to @loretoparisi advice.

haha nearly a one year anniversary on this issue

Do you suggest I should have waited a little bit to answer? ;-)
Glad to hear everything is ok.

Feel free to ping if you have any question.
Onur

@dcsan As @Celebio anticipated you should be able ru run seamless on linux / macOs with https://github.com/loretoparisi/fasttext.js
I'm planning to update in the next days with more functionalities!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ragvri picture ragvri  路  3Comments

alanorth picture alanorth  路  3Comments

shriiitk picture shriiitk  路  3Comments

loretoparisi picture loretoparisi  路  3Comments

kurtjanssensai picture kurtjanssensai  路  3Comments