lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Janssen <jans...@parc.com>
Subject Re: calling Python from Java fails...
Date Fri, 01 Jul 2011 09:58:44 GMT
Andi Vajda <vajda@apache.org> wrote:

> > By the way, you might want to add a paragraph in that section about
> > adding the ["-framework", "Python"] flags for building JCC on OS X.  I
> > tripped over that again.
> 
> If you send a paragraph to this effect, I'll integrate it into the docs.

Here's a patch:

/local/pylucene 31 % svn diff
Index: site/src/documentation/content/xdocs/jcc/documentation/install.xml
===================================================================
--- site/src/documentation/content/xdocs/jcc/documentation/install.xml	(revision 1141969)
+++ site/src/documentation/content/xdocs/jcc/documentation/install.xml	(working copy)
@@ -138,7 +138,7 @@
 	  Is JCC built with shared mode support or not ?
 	  <ul>
 	    <li>
-	      By default, on Mac OS X and Windows this is the case
+	      By default, on Mac OS X and Windows this is the case.
 	    </li>
 	    <li>
 	      By default, on Linux, this is the case.
@@ -167,6 +167,12 @@
 	and <code>LFLAGS</code> for <code>darwin</code> should be correct
 	and ready to use.
       </p>
+      <p>
+        However, if you intend to use the 'system' Python from a Java VM
+        on Mac OS X -- Python embedded in Java --
+        you will need to add the flags <code>"-framework" "Python"</code>
+        to the <code>LFLAGS</code> value.
+      </p>
     </section>
     <section id="linux">
       <title>Notes for Linux</title>
Index: site/src/documentation/content/xdocs/jcc/documentation/readme.xml
===================================================================
--- site/src/documentation/content/xdocs/jcc/documentation/readme.xml	(revision 1141969)
+++ site/src/documentation/content/xdocs/jcc/documentation/readme.xml	(working copy)
@@ -763,9 +763,12 @@
       </p>
       <ul>
 	<li>
-	  JCC must be built in shared mode.
-	  See <a href="site:jcc/documentation/install">installation
-	    instructions</a> for more information about shared mode.
+	  JCC must be built in shared mode.  See
+          <a href="site:jcc/documentation/install">installation
+	  instructions</a> for more information about shared mode.
+	  Note that for this use on Mac OS X, JCC must also be built
+	  with the link flags <code>"-framework" "Python"</code> in
+	  the <code>LFLAGS</code> value.
 	</li>
 	<li>
 	  As described in the previous section, define one or more Java
@@ -790,14 +793,19 @@
 	  via the <code>-Djava.library.path</code> command line parameter.
 	</li>
 	<li>
-	  In the Java VM's main thread, initialize the Python VM by calling
-	  its static <code>start()</code> method passing it a Python program
-	  name string and optional start-up arguments in a string array that
-	  will be made accessible in Python via <code>sys.argv</code>.
-	  This method returns the singleton PythonVM instance to be used in
-	  this Java VM. This instance may be retrieved at any later time via
-	  the static <code>get()</code> method defined on the
-          <code>org.apache.jcc.PythonVM</code> class. 
+	  In the Java VM's main thread, initialize the Python VM by
+	  calling its static <code>start()</code> method passing it a
+	  Python program name string and optional start-up arguments
+	  in a string array that will be made accessible in Python via
+	  <code>sys.argv</code>.  Note that the program name string is
+	  purely informational, and is not used by the
+	  <code>start()</code> code other than to initialize that
+	  Python variable.  This method returns the singleton PythonVM
+	  instance to be used in this Java VM. <code>start()</code>
+	  may be called multiple times; it will always return the same
+	  singleton instance.  This instance may also be retrieved at any
+	  later time via the static <code>get()</code> method defined
+	  on the <code>org.apache.jcc.PythonVM</code> class.
 	</li>
 	<li>
 	  Any Java VM thread that is going to be calling into the Python VM

Mime
View raw message