Fasttext: "Unsupported compiler"

Created on 9 Oct 2019  路  3Comments  路  Source: facebookresearch/fastText

Hi

I have been using fasttext for long time but when I am trying to install this on new server. I am not able to go past this "Unsupported compiler error"

I am wondering what's happening here as my gcc version seems to be quite new. Existing discussions on similar issues are not able to help.

Error is as follows
Running setup.py install for fasttext ... error
ERROR: Complete output from command /home/premraj/anaconda2/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-wus7qk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_ACfNY/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/fasttext
copying python/fasttext_module/fasttext/FastText.py -> build/lib.linux-x86_64-2.7/fasttext
copying python/fasttext_module/fasttext/__init__.py -> build/lib.linux-x86_64-2.7/fasttext
creating build/lib.linux-x86_64-2.7/fasttext/util
copying python/fasttext_module/fasttext/util/util.py -> build/lib.linux-x86_64-2.7/fasttext/util
copying python/fasttext_module/fasttext/util/__init__.py -> build/lib.linux-x86_64-2.7/fasttext/util
creating build/lib.linux-x86_64-2.7/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.linux-x86_64-2.7/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.linux-x86_64-2.7/fasttext/tests
copying python/fasttext_module/fasttext/tests/__init__.py -> build/lib.linux-x86_64-2.7/fasttext/tests
running build_ext
gcc -pthread -B /home/premraj/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/premraj/anaconda2/include/python2.7 -c /tmp/tmpeQsGLA.cpp -o tmp/tmpeQsGLA.o -std=c++14
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
gcc -pthread -B /home/premraj/anaconda2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/premraj/anaconda2/include/python2.7 -c /tmp/tmp02GnJC.cpp -o tmp/tmp02GnJC.o -std=c++11
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-wus7qk/setup.py", line 202, in
zip_safe=False,
File "/home/premraj/anaconda2/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/premraj/anaconda2/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/home/premraj/anaconda2/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/home/premraj/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/premraj/anaconda2/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/home/premraj/anaconda2/lib/python2.7/distutils/command/install.py", line 563, in run
self.run_command('build')
File "/home/premraj/anaconda2/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/home/premraj/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/premraj/anaconda2/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/home/premraj/anaconda2/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/home/premraj/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/premraj/anaconda2/lib/python2.7/site-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/home/premraj/anaconda2/lib/python2.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/premraj/anaconda2/lib/python2.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/tmp/pip-req-build-wus7qk/setup.py", line 146, in build_extensions
opts.append(cpp_flag(self.compiler))
File "/tmp/pip-req-build-wus7qk/setup.py", line 109, in cpp_flag
'Unsupported compiler -- at least C++11 support '
RuntimeError: Unsupported compiler -- at least C++11 support is needed!
----------------------------------------
ERROR: Command "/home/premraj/anaconda2/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-wus7qk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_ACfNY/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-wus7qk/

Output of gcc --version

gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

Most helpful comment

Closing this issue
Solved this

sudo apt-get install g++

All 3 comments

Closing this issue
Solved this

sudo apt-get install g++

not working in amazon Linux ec2

@premrajnarkhede how to do this without sudo?

Was this page helpful?
0 / 5 - 0 ratings