[Xapian-discuss] Building Xapian and Python Bindings for Windows: Solved

Patrick Mézard pmezard at gmail.com
Thu Jan 5 19:44:28 GMT 2006


Olly Betts a écrit :

>On Tue, Dec 27, 2005 at 10:55:52PM +0100, Patrick M?zard wrote:
>  
>
>>*- Update the root makefile to take in account the backend archive 
>>targets. It means creating a variable like:
>>"""
>>BACKENDS_LA =   backends/quartz/libquartz.la \
>>                backends/flint/libflint.la \
>>                backends/multi/libmulti.la \
>>                backends/inmemory/libinmemory.la
>>"""
>>and adding it la_DEPENDENCIES and la_LIBADD actions in makefile.in.
>>    
>>
>
>I suspect that this is a consequence of the "wrong find.exe" problem.
>I'm just putting together a mail to send to the libtool list.
>  
>
Well, maybe but I get it too when paths are set correctly.

>>checking for python... /cygdrive/d/Python23//python
>>    
>>
>
>This is odd - if that's not a python interpreter then the code where we
>check the python version should fail to match the patterns for the
>python versions we support and configure should disable the python
>bindings.
>
>I wonder if PYTHON is set in your environment - does "echo $PYTHON"
>output anything?
>
>Is there anything at all at the path "/cygdrive/d/Python23//python"?
>What does "ls -l /cygdrive/d/Python23" output?
>
>  
>
Actually, the path is correct in a cygwin environment. I was suspecting 
the cygwin shell might be unable to start the python interpreter for 
some reason but it seems I was wrong. I can start it with this command. 
The exact error is :

"""
PYTHONPATH=".;.libs" /cygdrive/d/Python23//python -c "import xapian"
/bin/sh: /cygdrive/d/Python23//python: No such file or directory
"""

If I replace "/cygdrive/d/Python23//python" with "python" the call works 
better but ultimately fails because the cygwin support DLL is not in 
python sys.path and thus cannot be imported by "_xapian.dll". 
"libxapian.la" is the only place where the cygwin runtime DLL is 
mentionned, something is definitely broken with .la. If I copy the 
support DLL with _xapian.dll, the make run terminates successfully.

Also, there is a trap here : the .pyc is generated before the "import 
xapian" statement is actually run. Therefore, even if the import action 
fails, the ".pyc" exists and the action will be skipped on next make 
run. Something like "import _xapian; import xapian" could be more 
appropriate.

Hope this helps.

--
Patrick Mézard








More information about the Xapian-discuss mailing list