Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'third-party': 0.04; 'base.': 0.05; 'say,': 0.05; '(python': 0.07; '64-bit': 0.07; 'binary': 0.07; 'dynamically': 0.07; 'incompatible': 0.07; 'intel': 0.07; 'problem?': 0.07; 'variables': 0.07; 'versions,': 0.07; 'linker': 0.09; 'machines.': 0.09; 'suggestions:': 0.09; 'supported,': 0.09; 'variables.': 0.09; 'python': 0.11; 'suggest': 0.14; '10.6.': 0.16; 'compatible.': 0.16; 'created.': 0.16; 'libraries.': 0.16; 'outdated': 0.16; 'subject:failed': 0.16; 'supplied,': 0.16; 'sure.': 0.16; 'subject:python': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'library': 0.18; 'wed,': 0.18; 'trying': 0.19; 'thorough': 0.19; 'command': 0.22; 'issue.': 0.22; 'installation': 0.23; "shouldn't": 0.24; 'subject: .': 0.24; 'paul': 0.24; 'versions': 0.24; 'environment': 0.24; 'question': 0.24; "i've": 0.25; 'source': 0.25; 'references': 0.26; 'least': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'testing': 0.29; 'wonder': 0.29; 'newer': 0.30; "i'm": 0.30; 'that.': 0.31; 'usually': 0.31; '13,': 0.31; 'gcc': 0.31; 'libraries': 0.31; 'releases,': 0.31; "they'll": 0.31; 'universal': 0.31; 'yourself.': 0.31; 'figure': 0.32; 'python.org': 0.32; 'quite': 0.32; 'older': 0.33; 'trouble': 0.34; 'could': 0.34; 'except': 0.35; 'but': 0.35; 'building': 0.35; 'there': 0.35; 'version': 0.36; 'really': 0.36; 'options:': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'possible': 0.36; 'should': 0.36; 'so,': 0.37; 'too': 0.37; 'starting': 0.37; 'problems': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'ability': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'release': 0.40; 'how': 0.40; 'even': 0.60; 'easy': 0.60; 'range': 0.61; "you've": 0.63; 'header:Message-Id:1': 0.63; 'stand': 0.64; 'different': 0.65; 'chance': 0.65; 'needs,': 0.65; 'yes': 0.68; 'smith': 0.68; 'guaranteed': 0.75; 'received:204': 0.75; '*really*': 0.84; 'env': 0.84; 'itself?': 0.84; 'ppc': 0.84; 'received:204.14': 0.84; '2013,': 0.91; 'careful': 0.91; 'releases.': 0.91 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: python 2.7.x on MacOSX: failed dlopen() on .so's From: Ned Deily In-Reply-To: <1384383583.3496.505.camel@pdsdesk> Date: Wed, 13 Nov 2013 16:00:15 -0800 Content-Transfer-Encoding: quoted-printable References: <1384370183.3496.472.camel@pdsdesk> <1384383583.3496.505.camel@pdsdesk> To: python-list@python.org X-Mailer: Apple Mail (2.1510) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 82 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384387225 news.xs4all.nl 15868 [2001:888:2000:d::a6]:59591 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59362 On Nov 13, 2013, at 14:59 , Paul Smith wrote: > Thanks for the response Ned! >=20 > On Wed, 2013-11-13 at 14:40 -0800, Ned Deily wrote: >> There shouldn't be any problems with what you are trying to do. It >> works for me with Python 2.7.6 and pycrypto-2.6.1. Some suggestions: >> - Avoid --enable-shared on OS X at least initially. There are too >> many ways things can go wrong. If you've built with it, suggest >> starting with a fresh Python source directory just to be sure. >=20 > I've tried it with all three options: no flag, --disable-shared, and > --enable-shared, and don't notice any difference in the results; even > with --enable-shared I don't seem to get any shared libs created. >=20 >> - Check the dynamic library dependencies of _struct. On OS X: >>=20 >> otool -L /Users/build/python/lib/python2.7/lib-dynload/_struct.so >=20 > I get a libgcc_s reference as well, since I'm building with GCC: >=20 > /Users/build/python/lib/python2.7/lib-dynload/_struct.so: > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, = current > version 159.1.0) > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current > version 1105.0.0) >=20 > I wonder if using the GCC linker etc. is part of the problem? That shouldn't be an issue. What you do don't want to see is references = to python libraries. BTW, Xcode 4.1 is quite old and outdated for OS X = 10.7. Suggest you update to the current Xcode 4.6.3 or Command Line = Tools for 10.7. > The reason I've set PYTHONHOME is ultimately I need this installation = to > be relocatable. It's going to be shared across lots of different > systems and they'll have the ability to copy it wherever they want. That could be problematic. You need to be *really* careful about how you = do that. You stand a chance with a non-shared installation. You still = should not need to set PYTHONHOME. Also, be aware that executables and = libraries built on one version of OS X are not guaranteed to work on = other versions, particularly older versions unless you take certain = precautions. Even non-shared Pythons on OS X dynamically link with = system-supplied libraries which can vary across os releases. And not = all libraries are supplied, so, depending on your needs, you may need to = supply some additional third-party libraries. If you need to support various OS X releases, the safest approach is to = build on the oldest release to be supported, say, 10.6. The resultant = executables and libraries should then work on 10.7 through 10.9 - except = every once in a while there will be a gotcha like the incompatible = change in libedit for 10.9. (Python 2.7.6 can deal with that problem.) = There is also the question if all the systems you will need to support = are of the same architecture. 10.6 supports both 32-bit-only and 64-bit = Intel machines. 10.5 supports in addition PPC machines. The solution = to that is to build OS X universal binaries. If you really are careful = and lucky, it is in theory possible to build on a newer system and use = an OS X SDK and set MACOSX_DEPLOYMENT_TARGET for an older version and it = will be downward compatible. But thorough testing is called for in that = case since it is easy to have a hidden dependency. For the python.org = OS X binary installers, we go to a fair amount of trouble to build = Pythons that will work across a range of OS X releases. You might want = to consider using one of them as a base. It's usually a lot less work = than trying to make it work yourself. >=20 >> - Check your other environment variables and make sure you are not >> setting any DYLD_ or LD_ env variables. > Hm; I am setting LD_LIBRARY_PATH to find the Python .so files. Does > python figure out where to look for them by itself? Yes -- Ned Deily nad@acm.org -- []