0

I need to install a system that uses fastText onto an Amazon Linux machine.

As practice, I have been trying to build fastText from source inside an Amazon Linux 2 docker image. I noticed gcc wasn't installed by default, so I installed it first. However, running the pip3 install . command inside the fastText directory gives me the following error, also shown in the screenshot below.

RuntimeError: unsupported compiler -- at least C++11 support is needed!

gcc-7.3.1 should support c++11 but "doesn't"

I tried to look for libraries that would give explicit C++11 support, even though gcc >= 4.8 already should, so I installed libcxx.x86_64 from the Fedora EPEL repository, but that did not help.

Neither this question which applies more to Ubuntu-based images nor this question which refers to a separate pip install (and thus may not give the specific version I need) have the answer I'm looking for.

Edited to add compiler params and error message before the traceback:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall \
 -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \
--param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic \
 -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.7m \
-c /tmp/tmpi609eyh_.cpp -o tmp/tmpi609eyh_.o -std=c++11

    gcc: error trying to exec 'cc1plus': execvp: No such file or directory

Should I be trying to install whatever package contains cc1plus?

icedwater
  • 4,701
  • 3
  • 35
  • 50
  • 2
    The GCC 7 release series should have C++11 enabled as standard. Are you sure about the version used? Is there a way to check or see what flags and options are really passed to GCC? – Some programmer dude Sep 14 '22 at 06:51
  • I'd have assumed the same, I'm not sure what flags are exactly being passed in the script that `pip` calls. Let me see if I can find those. – icedwater Sep 14 '22 at 07:04
  • 1
    `libcxx` is not gcc. Did you actually install gcc, or only libcxx? – Marcin Sep 14 '22 at 07:06
  • Yup, gcc was also installed. It's 7.3.1 as in the title. Let me update the question body. Thanks for checking :) – icedwater Sep 15 '22 at 01:12
  • @Someprogrammerdude I've added the flags from the gcc call. Does anything seem off to you – icedwater Sep 15 '22 at 03:50
  • 1
    For C++ you should really invoke the `g++` driver program. And install the `g++` package (if it's separate from `gcc`). – Some programmer dude Sep 15 '22 at 05:53
  • I found a `gcc-c++` package from another thread. I'll answer it here and try to credit the other poster if it still matters to them. Thanks for taking the time to look at this though - the `gcc` invocation wasn't my choice, it was in the fastText install script. It may be worthwhile submitting a patch to them also, idk – icedwater Sep 15 '22 at 06:18

1 Answers1

5

Thanks to this answer from @Sourabh-Jain, I installed the gcc-c++ package and was able to move on in my setup process. Whoever comes across this in the future may not need to install both gcc and gcc-c++, but it is what I did. I'll edit this answer later if I manage to streamline the process.

Edit: the command that helped was

yum install gcc-c++
icedwater
  • 4,701
  • 3
  • 35
  • 50