Fasttext: Unable to install FastText from setup.py

Created on 3 Jan 2020  Â·  5Comments  Â·  Source: facebookresearch/fastText

Hi my system configuration is

Centos 7
python3.7 
system level gcc is 4.8.5 
python gcc is 7.3

image

I am doing

 git clone https://github.com/facebookresearch/fastText.git
 cd fastText
 python setup.py install

I am getting a trace of warnings and errors ending with

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
src/autotune.cc:59:28: error: redeclaration ‘fasttext::Autotune::kUnknownBestScore’ differs in ‘constexpr’
 constexpr double Autotune::kUnknownBestScore = -1.0;
                            ^
In file included from src/autotune.cc:9:0:
src/autotune.h:76:23: error: from previous declaration ‘fasttext::Autotune::kUnknownBestScore’
   static const double kUnknownBestScore;
                       ^
src/autotune.cc:59:28: error: ‘fasttext::Autotune::kUnknownBestScore’ declared ‘constexpr’ outside its class
 constexpr double Autotune::kUnknownBestScore = -1.0;
                            ^
src/autotune.cc:59:28: error: declaration of ‘const double fasttext::Autotune::kUnknownBestScore’ outside of class is not definition [-fpermissive]
src/autotune.cc:60:25: error: redeclaration ‘fasttext::Autotune::kCutoffLimit’ differs in ‘constexpr’
 constexpr int Autotune::kCutoffLimit = 256;
                         ^
In file included from src/autotune.cc:9:0:
src/autotune.h:77:20: error: from previous declaration ‘fasttext::Autotune::kCutoffLimit’
   static const int kCutoffLimit;
                    ^
src/autotune.cc:60:25: error: ‘fasttext::Autotune::kCutoffLimit’ declared ‘constexpr’ outside its class
 constexpr int Autotune::kCutoffLimit = 256;
                         ^
src/autotune.cc:60:25: error: declaration of ‘const int fasttext::Autotune::kCutoffLimit’ outside of class is not definition [-fpermissive]
error: command 'gcc' failed with exit status 1

How can I solve the problem ? I am actually trying to generate a pip installable wheel file of the fastText library.

Build Python

Most helpful comment

@Celebio I've created a PR to fix this
https://github.com/facebookresearch/fastText/pull/982

All 5 comments

I am also experiencing this same exact compiler error on the build during installation:

RHEL 7.3
gcc 4.8.5
Python 3.6.4
fasttext 0.9.1

I run this process on a schedule every 30 days without failure. A recent commit must be responsible. I'll look through the commit history and see if I can identify which ref is the latest which results in a successful build.

@Celebio I've created a PR to fix this
https://github.com/facebookresearch/fastText/pull/982

@Celebio I've created a PR to fix this

982

Your PR works for me on centOS. Thanks a lot

Hi @tonydifranco , @LucianLiu6 , @Raghava14 ,
We merged the pull request #982 , thank you for your feedback and your contribution!

Regards,
Onur

I'm having the same problem

Was this page helpful?
0 / 5 - 0 ratings