On Mar 9, 2010, at 13:13, "Thomas Koch" <k...@orbiteam.de> wrote:
Dear PyLucene-fans,
I just managed to build pylucene-2.9.1-1 on Windows with Python 2.6
and Java
1.6 and like to tell my 'story' - just in case anyone else runs into
similar
problems...
First I should mention that I'm using PyLucene for quite a while now
- just
never needed to build it on windows - there used to be binary
distributions
on the net (here: http://code.google.com/p/pylucene-win32-binary/ -
however
it's out-of-date). Also I am a bit familiar with Makefiles, Ant and
other
toolchains...
Next it should be said that not only PyLucene is great piece of
software but
also Documentation (and samples / test-suite) is very well maintained.
The only thing that's missing from my point of view is clear advise on
requirements for building PyLucene on specific platforms. Maybe
that's also
the cause of the trouble I had in building it ... I knew I need a C++
compiler, ANT, Java and Python. Also as Makefile is used some kind of
make-utitilty would be needed. So here's the setup I've choosen:
- Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19)
- Java 1.6 (jdk1.6.0_06)
- compiler: MS-Visual-Studio9 (Microsoft Visual C++ 2008 Express
Edition)
- mingw32-make from MinGW-5.1.6 - see http://www.mingw.org/
(GNU Make 3.81 built for i386-pc-mingw32)
- ANT 1.8.0
- pylucene-2.9.1-1 / lucene-java-2.9.1
- Windows7
The building of JCC was no problem. The first issues came up when
entering
the make-toolchain: apparently there are some differences on Windows
that
either my windows binary GNU make couldn't handle very well or need
to be
fixed for windows anyway...
This especially holds for path separators and command separators. For
example I had to change
$(LUCENE_JAR): $(LUCENE)
cd $(LUCENE) ; $(ANT) -Dversion=$(LUCENE_VER)
to
$(LUCENE_JAR): $(LUCENE)
cd $(LUCENE) && $(ANT) -Dversion=$(LUCENE_VER)
(took me a while to figure this out ,-)
PYLUCENE:=$(shell pwd)
to
PYLUCENE:=$(shell cd)
BUILD_TEST:=$(PYLUCENE)/build/test
to
BUILD_TEST:=$(PYLUCENE)\build\test
(note: cd may work with "/" but when it comes to mkdir this fails -
e.h.
mingw32-make test
mkdir -p pylucene-2.9.1-1/build/test
Syntaxfehler.
mingw32-make: *** [install-test] Error 1
)
Finally herer are my Makefile settings:
# Windows (Win32, Python 2.6, Java 1.6, ant 1.8)
SHELL=cmd.exe
PYLUCENE:=$(shell cd)
ANT=F:\devel\apache-ant-1.8.0\bin\ant
JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_06
PREFIX_PYTHON=C:\\Python26
PYTHON=$(PREFIX_PYTHON)\python.exe
JCC=$(PYTHON) -m jcc.__main__
NUM_FILES=3
So either I've choosen the wrong tools or there should be others with
similar problems. If my toolchain is wrong or unsupported please
advise. Is
it recommended/required to use Cygwin on Windows?
Yes, cygwin is required so that you have a functional gnu make.
Note that you still need to use a MS compiler or mingw, which some
people have been able to use.
I test build pylucene every now and then on an old win2k system with
cygwin (for make and shell) and msvc 7.1. Not a setup with the most
recent software but that's all I've got for windows.
Andi..
If anyone is interested I can offer to
- post my adapted Makefile here (or on the web)
- provide binary version of PyLucene (on the web)
Finally some suggestion: wouldn't it be possible to skip the Makefile
completely? I'm not that familiar with ANT but know it has been
developed to
provide platform independant built processes - and it includes shell-
tasks
for anything that is not java... (I know this could be some work, just
wanted to know if this question has been raised before or if this is
a no-go
option ?)
best regards
Thomas Koch
--
OrbiTeam Software GmbH & Co. KG
Endenicher Allee 35
53121 Bonn Germany
i...@orbiteam.de
http://www.orbiteam.de