On Sun, Jan 7, 2024 at 7:10 AM Bob Kline <bkl...@rksystems.com> wrote:

> I tried to sign up with ASF's JIRA system but got the message
>
> The project you have selected does not use Jira for issue tracking. Please
>> contact the project at dev@lucene.apache.org to find out where to submit
>> issues.
>
>
> I'm trying to build pylucene on Ubuntu but I'm getting an error message
> which is a little bit opaque.
> ....
>

I figured out how to get past all the problems I ran into, and was finally
able to get the package built and installed. Afterwards I captured notes on
the process so if I (or a colleague) needs to do this again, we'll have a
head start. I'm sharing these notes (attached) in case any of the
information might suggest improvements to the instructions page
<https://lucene.apache.org/pylucene/install.html>. Feel free to use or
ignore any of these notes as you think appropriate.

-- 
Bob Kline
https://www.rksystems.com
mailto:bkl...@rksystems.com
Notes on building/installing the Apache pylucene package on Ubuntu, trying to
follow https://lucene.apache.org/pylucene/install.html.

1. Skip over the "For the Impatient Ones" section. Those steps won't work
   because the Makefile must be edited first (the package doesn't use the
   standard ./configure approach to generating an appropriate Makefile).
   Add the following lines to the Makefile, immediately before the line
   which creates the JARS variable:

PREFIX_PYTHON=/usr
PYTHON=$(PREFIX_PYTHON)/bin/python
JCC=$(PYTHON) -m jcc --shared
NUM_FILES=16

   Without this modification, the build will fail.

2. The build will not be able to use the Ubuntu distro's jcc, because it's
   not built to support the --shared option. The installation instructions
   make no mention of this requirement. So, in the package's source directory:

sudo apt remove python3-jcc
cd jcc
JCC_JDK=/usr/lib/jvm/java-1.11.0-openjdk-amd64 python setup.py build
sudo JCC_JDK=/usr/lib/jvm/java-1.11.0-openjdk-amd64 python setup.py install
cd ..

3. The makefile needs help finding the JDK libraries.

export JVM_LIB=/usr/lib/jvm/java-11-openjdk-amd64/lib
export JVM_LIB_SERVER=$JVM_LIB/server
export LIBRARY_PATH=$JVM_LIB:$JVM_LIB_SERVER
export LD_LIBRARY_PATH=$LIBRARY_PATH
sudo ldconfig $JVM_LIB_SERVER
make
sudo make install

4. Despite what the installation instructions page says, "make test" won't
   work, because it tries to write to the installation directory (an odd
   thing for "make test" to want to do). So instead:

sudo make test

5. All of the tests pass except one:

/usr/bin/python3 test3/test_ICUFoldingFilter.py
/usr/local/lib/python3.10/dist-packages/lucene-9.7.0-py3.10-linux-x86_64.egg/lucene/resources/org/apache/lucene/analysis/icu/utr30.dat
E
======================================================================
ERROR: testDefaults (__main__.TestICUFoldingFilter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bkline/packages/pylucene-9.7.0/test3/test_ICUFoldingFilter.py", 
line 36, in testDefaults
    from lucene.ICUFoldingFilter import ICUFoldingFilter
  File 
"/usr/local/lib/python3.10/dist-packages/lucene-9.7.0-py3.10-linux-x86_64.egg/lucene/ICUFoldingFilter.py",
 line 71, in <module>
    ResourceBundle.setAppData("utr30", utr30)
ValueError: (2, 'No such file or directory', 
'/usr/local/lib/python3.10/dist-packages/lucene-9.7.0-py3.10-linux-x86_64.egg/lucene/resources/org/apache/lucene/analysis/icu/utr30.dat')

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

6. If you re-run the make build (for example, to use different environment 
variables),
   you'll need to blow away the build directory and start with a freshly 
unpacked set
   of sources, because any problems left by a previous build attempt persist, 
causing
   subsequent attempts to hit a mountain of compiler errors ("make clean" 
doesn't do
   what it usually does).
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to