classification
Title: Errors building python 3.9.0 from source on Centos 7 with GCC 10
Type: Stage: resolved
Components: Installation Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: cstratak, ftesser, vstinner
Priority: normal Keywords:

Created on 2020-10-09 13:19 by ftesser, last changed 2020-10-11 12:24 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
pyconfig.h ftesser, 2020-10-09 14:02
pyconfig.h ftesser, 2020-10-09 14:38
config.log.tar.gz ftesser, 2020-10-09 14:42
Messages (12)
msg378317 - (view) Author: Federico Tesser (ftesser) Date: 2020-10-09 13:19
Good afternoon.

I have some problems building python 3.9.0 from source.

Here's my configuration:

CC=/usr/local/gcc-10.2.0/bin/gcc CXX=/usr/local/gcc-10.2.0/bin/g++ CFLAGS="-I/usr/local/libuuid-1.0.3/include/ -I/usr/local/libuuid-1.0.3/include/uuid/ -I/usr/local/xz-utils-5.2.4/include/ -I/usr/local/bzip2-1.0.8/include/ -I/usr/local/gdbm-1.18.1/include/ -I/usr/local/libffi-3.3/include/ -I/usr/local/openssl-1.1.1d/openssl-1.1.1d/include/ -I/usr/local/ncurses-6.2/include/ncursestw/ -I/usr/local/readline-8.0/include/readline/ -I/usr/local/x11-7.7/libx11-1.5.0/include/ -I/usr/local/tk-8.7a3/include/ -I/usr/local/tcl-8.7a3/include/" CPPFLAGS="-I/usr/local/libuuid-1.0.3/include/ -I/usr/local/libuuid-1.0.3/include/uuid/ -I/usr/local/xz-utils-5.2.4/include/ -I/usr/local/bzip2-1.0.8/include/ -I/usr/local/gdbm-1.18.1/include/ -I/usr/local/libffi-3.3/include/ -I/usr/local/openssl-1.1.1d/openssl-1.1.1d/include/ -I/usr/local/ncurses-6.2/include/ncursestw/ -I/usr/local/readline-8.0/include/readline/ -I/usr/local/x11-7.7/libx11-1.5.0/include/ -I/usr/local/tk-8.7a3/include/ -I/usr/local/tcl-8.7a3/include/" LDFLAGS="-L/usr/local/libuuid-1.0.3/lib/ -L/usr/local/xz-utils-5.2.4/lib/ -L/usr/local/bzip2-1.0.8/lib/ -L/usr/local/gdbm-1.18.1/lib/ -L/usr/local/libffi-3.3/lib64/ -L/usr/local/openssl-1.1.1d/openssl-1.1.1d/lib/ -L/usr/local/ncurses-6.2/lib/ -L/usr/local/readline-8.0/lib/ -L/usr/local/x11-7.7/libx11-1.5.0/lib/ -L/usr/local/tk-8.7a3/lib/ -L/usr/local/tcl-8.7a3/lib/" PKG_CONFIG_PATH="/usr/local/libuuid-1.0.3/lib/pkgconfig/:/usr/local/xz-utils-5.2.4/lib/pkgconfig/:/usr/local/libffi-3.3/lib/pkgconfig/:/lib64/pkgconfig/:/usr/local/readline-8.0/lib/pkgconfig/:/usr/local/x11-7.7/libx11-1.5.0/lib/pkgconfig/:/usr/local/tk-8.7a3/lib/pkgconfig/:/usr/local/tcl-8.7a3/lib/pkgconfig/" ./configure --prefix=/usr/local/python-3.9.0/ --with-tcltk-includes="-I/usr/local/tcl-8.7a3/include/ -I/usr/local/tk-8.7a3/include/" --with-tcltk-libs="-L/usr/local/tcl-8.7a3/lib/ -L/usr/local/tk-8.7a3/lib/" --with-libs="-luuid -lX11 -ltcl8.7 -ltk8.7 -lpanelw -lbz2" --disable-ipv6 --enable-optimizations --with-lto

During the make process, I receive the following error:

