New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 2.7.14 Fails to compile on CentOS/RHEL7 #75925
Comments
I am getting the following error when trying to compile Python 2.7.14 (and previous 2.7 versions) on CentOS and RHEL7. The main problem is that CONFIG_ARGS does not exist. I've included the build. This RPATH is correct - it has to go through the RPM SPEC file so needs escaping like this to work. Python 3.6.2 builds find like this, but Python 2.7 is failing to build. Have I missed something? LDFLAGS='-Wl,-rpath=$\\$$ORIGIN/../lib' \ ... ranlib libpython2.7.a
Modules/posixmodule.o: In function `posix_tmpnam':
/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/./Modules/posixmodule.c:7642: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
Modules/posixmodule.o: In function `posix_tempnam':
/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/./Modules/posixmodule.c:7589: warning: the use of `tempnam' is dangerous, better use `mkstemp'
gcc -pthread -Wl,-rpath=RIGIN/../lib -fprofile-generate -Xlinker -export-dynamic -o python \
Modules/python.o \
-L. -lpython2.7 -lpthread -ldl -lutil -lm
LD_LIBRARY_PATH=/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14 ./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Traceback (most recent call last):
File "./setup.py", line 33, in <module>
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
TypeError: argument of type 'NoneType' is not iterable
make[2]: *** [sharedmods] Error 1
make[2]: Leaving directory `/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14'
make[1]: *** [build_all_generate_profile] Error 2
make[1]: Leaving directory `/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14'
make: *** [profile-opt] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.sFvDid (%build) -bash-4.2# cd build/lib.linux-x86_64-2.7/ |
I'm not sure whether this is related, but your quoting for --rpath On 10.10.2017 14:17, Brian Sidebotham wrote:
The CONFIG_ARGS variable should always be set, so I assume that |
Which CentOS/RHEL version do you have? Could you provide the output of 'cat /etc/redhat-release' ? |
Do you already have an existing version of Python 2.7 installed at the prefix location /opt/ws1? Because you are attempting to build with --enable-shared, the build may be picking up the already installed shared library. Try building without --enable-shared or with a unique prefix location and see if it works then. |
I'm not sure any of my emails came through to this ticket from my mail client. I think this can be closed and filed under "not a bug". Here are the mails I sent.: Hi Marc-Andre, Thanks for engaging. I fixed RPATH and now things are building successfully: LDFLAGS='-Wl,-rpath=\\$$\$$ORIGIN/../lib' \ Thank-you for your help. Best Regards, Brian. ----- Hi Charalampos, We're building for RHEL7 on the latest version. -bash-4.2$ cat /etc/redhat-release Best Regards, Brian. ---- Hi Ned, Thank-you for your advice. There was no python2 installed on the build box in /opt/wsl. Fixing the RPATH reference appears to have fixed the problem. Perhaps something in the makefile was getting eaten by the crazy escaping to get ORIGIN in the python executable. Now it looks correct: Dynamic section at offset 0x3cd0 contains 31 entries: Best Regards, Brian. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: