15

I'm trying to compile Python 3.4.1 on an emulated ARM machine (with Debian 7). ./configure gives me

checking for g++... no

but g++ is installed. So what could be the problem? I know it's not strictly needed, but I'd prefer that make will use g++ for c++ code.

Marco Sulla
  • 609
  • 1
  • 7
  • 17
  • Are you sure `g++` is installed on the machine you're compiling on? What does `command -v g++` on that machine print? How did you install g++ on that machine? – Andrew Stubbs Jul 24 '14 at 12:49
  • Are you sure g++ is installed in the location that the build script is pointing to. – Ramhound Jul 24 '14 at 12:52
  • What does `g++ -dumpmachine` say? Run from same context as `./configure` – ctrl-alt-delor Jul 24 '14 at 12:58
  • @AndrewStubbs: `root@debian:~/python3-3.4.1# command -v g++` /usr/bin/g++ . I think g++ was preinstalled, since I've not installed any other related package. – Marco Sulla Jul 24 '14 at 13:19
  • @Ramhound: I'm sure, since also gcc is in `/usr/bin`. Configure finds gcc but not g++. From configure source code it seems the search path is exactly the same. – Marco Sulla Jul 24 '14 at 13:33
  • @richard: `root@debian:~/python3-3.4.1# g++ -dumpmachine` arm-linux-gnueabihf – Marco Sulla Jul 24 '14 at 13:34

2 Answers2

18

Workaround:

CXX=/usr/bin/g++ ./configure

Anyway it's very strange and it seems to be a bug in the configure script. It seems to be a known problem. Oh well...


EDIT: It seems that --with-cxx-main is an option with a different purpose. It's required on some platforms to support C++ extension modules. I updated my answer above.

Marco Sulla
  • 609
  • 1
  • 7
  • 17
4

You can set the location of g++ manually using an environment variable passed to configure, as described in the help:

Usage: ./configure [OPTION]... [VAR=VALUE]...

For example, if you are running configure with a custom prefix your command would be:

./configure --prefix=/home/user/.local CXX="/usr/bin/g++"
user55025
  • 41
  • 1