You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Thomas Koch <ko...@orbiteam.de> on 2012/05/03 08:53:38 UTC

AW: AW: Building PyLucene on Windows

Jeremy ,

not sure if I can be of great help here either ... the error tells me that
compiling the JCC-generated lucene-sources (i.e. C++ code) fails. This could
either mean
1) JCC code generator failed, i.e. your JCC build is broken
2)  your compiler is unable to understand the generated code

Ad1) I attach a directory listing of my build/_lucene dir so you can check
at least if file size matches...

I doubt that JCC is broken if the build went fine.

Ad2) The error looks like some pre-processor issue -  e.g. in functions.cpp
there is 
 #if defined(_MSC_VER) || defined(__SUNPRO_CC)
which is a pre-processor statement (or macro) that should be understood by
recent compilers.

I cant' see where the error actually occurs (\_lucene\[F.h(1) ??) but my
strong guess it's the compiler that's crap.

> Windows SDK C/C++ compiler (v7.0)

As mentioned before I'd advise to use the version of Visual Studio C++
compiler that's used to build your Python version!
Start your python interpreter:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

This tells you it's compiled with Visual C++ 2008     (MSC_VER=1500)
Cf.
stackoverflow.com/questions/2676763/what-version-of-visual-studio-is-this-py
thon-compiled-with

Regards
Thomas 


> -----Ursprüngliche Nachricht-----
> Von: Jeremy Michels [mailto:jeremy.d.michels@gmail.com]
> Gesendet: Montag, 30. April 2012 18:20
> An: pylucene-dev@lucene.apache.org
> Betreff: Re: AW: Building PyLucene on Windows
> 
> Tom -
> 
> Thank you for sharing your expertise on this matter. I was unable to use
the
> pre-built binaries as I am using a 64-bit system (attempting to do so
would
> results in the error: ImportError: DLL load failed: %1 is not a valid
Win32
> application).
> 
> This is my setup:
> Windows 7 (64-bit)
> Python 2.7.2 (64 bit)
> Java 1.7 (jdk1.7.0)
> Ant 1.8.3
> Windows SDK C/C++ compiler (v7.0)
> Cygwin
> 
> I was able to build JCC without any apparent problems. Below are my
> Makefile settings:
> 
> ANT=/cygdrive/c/Program\ Files/Ant/apache-ant-1.8.3/bin/ant
> JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0
> PREFIX_PYTHON=/cygdrive/c/Program\ Files/Python
> PYTHON=$(PREFIX_PYTHON)/python.exe
> JCC=$(PYTHON) -m jcc --shared
> NUM_FILES=4
> 
> Previously I had the "--find-jvm-dll" option included on the "JCC"
> line, but this gave me the error "ValueError: jvm.dll could not be found,"
so I
> removed the option and added the location of the jvm.dll file to my path
and
> I no longer received this error.
> 
> However, running "make" with the specifications given above results in the
> error:
> 
> c:\users\jeremy\downloads\pylucene-3.5.0-3\build\_lucene\[F.h(1) : fatal
> error C
> 1016: #if[n]def expected an identifier
> error: command 'cl.exe' failed with exit status 2
> Makefile:312: recipe for target `compile' failed
> make: *** [compile] Error 1
> 
> To be honest, I don't really know what this means and am feeling a bit out
of
> my league at this point. However, any further guidance you might have
> would be appreciated.
> 
> Best Regards,
> 
> Jeremy