How to build FastText library from github source ?

Following are the requirements to build FastText successfully :

  • OS : Linux Distribution(like Ubuntu, CentOS, etc.) or MacOS
  • Compiler with C++11 support
    latest gcc or clang

Check if GCC is installed in your Linux Distribution :

Run the command “gcc –version” to check if gcc is installed. If not, install gcc and proceed with the building of FastText.

$ gcc –version

Build FastText

Open a terminal and run the following commands :

  1. Clone fastText.git project to your local machine using git command.
    $ git clone https://github.com/facebookresearch/fastText.git
    Git Clone fastText.git - FastText Tutorial - www.tutorialkart.com

    Git Clone fastText.git

  2. Open fastText and make the build
    $ cd fastText
    $ make
    Build FastText - FastText Tutorial - www.tutorialkart.com

    Build FastText

Verify the build

To verify if the build is successful and working, run the following command :

$ ./fasttext

“./fasttext” should output the following usage description

We have successfully built FastText.

In this FastText Tutorial, we have learnt to build fastText from github. In our next tutorial, we shall Train and Test Supervised Text Classifier.