0
$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux2
checking EXTRAPLATDIR... 
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/users/some_name/Python-2.7.6':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

Have the python 2.7 package but not able to install due to below error that I am keep on getting..Is this due to the gcc version that I have? Is it too old?

cat config.log
configure:3838: checking whether the C compiler works
configure:3860: gcc    conftest.c  >&5 
configure:3864: $? = 0 
configure:3912: result: yes 
configure:3915: checking for C compiler default output file name
configure:3917: result: a.out
configure:3923: checking for suffix of executables
configure:3930: gcc -o conftest    conftest.c  >&5 
configure:3934: $? = 0 
configure:3956: result: 
configure:3978: checking whether we are cross compiling
configure:3986: gcc -o conftest    conftest.c  >&5 
In file included from conftest.c:11:
/usr/include/stdio.h:34:21: error: stddef.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from conftest.c:11:
/usr/include/libio.h:53:21: error: stdarg.h: No such file or directory
In file included from /usr/include/stdio.h:75,
                 from conftest.c:11:
user7375520
  • 273
  • 2
  • 15
  • 1
    Why wouldn't you install python from the packages provided by your CentOS distribution? To compile from source you need at least the `kernel-headers` package installed. – Dima Chubarov May 01 '17 at 13:13
  • @DmitriChubarov I want to upgrade to 2.7 version. By default CentOS ships with 2.6.6 version. I already have python's 2.6.6 version installed and want to upgrade to 2.7 – user7375520 May 01 '17 at 13:18
  • Can you please elaborate what exactly has to be done. Thanks! – user7375520 May 01 '17 at 13:19
  • @DmitriChubarov Verified that I have the required kernel-headers package installed. – user7375520 May 01 '17 at 13:40
  • Isn't there a _Python2.7_ rpm in the _CentOS_ repo? Did you try installing it (something like: `yum install python27`)? – CristiFati May 01 '17 at 13:52
  • kernel-headers provides `/usr/include/linux/stddef.h`. If you have this file, then gcc is not looking into the right include directories and you have to figure this out. – Dima Chubarov May 01 '17 at 13:54
  • @DmitriChubarov Yes I have this "/usr/include/linux/stddef.h". What to do then? – user7375520 May 01 '17 at 13:55
  • No, @CristiFati, there is *not* a distro-supported Python 2.7 package for CentOS 6, nor, as far as I know, for any of the other members of the RHEL 6 family of distros. This reflects these distros' emphasis on version stability. Python 2.7 is the standard Python 2 for the RHEL 7 family, however. – John Bollinger May 01 '17 at 13:57
  • How did you install `gcc`? – Dima Chubarov May 01 '17 at 14:00
  • @user7375520, the `configure` script produces a log containing a lot of details of the run. In it, you will find information about the test that `configure` attempted unsuccessfully to perform, and what the nature of the failure was. This is usually the first place to look when an Autotools `configure` script fails mysteriously. – John Bollinger May 01 '17 at 14:00
  • @DmitriChubarov gcc was already installed with version 4.4.7.. How ever, once I removed and again installed with "yum install gcc". Can u DM me i=on stackoverflow, as this post is getting very long.. Im not getting how to do it. – user7375520 May 01 '17 at 14:03
  • @JohnBollinger Buddy have already mentioned the contents of config.log file. Would be helpful if you can point out the specifics.. – user7375520 May 01 '17 at 14:07
  • Continue in chat http://chat.stackoverflow.com/rooms/143096/not-able-to-install-python-2-7-in-centos-6-9-gcc-version-is-4-4-7 – Dima Chubarov May 01 '17 at 14:13
  • Possible duplicate of [stddef.h: No such file or directory in CentOS with gcc version 4.4.7](http://stackoverflow.com/questions/43717003/stddef-h-no-such-file-or-directory-in-centos-with-gcc-version-4-4-7) – Dima Chubarov May 01 '17 at 14:18
  • @DmitriChubarov It cannot be duplicate of above question as that question was also asked by me...but didnt get any reasonable answer. Thats why posted this one with the whole context. – user7375520 May 01 '17 at 14:24
  • I cannot immediately explain the error presented, but I *can* tell you that GCC 4.4 is capable of building Python 2.7, as I have personally performed exactly such builds on CentOS 6. Do you perhaps have a conflicting GCC installed? What do `which gcc` and `gcc --version` tell you? Look also into your glibc installation, specifically the glibc-devel package, for this is what owns the system header files in which the error is being reported. – John Bollinger May 01 '17 at 14:48
  • @JohnBollinger $ which gcc /usr/bin/gcc $ gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) – user7375520 May 01 '17 at 15:03

0 Answers0