So, I just re-built JCC from sources, installed it and PyLucene, then tried to add my GoodStuff module. When I try to load GoodStuff, I get the old
2008-09-18 13:52:38.251 Python[80776:613] Apple AWT Java VM was loaded on first thread -- can't start AWT. terminate called after throwing an instance of 'JCCEnv::exception' This is OS X 10.5.4, Java 5. I checked, the "fix" is in cpp.py. Here's something I don't like: When I build PyLucene, I get the following at the end: creating build/lib.macosx-10.5-i386-2.5/lucene g++ -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc build/temp.macosx-10.5-i386-2.5/build/_lucene/__init__.o build/temp.macosx-10.5-i386-2.5/build/_lucene/__wrap__.o build/temp.macosx-10.5-i386-2.5/build/_lucene/functions.o build/temp.macosx-10.5-i386-2.5/build/_lucene/JObject.o build/temp.macosx-10.5-i386-2.5/build/_lucene/lucene.o build/temp.macosx-10.5-i386-2.5/build/_lucene/types.o -L/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg -ljcc -o build/lib.macosx-10.5-i386-2.5/lucene/_lucene.so -framework JavaVM -Wl,-S -Wl,-rpath /Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/__init__.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/__wrap__.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/functions.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/JObject.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/lucene.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/types.o, file is not of required architecture build of complete Here's the complete gcc part of the build: CFLAGS="" /usr/bin/python -m jcc --shared --jar lucene-java-2.4.0-649619/build/lucene-core-2.4.0-649619.jar --jar lucene-java-2.4.0-649619/build/contrib/snowball/lucene-snowball-2.4.0-649619.jar --jar lucene-java-2.4.0-649619/build/contrib/highlighter/lucene-highlighter-2.4.0-649619.jar --jar lucene-java-2.4.0-649619/build/contrib/analyzers/lucene-analyzers-2.4.0-649619.jar --jar lucene-java-2.4.0-649619/build/contrib/regex/lucene-regex-2.4.0-649619.jar --jar lucene-java-2.4.0-649619/build/contrib/queries/lucene-queries-2.4.0-649619.jar --jar build/jar/extensions.jar --package java.lang java.lang.System java.lang.Runtime --package java.util java.text.SimpleDateFormat --package java.io java.io.StringReader java.io.InputStreamReader java.io.FileInputStream --exclude org.apache.lucene.queryParser.Token --exclude org.apache.lucene.queryParser.TokenMgrError --exclude org.apache.lucene.queryParser.QueryParserTokenManager --exclude org.apache.lucene.queryParser.ParseException --python lucene --mapping org.apache.lucene.document.Document 'get:(Ljava/lang/String;)Ljava/lang/String;' --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence org.apache.lucene.search.Hits 'length:()I' 'doc:(I)Lorg/apache/lucene/document/Document;' --version 2.4.0-649619 --files 1 --build running build_ext building 'lucene._lucene' extension creating build/temp.macosx-10.5-i386-2.5 creating build/temp.macosx-10.5-i386-2.5/build creating build/temp.macosx-10.5-i386-2.5/build/_lucene gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/__init__.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/__init__.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/__wrap__.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/__wrap__.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/functions.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/functions.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/JObject.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/JObject.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/lucene.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/lucene.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ gcc -DNDEBUG -g -Os -Wall -Wstrict-prototypes -pipe -DPYTHON=1 -D_jcc_shared=1 -I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -Ibuild/_lucene -I/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg/jcc/sources -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/_lucene/types.cpp -o build/temp.macosx-10.5-i386-2.5/build/_lucene/types.o -fno-strict-aliasing cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++ creating build/lib.macosx-10.5-i386-2.5 creating build/lib.macosx-10.5-i386-2.5/lucene g++ -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc build/temp.macosx-10.5-i386-2.5/build/_lucene/__init__.o build/temp.macosx-10.5-i386-2.5/build/_lucene/__wrap__.o build/temp.macosx-10.5-i386-2.5/build/_lucene/functions.o build/temp.macosx-10.5-i386-2.5/build/_lucene/JObject.o build/temp.macosx-10.5-i386-2.5/build/_lucene/lucene.o build/temp.macosx-10.5-i386-2.5/build/_lucene/types.o -L/Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg -ljcc -o build/lib.macosx-10.5-i386-2.5/lucene/_lucene.so -framework JavaVM -Wl,-S -Wl,-rpath /Library/Python/2.5/site-packages/JCC-1.9-py2.5-macosx-10.5-i386.egg ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/__init__.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/__wrap__.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/functions.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/JObject.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/lucene.o, file is not of required architecture ld warning: in build/temp.macosx-10.5-i386-2.5/build/_lucene/types.o, file is not of required architecture build of complete Bill Andi Vajda <[EMAIL PROTECTED]> wrote: > On Thu, 31 Jul 2008, Bill Janssen wrote: > > >> Out of curiosity, what did you end up doing to work around this issue ? > > > > I just tried adding > > > > add_option("-Djava.awt.headless=", "true", &vm_options[nOptions++]); > > > > in jcc/jcc/jcc/sources/jcc.cpp, where you call JMI_CreateJavaVM(). > > Seems to fix my problem on Apple. Any reason not to add this > > permanently? Is this code run by the generated wrappers, as well as > > by JCC? > > Great, that fixes it then. > The right place to put this is in cpp.py, not in jcc.cpp. > In cpp.py, it only affects JCC itself (see my previous reply). > > I should have this checked-in in a bit. > > Andi.. _______________________________________________ pylucene-dev mailing list pylucene-dev@osafoundation.org http://lists.osafoundation.org/mailman/listinfo/pylucene-dev