You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Andi Vajda <va...@apache.org> on 2021/06/22 20:21:35 UTC

PyLucene support on macos 11.4 arm64 (M1)

I just got access to a brand new M1 MacBook Air and was able to build and 
run a M1 native version of PyLucene. Needless to say, it's fast !

By 'native', I mean not emulated via Rosetta.

For the curious, here are the steps:

Build a native Python 3.9.5 from sources (a python.org binary install
may work as well but I didn't try that)

Install a native arm64 early access JDK 17 build from http://jdk.java.net/17/
That early access JDK is a tar archive that is a self-contained JDK tree 
with all pieces required. Unpack it <someplace> and
   - export JAVA_HOME=<someplace>/jdk-17.jdk/Contents/Home  (ant needs it)
   - export PATH=$JAVA_HOME/bin:$PATH

Edit JCC's jcc/helper3/darwin.py and add
   JAVAHOME = '<someplace>/jdk-17.jdk/Contents/Home'
at line 29, in the Exception block since /usr/libexec/java_home is going to 
fail.

edit JCC's setup.py to remove the /jre/ part of the paths under the 
'darwin/home' key in LFLAGS.

Build and install JCC as usual.

Edit PyLucene's Makefile and change the -arch parameter in JCC to -arch arm64
in your Mac OS X configuration.

Build and install PyLucene as usual.

Andi..