On Sun, 23 Mar 2008, Charles wrote:

On Sat, Mar 22, 2008 at 8:48 AM, Andi Vajda <[EMAIL PROTECTED]> wrote:
 Maybe this can convince you to consider the MSVC compiler ?

Sorry to interrupt your (both) chat :D, but how do I compile pylucene
with MSVC7? Is the makefile in pylucene source works with nmake? I see
the makefile uses linux commands like find, rm, which wouldn't work in
normal cmd.exe without cygwin/gnuwin32/unxutils.

There are two separate issue here:
   - which 'make' utility is used
   - which compiler is used

I chose to write the PyLucene Makefile for GNU Make. Why ? It works everywhere except on Windows as opposed to only on Windows. This was really required for gcj-PyLucene (now deprecated). It shouldn't be too hard to move to a setup.py style of build for jcc-PyLucene, actually.

The compiler choice is independent of the 'make' choice.

If pylucene can be compiled with MSVC7 that'd be great since I'm
getting bored to alter my mingw installation to link with msvcrt71
each time I need to compile a python extension :D

jcc-PyLucene can of course be built with MSVC since python/distutils/jcc is actually driving the compilation. Normally, the compiler to use to compile Python extensions should be the same as the compiler that was used to build python itself. What compiler that is on Windows depends on what Python you've installed there.

Also if you don't mind to explain, what is this shared option, I
couldn't find it (easily) on google? What's the difference with normal
python extension?

This new --shared option is used by JCC to compile a Python extension (such as PyLucene) so that it can be used along with other JCC-compiled extensions in the same process. This requires that a portion of JCC itself be compiled as a shared library (a DLL on Windows) as opposed to a just Python extension. Historically, distutils/setuptools has not been capable of building such regular shared libraries and use them. The newest setuptools (>= 0.6c7) can do this now on some platforms as Bill and I are slowly discovering (with caveats).

When 'shared' is enabled when building JCC (see top of setup.py), a libjcc.dylib on Mac, libjcc.so on Linux and jcc.dll on Windows is build as well along with the regular jcc python package (along with its _jcc extension).

Then, when --shared is used when JCC is invoked, the resulting extension is linked with this shared library instead of having all the necessary JCC runtime code statically linked into it. This allows it to share the JCC env structure with all other such JCC-built extensions. This env structure is the gateway to the one single Java VM allowed per process.

Andi..
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to