Python/pytime.c: In function ‘pymonotonic’:
Python/pytime.c:907:9: error: implicit declaration of function ‘pytime_fromtimespec’; did you mean ‘pytime_fromtimeval’? [-Werror=implicit-function-declaration]
  907 |     if (pytime_fromtimespec(tp, &ts, raise) < 0) {
      |         ^~~~~~~~~~~~~~~~~~~
      |         pytime_fromtimeval
cc1: some warnings being treated as errors

If in the Makefile I change the "-Werror=implicit-function-declaration"
as "-Wno-error=implicit-function-declaration", the building process continues, but then it get stuck at:

Python/strdup.c: In function ‘strdup’:
Python/strdup.c:6:16: error: ‘NULL’ undeclared (first use in this function)
    6 |     if (str != NULL) {
      |                ^~~~
Python/strdup.c:1:1: note: ‘NULL’ is defined in header ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?

If I add the "#include <stddef.h>" in file "Python/strdup.c:", then the process continues, until I receive the following error:

./Modules/getpath.c:1198:14: error: incompatible types when assigning to type ‘PyStatus’ from type ‘int’

If I explicitly add in file "Include/internal/pycore_initconfig.h", just after line 25, the following 3 lines:

 .func = 0, \
 .err_msg = 0, \
 .exitcode = 0}

Addition wich does not help, because the building process stop itself again at the previous point.

Can you tell me where I am doing wrong?

Best regards,

Federico Tesser
msg378318 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-09 13:31
What is your operating system? Can you please attach your pyconfig.h file?
msg378319 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-09 13:37
Python/strdup.c has been removed from the master branch in bpo-41340:

commit 5798f787779006a94a55ec74a86da4627de90146
Author: wasiher <watashiwaher@gmail.com>
Date:   Mon Jul 27 12:28:45 2020 +0900

    bpo-41340: Removed fallback implementation for strdup (GH-21634)

Your C library doesn't provide an implementation of strdup()?
msg378320 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-09 13:39
> ./Modules/getpath.c:1198:14: error: incompatible types when assigning to type ‘PyStatus’ from type ‘int’

Do you have HAVE_READLINK defined? calculate_argv0_path() calls resolve_symlinks() without checking if HAVE_READLINK is defined.
msg378324 - (view) Author: Federico Tesser (ftesser) Date: 2020-10-09 14:02
Operating System Centos 7.

Here attached the pyconfig.h.

Oddly, it seems that HAVE_READLINK is not configured.

Any suggestions?
msg378325 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-09 14:19
> Operating System Centos 7.

Oh. That's surprising: there are multiple RHEL7 buildbots and there is no build or test issue on this OS. I would expect Centos 7 to be support, except that you installed GCC 10. We also tested Python 3.9 on GCC 10. Again, I would expect no build issue.

> Oddly, it seems that HAVE_READLINK is not configured.

It might be something wrong with your build system.

In your pyconfig.h, I see can many issues:

/* #undef HAVE_STRDUP */
/* #undef HAVE_READLINK */
/* #undef HAVE_CLOCK_GETTIME */

Please check your compiler flags. Check also config.log: please attach it to the issue as well.
msg378326 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2020-10-09 14:24
The RHEL7 buildbots test on the default system compiler (GCC 4.8). The combination of RHEL7 + GCC10 + Python 3.9 could do very weird stuff, and I don't think it would easy to support.

Generally the build environment of an OS is tied to the default compiler toolchain and that involves also the various compiler and linker flags which might be obsoleted in newer versions.
msg378327 - (view) Author: Federico Tesser (ftesser) Date: 2020-10-09 14:38
Same problems using gcc 4.8.5.
Attached you will find the corresponding "pyconfig.h" and "config.log"

It seems quite odd to me too
msg378328 - (view) Author: Federico Tesser (ftesser) Date: 2020-10-09 14:42
Here the "config.log"
msg378330 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-09 14:57
config.log:

configure:11697: checking for readlink
configure:11697: gcc -pthread -(...) -lpanelw -lbz2 -lpthread -ldl  >&5
/bin/ld: cannot find -lpanelw

It seems like many tests are failing because of -lpanelw and the missing library.

According to config.log, you passed it explicitly to the configure command:

  $ ./configure --prefix=/usr/local/python-3.9.0/ --with-tcltk-includes=-I/usr/local/tcl-8.7a3/include/ -I/usr/local/tk-8.7a3/include/ --with-tcltk-libs=-L/usr/local/tcl-8.7a3/lib/ -L/usr/local/tk-8.7a3/lib/ --with-libs=-luuid -lX11 -ltcl8.7 -ltk8.7 -lpanelw -lbz2 --disable-ipv6 --enable-optimizations --with-lto

Try to remove -lpanelw.
msg378333 - (view) Author: Federico Tesser (ftesser) Date: 2020-10-09 15:04
I am sorry to have bothered you. I found the problem:

In "config.log" you can see that "/bin/ld" did not found "-lpanelw". The problem was that in ncurses-6.2 it was "-lpaneltw".

Pyhon has been succesfully installed, using gcc 4.8.5 toolchain, as suggested.

Best regards,

Federico Tesser
msg378427 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-10-11 12:24
> In "config.log" you can see that "/bin/ld" did not found "-lpanelw".

Yep, that's what I wrote in my previous message :-)

I understand that you solved your issue, so I close this issue.
History
Date User Action Args
2020-10-11 12:24:46vstinnersetstatus: open -> closed
resolution: not a bug
messages: + msg378427

stage: resolved
2020-10-09 15:04:17ftessersetmessages: + msg378333
2020-10-09 14:57:29vstinnersetmessages: + msg378330
2020-10-09 14:42:20ftessersetfiles: + config.log.tar.gz

messages: + msg378328
2020-10-09 14:38:39ftessersetfiles: + pyconfig.h
2020-10-09 14:38:23ftessersetmessages: + msg378327
2020-10-09 14:24:27cstrataksetnosy: + cstratak
messages: + msg378326
2020-10-09 14:19:43vstinnersetmessages: + msg378325
title: Errors building python 3.9.0 from source -> Errors building python 3.9.0 from source on Centos 7 with GCC 10
2020-10-09 14:02:59ftessersetfiles: + pyconfig.h

messages: + msg378324
2020-10-09 13:39:19vstinnersetmessages: + msg378320
2020-10-09 13:37:24vstinnersetmessages: + msg378319
2020-10-09 13:31:39vstinnersetnosy: + vstinner
messages: + msg378318
2020-10-09 13:19:51ftessercreate