Skip to content
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

altinstall with --enable-shared showing incorrect behaviour #71872

Closed
ubehera mannequin opened this issue Aug 4, 2016 · 4 comments
Closed

altinstall with --enable-shared showing incorrect behaviour #71872

ubehera mannequin opened this issue Aug 4, 2016 · 4 comments
Labels
build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error

Comments

@ubehera
Copy link
Mannequin

ubehera mannequin commented Aug 4, 2016

BPO 27685
Nosy @ned-deily

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:

assignee = None
closed_at = <Date 2016-08-05.04:50:31.066>
created_at = <Date 2016-08-04.20:02:59.984>
labels = ['invalid', 'type-bug', 'expert-installation', 'build']
title = 'altinstall with --enable-shared showing incorrect behaviour'
updated_at = <Date 2016-08-05.05:04:36.529>
user = 'https://bugs.python.org/ubehera'

bugs.python.org fields:

activity = <Date 2016-08-05.05:04:36.529>
actor = 'ubehera'
assignee = 'none'
closed = True
closed_date = <Date 2016-08-05.04:50:31.066>
closer = 'ubehera'
components = ['Build', 'Installation']
creation = <Date 2016-08-04.20:02:59.984>
creator = 'ubehera'
dependencies = []
files = []
hgrepos = []
issue_num = 27685
keywords = []
message_count = 4.0
messages = ['271997', '271998', '272011', '272012']
nosy_count = 2.0
nosy_names = ['ned.deily', 'ubehera']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue27685'
versions = ['Python 2.7']

@ubehera
Copy link
Mannequin Author

ubehera mannequin commented Aug 4, 2016

When I altinstall python 2.7.12 with
./configure --prefix=/opt/python --enable-shared
it comes up as python 2.7.5 (system default python)

But altinstall with
./configure --prefix=/opt/python
it comes up as 2.7.12, what am I missing?

This is on RHEL 7.2

This is not a pathing issue:

Without --enable-shared:
[root@myrig ~]# /opt/python/bin/python2.7 -V
Python 2.7.12

With --enable-shared:
[root@myrig ~]# /opt/python/bin/python2.7 -V
Python 2.7.5

@ubehera ubehera mannequin added build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error labels Aug 4, 2016
@ned-deily
Copy link
Member

No doubt you are running into same problem that is described here: http://stackoverflow.com/questions/12553057/compile-python-2-7-3-from-source-on-a-system-with-python-2-7-already

The problem is, that on most Unix systems (with the notable exception of Mac OS X), the path to shared libraries is not an absolute path. So, if you install Python in a non-standard location, which is the right thing to do so as not to interfere with a system Python of the same version, you will need to configure in the path to the shared library or supply it via an environment variable at run time, like LD_LIBRARY_PATH. You may be better off avoiding --enable-shared; it's easy to run into problems like this with it.

@ubehera
Copy link
Mannequin Author

ubehera mannequin commented Aug 5, 2016

As Ned Deily mentioned, this fixes the issue:
./configure --enable-shared --prefix=/opt/python LDFLAGS=-Wl,-rpath=/opt/python/lib

Closing as not a bug, thanks!

@ubehera ubehera mannequin closed this as completed Aug 5, 2016
@ubehera ubehera mannequin added the invalid label Aug 5, 2016
@ubehera
Copy link
Mannequin Author

ubehera mannequin commented Aug 5, 2016

I need to have --enable-shared present while compiling to make PyInstaller work.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-installation type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant