Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Remember: use logout to logout.


devel / comp.lang.python / Re: Making 'compiled' modules work with multiple python versions on Linux

SubjectAuthor
o Re: Making 'compiled' modules work with multiple python versions on LinuxBarry Scott

1
Re: Making 'compiled' modules work with multiple python versions on Linux

<mailman.32.1711731201.3468.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29754&group=comp.lang.python#29754

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry Scott)
Newsgroups: comp.lang.python
Subject: Re: Making 'compiled' modules work with multiple python versions on
Linux
Date: Fri, 29 Mar 2024 16:45:58 +0000
Lines: 51
Message-ID: <mailman.32.1711731201.3468.python-list@python.org>
References: <CA+cSArj6HQ=ULfoa2R7Jwc_M-8k7mBbTHU6Qsm5BsyzhVFwBeQ@mail.gmail.com>
<72BBD020-130F-4026-9A53-F757C2576654@barrys-emacs.org>
<CA+cSAriYX3wzYUG1_9ejeA=EDnKeM-Vu0DtaWN+AEnbnawy8pA@mail.gmail.com>
<3E7DA517-1239-4BCB-816C-440F0B95A88E@barrys-emacs.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\))
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de AafdiJNbEy55m++9dLKzegJ2CJs0apk795Nv5yYJxGtw==
Cancel-Lock: sha1:fpxM5oqbyLcdjDzr5MsQ72Lewjs= sha256:VB9ZicKub4E0AIHKOLoU+3rmdthxytAaulNAhnyWBRw=
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pfxlen:0': 0.03;
'subject:python': 0.06; 'linux,': 0.07; 'mar': 0.07; 'translate':
0.07; 'cc:addr:python-list': 0.09; 'from:addr:barry': 0.09;
'linux': 0.09; 'received:217.70': 0.09; 'received:217.70.178':
0.09; 'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'cc:no real name:2**0': 0.14; '2024': 0.16; 'barry': 0.16;
'from:addr:barrys-emacs.org': 0.16; 'from:name:barry scott': 0.16;
'message-id:@barrys-emacs.org': 0.16; 'missed': 0.16; 'recall.':
0.16; 'subject:compiled': 0.16; 'subject:modules': 0.16; 'wrote:':
0.16; 'python': 0.16; 'api': 0.17; 'instead': 0.17;
'cc:addr:python.org': 0.20; 'maybe': 0.22; 'cc:2**0': 0.25;
'seems': 0.26; 'practices': 0.26; '>>>': 0.28; 'version.': 0.28;
'it,': 0.29; 'module': 0.31; 'python-list': 0.32; 'but': 0.32;
"i'll": 0.33; 'windows': 0.34; 'same': 0.34; 'work.': 0.34;
'header:In-Reply-To:1': 0.34; 'built': 0.36; 'system,': 0.36;
'could': 0.38; 'try': 0.40; 'should': 0.40; 'lack': 0.60;
'physical': 0.60; 'load': 0.62; 'limited': 0.62; 'copy': 0.63;
'look': 0.65; 'received:217': 0.67; 'mars': 0.69; 'linking': 0.76;
'effect,': 0.84; 'pointing': 0.84; 'subject: \n ': 0.84
In-Reply-To: <CA+cSAriYX3wzYUG1_9ejeA=EDnKeM-Vu0DtaWN+AEnbnawy8pA@mail.gmail.com>
X-Mailer: Apple Mail (2.3774.500.171.1.1)
X-GND-Sasl: barry@barrys-emacs.org
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <3E7DA517-1239-4BCB-816C-440F0B95A88E@barrys-emacs.org>
X-Mailman-Original-References: <CA+cSArj6HQ=ULfoa2R7Jwc_M-8k7mBbTHU6Qsm5BsyzhVFwBeQ@mail.gmail.com>
<72BBD020-130F-4026-9A53-F757C2576654@barrys-emacs.org>
<CA+cSAriYX3wzYUG1_9ejeA=EDnKeM-Vu0DtaWN+AEnbnawy8pA@mail.gmail.com>
 by: Barry Scott - Fri, 29 Mar 2024 16:45 UTC

> On 29 Mar 2024, at 16:09, Olivier B. <perso.olivier.barthelemy@gmail.com> wrote:
>
> It is not a symlink on my system, where i built python myself, but a
> 15KB so file. But it seems to lack lots of python symbols.
>
> Maybe what i should do is actually make libpython.so a physical copy
> of libpyton311.so before linking to it, so now on any system the
> module would look to load libpython.so, which could be pointing to any
> version. I'll try that next

You do not link against the .so at all. All the symbols you need are defined in the
python process that loads the extension. Try without the -lpython and it should
just work.

Barry

>
> Le ven. 29 mars 2024 à 10:10, Barry <barry@barrys-emacs.org> a écrit :
>>
>>
>>
>>> On 28 Mar 2024, at 16:13, Olivier B. via Python-list <python-list@python.org> wrote:
>>>
>>> But on Linux, it seems that linking to libpython3.so instead of
>>> libpython3.11.so.1.0 does not have the same effect, and results in
>>> many unresolved python symbols at link time
>>>
>>> Is this functionality only available on Windows?
>>
>> Python limited API works on linux, but you do not link against the ..so on linux I recall.
>>
>> You will have missed that libpython3.so is a symlink to libpython3.11.so.10.
>>
>> Windows build practices do not translate one-to-one to linux, or macOS.
>>
>> Barry
>>
>>
>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor