lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Seward <>
Subject Re: PyLucene
Date Fri, 04 Sep 2009 15:20:54 GMT

I wanted to confirm this before I replied. Here is what I have
discovered re: the platform detection problem.

If I go to and get the Python 2.6.2 Mac
Installer Disk Image
then open the installer, it installs Python 2.6 with no apparent

However, it also creates a Makefile at
wherein the following line is included:

As it turns out, Python calls a function,
parse_makefile() that pulls most of its values from this makefile. So,
the end result is that in Python:
>>> from distutils.sysconfig import get_config_vars
>>> cfgvars = get_config_vars()

>> from distutils.util import get_platform
>> get_platform()

I am at a loss to explain who is at fault here but the .dmg is a prime
suspect. Nonetheless a really simple solution is to edit the Makefile
and change the 10.3 to 10.5 (or whatever is appropriate for your
system) as in:

>>> get_platform()

This solves the first problem, but make still hangs, now with the following:

g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup
-ljcc -o build/lib.macosx-10.5-fat-2.6/lucene/ -framework
JavaVM -Wl,-S -Wl,-rpath
ld: library not found for -ljcc
collect2: ld returned 1 exit status
ld: library not found for -ljcc
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/7r/7r4PlyAYE0CN5MeqK98dBk+++TQ/-Tmp-//ccexpZmi.out (No
such file or directory)
error: command 'g++' failed with exit status 1
make: *** [compile] Error 1

I added:
export DYLD_LIBRARY_PATH=/Users/ralph/pylucene/jcc/build/lib.macosx-10.5-fat-2.6
to my .profile as this is where libjcc.dylib resides, but this did not
seem to fix the problem.

So, any suggestions?

Ralph> wrote:
> On Wed, 2 Sep 2009, Ralph Seward wrote:
>> In Python:
>>>>> from distutils.util import get_platform
>>>>> get_platform()
>> 'macosx-10.3-fat'
> Apart from the platform detection problem which comes from your setup, there
> is a bug in JCC where it adds -Wl,-rpath to the link args without checking
> first that the target platform is at least Mac OS X 10.5.
> This is around line 1451 in JCC's file.
> If you have the logic to check the target OS version, please send in a patch
> that fixes this.
> Note that if you link the JCC executables without -Wl,-rpath, you'll have to
> then set DYLD_LIBRARY_PATH so that libjcc.dylib can be found.
> Adding code to emit a warning to that effect in that patch would help too.
> Thanks !
> Andi..
>> Ah ha...
>> On Wed, Sep 2, 2009 at 2:56 PM, Ralph Seward<> wrote:
>>> Hey Andi,
>>> I am attempting to setup PyLucene on a Mac with OS X 10.5 (Leopard)
>>> with Python 2.6 and I am encountering a small problem. I Googled
>>> around and I saw your comment on something similar at
>>> and I wondered if this was ever sorted out.
>>> I do this:
>>> svn co pylucene
>>>> Checked out revision 810649.
>>> cd pylucene/jcc/
>>> python build
>>> at which point I get:
>>> running build
>>> running build_py
>>> creating build/lib.macosx-10.3-fat-2.6
>>> creating build/lib.macosx-10.3-fat-2.6/jcc
>>> etc...
>>> which appears to be an incorrect detection of my OS.
>>> then I do:
>>> cd ..
>>> nano Makefile
>>> # Mac OS X  (Python 2.6.2, Java 1.5)
>>> PREFIX_PYTHON=/usr/local
>>> ANT=ant
>>> PYTHON=$(PREFIX_PYTHON)/bin/python
>>> JCC=$(PYTHON) -m jcc.__main__ --shared
>>> ... and save it ...
>>> Then I run:
>>> make
>>> and it seems to be doing OK until it fails with:
>>> ld: -rpath can only be used when targeting Mac OS X 10.5 or later
>>> collect2: ld returned 1 exit status
>>> lipo: can't open input file: /var/tmp//ccmnAMJQ.out (No such file or
>>> directory)
>>> error: command 'g++' failed with exit status 1
>>> make: *** [compile] Error 1
>>> which, if the OS was properly detected, I'm guessing not happen.
>>> So, I was wondering if you had any insight as to the cause or
>>> resolution to this problem.
>>> Thanks in advance.
>>> Ralph

View raw message