|
|
-
Re: AW: [VOTE] Release PyLucene 3.6.1Andi Vajda 2012-08-20, 14:49
On Aug 20, 2012, at 5:14, "Thomas Koch" <[EMAIL PROTECTED]> wrote: > Hi, > I had some trouble with the windows build of this version: while building > JCC 2.14 in my windows7-32 build env (python2.7,Java1.6,Microsoft Visual > Studio 9.0 C++) the build fails on command > > cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D_java_generics > -DJCC_VER="2.14" "-IC:\Program Files\Java\jdk1.6.0_06/include" "-IC:\Program > Files\Java\jdk1.6.0_06/include/win32" -I_jcc -Ijcc/sources > -IC:\Python27\include -IC:\Python27\PC /Tpjcc/sources/functions.cpp /Fo > build\temp.win32-2.7\Release\jcc/sources/functions.obj -DPYTHON /EHsc > /D_CRT_SECURE_NO_WARNINGS functions.cpp > > with error: jcc/sources/functions.cpp(17) : fatal error C1083: Datei > (Include) kann nicht geöffnet werden: "arpa/inet.h": No such file or > directory Oops. Yes, this needs to be fixed with some conditional include. Thank you for reporting this. Andi.. > error: command '"C:\Program Files\Microsoft Visual Studio > 9.0\VC\BIN\cl.exe"' failed with exit status 2 > > I noticed that > pylucene-3.6.1-1\jcc\jcc\sources\function.cpp > line17 states > #include <arpa/inet.h> > whereas this line is missing in > pylucene-3.6.0-2\jcc\jcc\sources\function.cpp > > There is no 'arpa' folder in either my > <Java\jdk>\include > nor > <Java\jdk>\include\win32 > > So I commented the line and tried again - the functions.cpp can be compiled > now but the final link step fails due to a missing reference. (externes > Symbol "_htons@4" in Funktion ""struct _object * __cdecl > makeInterface(struct _object *,struct _object *)" ) - so the include was > necessary. > > > The method makeInterface seems to be new in JCC 2.14 and uses the htons > function (host-to-network short - "converts from host to TCP/IP network > byte order") - this defined in windows socket lib as well: > http://msdn.microsoft.com/en-us/library/windows/desktop/ms741394(v=vs.85).as > px > > (On unix it's part of the standard C Library (libc.so, libc.a) on Windows > it's part of 'Ws2_32.lib' - that's what I learned from Google today ,.-) > > So one quick-fix is to > a) replace > #include <arpa/inet.h> > by > #include <winsock2.h> > In functions.cpp > > And > b) extend (line 136) in setup.py: > > 'win32': ['/LIBPATH:%(win32)s/lib' %(JDK), 'jvm.lib', > 'Ws2_32.lib'], > > (Don't know where MS-VC finds that lib. It's not in windows-system - most > likely it's from an installed Windows SDK in C:/Program Files/Microsoft > SDKs/Windows/v6.0A/Lib). > > Then the setup.py build and install works fine. I could import jcc and > initVM() - haven't tried further with the lucene part so it could also be a > dead end... (don't think so however). > > > I finally tried with MinGW quickly but this fails (in JArray.cpp: see below) > - could be a problem of my MinGW setup though. > > So question is if MS-VC compiler should be further supported. In this case > kind of #ifdef macro is required and possibly fine-tuning of setup.py > > Otherwise I'd have to switch to MinGW on windows (and get this working)... > Here's my MinGW issue (unrelated to above, but should be noted that MinGW > compile functions.cpp without any error) > > C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_java_generics > -DJCC_VER="2.14" "-IC:\Program Files\Java\jdk1.6.0_06/include" "-IC:\Program > Files\Java\jdk1.6.0_06/include/win32" -I_jcc -Ijcc/sources > -IC:\Python27\include -IC:\Python27\PC -c jcc/sources/JArray.cpp -o > build\temp.win32-2.7\Release\jcc\sources\jarray.o -DPYTHON > -fno-strict-aliasing -Wno-write-strings jcc/sources/JArray.cpp: > In instantiation of `_t_JArray<_jobject*>': > jcc/sources/JArray.cpp:610: instantiated from `_t_jobjectarray<_jobject*>' > jcc/sources/JArray.cpp:617: instantiated from here > jcc/sources/JArray.cpp:28: error: base `t_JArray<_jobject*>' with only > non-default constructor in class without a constructor > jcc/sources/JArray.cpp: In instantiation of `_t_jobjectarray<_jobject*>': > jcc/sources/JArray.cpp:617: instantiated from here |