JCC Compilation Error

2023-03-22 Thread S Less
Hello, I am getting a compilation error when installing JCC.
I am on Apple M1 Pro, macOS Ventura Version 13.2.1
I am running setup.py from the latest PyLucene download
Thanks in advance,
Al

username@MacBook-Pro jcc % python3 setup.py build


found JAVAHOME =
/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home

running build

running build_py

writing /Users/username/Downloads/pylucene-8.11.0/jcc/jcc3/config.py

copying jcc3/config.py -> build/lib.macosx-10.9-universal2-cpython-311/jcc

copying jcc3/classes/org/apache/jcc/PythonVM.class ->
build/lib.macosx-10.9-universal2-cpython-311/jcc/classes/org/apache/jcc

copying jcc3/classes/org/apache/jcc/PythonException.class ->
build/lib.macosx-10.9-universal2-cpython-311/jcc/classes/org/apache/jcc

running build_ext

building 'jcc._jcc3' extension

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/boot.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/boot.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/io/PrintWriter.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/io/PrintWriter.o
-DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/io/StringWriter.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/io/StringWriter.o
-DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/io/Writer.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/io/Writer.o
-DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/io/__init__.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/io/__init__.o
-DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/lang/Boolean.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/lang/Boolean.o
-DPYTHON -fno-strict-aliasing -Wno-write-strings -mmacosx-version-min=10.9
-std=c++11 -stdlib=libc++

clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -D_java_generics
-DJCC_VER=\"3.11\"
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include
-I/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/include/darwin
-I_jcc3 -Ijcc3/sources
-I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c
_jcc3/java/lang/Byte.cpp -o
build/temp.macosx-10.9-universal2-cpython-311/_jcc3/java/lang/Byte.o
-DPYTHON -fno-strict-aliasing -Wno-writ

Re: JCC Compilation Error

2023-03-22 Thread S Less
Andi, thankyou for the reply and my apologies, sorry to waste your time.
Al

On Thu, Mar 23, 2023 at 4:10 PM Andi Vajda  wrote:

>
> On Thu, 23 Mar 2023, S Less wrote:
>
> > *jcc3/sources/functions.cpp:1742:28: **error: **expression is not
> > assignable*
> >
> >Py_TYPE(*type) = PY_TYPE(FinalizerClass);
> >
> > *~~ ^*
>
> This is https://issues.apache.org/jira/browse/PYLUCENE-66 and was fixed
> for
> PyLucene 9.4.1.
> You say "I am running setup.py from the latest PyLucene download", is that
> 9.4.1 ?
>
> Andi..
>


PyLucene installation - make failing

2023-03-23 Thread S Less
Hi, as you can see below, make and make test are reporting *Illegal option:
l*

and make test an additional error.

macOS Ventura Version 13.2.1

Thanks, Al



username@MacBook-Pro pylucene-9.4.1 % make

(cd lucene-java-9.4.1; ./gradlew collectRuntimeJars)

Downloading https://services.gradle.org/distributions/gradle-7.3.3-all.zip

...10%...20%...30%...40%...50%...60%70%...80%...90%...100%


Welcome to Gradle 7.3.3!


Here are the highlights of this release:

 - Easily declare new test suites in Java projects

 - Support for Java 17

 - Support for Scala 3


For more details see https://docs.gradle.org/7.3.3/release-notes.html


To honour the JVM settings for this build a single-use Daemon process will
be forked. See
https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon
.

Daemon will be stopped at the end of the build


*> Task :localSettings*


IMPORTANT. This is the first time you ran the build. I wrote some sane
defaults (for this machine) to 'gradle.properties', they will be picked up
on consecutive gradle invocations (not this one).


Run gradlew :helpLocalSettings for more information.


*> Task :errorProneSkipped*

WARNING: errorprone disabled (skipped on builds not running inside CI
environments, pass -Pvalidation.errorprone=true to enable)


*> Task :lucene:core:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:backward-codecs:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:facet:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:memory:compileJava*

Note:
/Users/username/Downloads/pylucene-9.4.1/lucene-java-9.4.1/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:queries:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:sandbox:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:analysis:common:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:codecs:compileJava*

Note:
/Users/username/Downloads/pylucene-9.4.1/lucene-java-9.4.1/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDocValuesReader.java
uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:extensions:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:misc:compileJava*

Note:
/Users/username/Downloads/pylucene-9.4.1/lucene-java-9.4.1/lucene/misc/src/java/org/apache/lucene/misc/util/fst/UpToTwoPositiveIntOutputs.java
uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*> Task :lucene:test-framework:compileJava*

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.


*BUILD SUCCESSFUL* in 4m 26s

123 actionable tasks: 123 executed

ICU not installed

jar
lucene-java-9.4.1/lucene/core/build/runtimeJars/lucene-core-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/analysis/common/build/runtimeJars/lucene-analysis-common-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/backward-codecs/build/runtimeJars/lucene-backward-codecs-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/classification/build/runtimeJars/lucene-classification-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/codecs/build/runtimeJars/lucene-codecs-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/expressions/build/runtimeJars/lucene-expressions-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/extensions/build/runtimeJars/lucene-extensions-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/facet/build/runtimeJars/lucene-facet-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/grouping/build/runtimeJars/lucene-grouping-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/highlighter/build/runtimeJars/lucene-highlighter-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/join/build/runtimeJars/lucene-join-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/analysis/kuromoji/build/runtimeJars/lucene-analysis-kuromoji-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/memory/build/runtimeJars/lucene-memory-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/misc/build/runtimeJars/lucene-misc-9.4.1-SNAPSHOT.jar
--jar
lucene-java-9.4.1/lucene/analysis/nori/build/runtimeJars/lucene-analysis-nori-9.4.1-SNAPSHOT

Re: PyLucene installation - make failing

2023-03-27 Thread S Less
Andi I hadn't edited the Makefile.
There is a hint on the PyLucene Installation
<https://lucene.apache.org/pylucene/install.html> page:

 "See PyLucene's *Makefile* for configuration instructions."

but I didn't realise that was telling me to edit the file.
After doing so I was able to build it.

I'm able to successfully perform indexing and searching within Python.
I was hoping to try the Monitor
<https://lucene.apache.org/core/9_4_1/monitor/org/apache/lucene/monitor/Monitor.html>
class however this line fails

from org.apache.lucene.monitor import Monitor

Traceback (most recent call last):
  File "/Users/akeers/Documents/git_work/pylucene-test/test2.py", line 2,
in 
from org.apache.lucene.monitor import Monitor
ModuleNotFoundError: No module named 'org.apache.lucene.monitor';
'org.apache.lucene' is not a package

Whereas all these imports I have tried work fine:

from org.apache.lucene.analysis.standard import StandardAnalyzer
from org.apache.lucene.store import ByteBuffersDirectory
from org.apache.lucene.index import IndexWriterConfig
from org.apache.lucene.index import IndexWriter
from org.apache.lucene.document import StringField
from org.apache.lucene.document import TextField
from org.apache.lucene.document import Document
from org.apache.lucene.document import Field
from org.apache.lucene.queryparser.classic import QueryParser
from org.apache.lucene.index import DirectoryReader
from org.apache.lucene.search import IndexSearcher

Al

On Fri, Mar 24, 2023 at 1:32 AM Andi Vajda  wrote:

>
> I suspect you didn't edit Makefile to enable the variables corresponding
> to your environment ?
>
> Andi..
>
> > On Mar 23, 2023, at 01:02, S Less  wrote:
> >
> > Hi, as you can see below, make and make test are reporting *Illegal
> option:
> > l*
> >
> > and make test an additional error.
> >
> > macOS Ventura Version 13.2.1
> >
> > Thanks, Al
> >
> >
> >
> > username@MacBook-Pro pylucene-9.4.1 % make
> >
> > (cd lucene-java-9.4.1; ./gradlew collectRuntimeJars)
> >
> > Downloading
> https://services.gradle.org/distributions/gradle-7.3.3-all.zip
> >
> >
> ...10%...20%...30%...40%...50%...60%70%...80%...90%...100%
> >
> >
> > Welcome to Gradle 7.3.3!
> >
> >
> > Here are the highlights of this release:
> >
> > - Easily declare new test suites in Java projects
> >
> > - Support for Java 17
> >
> > - Support for Scala 3
> >
> >
> > For more details see https://docs.gradle.org/7.3.3/release-notes.html
> >
> >
> > To honour the JVM settings for this build a single-use Daemon process
> will
> > be forked. See
> >
> https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon
> > .
> >
> > Daemon will be stopped at the end of the build
> >
> >
> > *> Task :localSettings*
> >
> >
> > IMPORTANT. This is the first time you ran the build. I wrote some sane
> > defaults (for this machine) to 'gradle.properties', they will be picked
> up
> > on consecutive gradle invocations (not this one).
> >
> >
> > Run gradlew :helpLocalSettings for more information.
> >
> >
> > *> Task :errorProneSkipped*
> >
> > WARNING: errorprone disabled (skipped on builds not running inside CI
> > environments, pass -Pvalidation.errorprone=true to enable)
> >
> >
> > *> Task :lucene:core:compileJava*
> >
> > Note: Some input files use or override a deprecated API.
> >
> > Note: Recompile with -Xlint:deprecation for details.
> >
> >
> > *> Task :lucene:backward-codecs:compileJava*
> >
> > Note: Some input files use or override a deprecated API.
> >
> > Note: Recompile with -Xlint:deprecation for details.
> >
> >
> > *> Task :lucene:facet:compileJava*
> >
> > Note: Some input files use or override a deprecated API.
> >
> > Note: Recompile with -Xlint:deprecation for details.
> >
> >
> > *> Task :lucene:memory:compileJava*
> >
> > Note:
> >
> /Users/username/Downloads/pylucene-9.4.1/lucene-java-9.4.1/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
> > uses or overrides a deprecated API.
> >
> > Note: Recompile with -Xlint:deprecation for details.
> >
> >
> > *> Task :lucene:queries:compileJava*
> >
> > Note: Some input files use or override a deprecated API.
> >
> >

Re: PyLucene installation - make failing

2023-03-27 Thread S Less
Working now, thankyou.

On Tue, Mar 28, 2023 at 11:16 AM Andi Vajda  wrote:

>
> On Tue, 28 Mar 2023, S Less wrote:
>
> > I'm able to successfully perform indexing and searching within Python.
> > I was hoping to try the Monitor
> > <
> https://lucene.apache.org/core/9_4_1/monitor/org/apache/lucene/monitor/Monitor.html
> >
> > class however this line fails
> >
> > from org.apache.lucene.monitor import Monitor
> >
> > Traceback (most recent call last):
> >  File "/Users/akeers/Documents/git_work/pylucene-test/test2.py", line 2,
> > in 
> >from org.apache.lucene.monitor import Monitor
> > ModuleNotFoundError: No module named 'org.apache.lucene.monitor';
> > 'org.apache.lucene' is not a package
>
> Indeed, the org.apache.lucene.monitor package is not built into PyLucene.
> Why ? I didn't know about it.
>
> Here is a diff you can apply to Makefile to get the Monitor stuff included
> in PyLucene:
>
> -- SNIP --
> Index: Makefile
> ===
> --- Makefile(revision 1904983)
> +++ Makefile(working copy)
> @@ -97,6 +97,7 @@
>   JARS+=$(KUROMOJI_JAR)   # japanese analyzer module
>   JARS+=$(MEMORY_JAR) # single-document memory index
>   JARS+=$(MISC_JAR)   # misc
> +JARS+=$(MONITOR_JAR)# monitor
>   JARS+=$(MORFOLOGIK_JAR) # morfologik analyzer module
>   JARS+=$(NORI_JAR)   # korean analyzer module
>   #JARS+=$(PHONETIC_JAR)   # phonetic analyzer module
> @@ -135,6 +136,7 @@
>
> KUROMOJI_JAR=$(LUCENE)/analysis/kuromoji/build/runtimeJars/lucene-analysis-kuromoji-$(LUCENE_VER)-SNAPSHOT.jar
>
> MEMORY_JAR=$(LUCENE)/memory/build/runtimeJars/lucene-memory-$(LUCENE_VER)-SNAPSHOT.jar
>
> MISC_JAR=$(LUCENE)/misc/build/runtimeJars/lucene-misc-$(LUCENE_VER)-SNAPSHOT.jar
>
> +MONITOR_JAR=$(LUCENE)/monitor/build/runtimeJars/lucene-monitor-$(LUCENE_VER)-SNAPSHOT.jar
>
> NORI_JAR=$(LUCENE)/analysis/nori/build/runtimeJars/lucene-analysis-nori-$(LUCENE_VER)-SNAPSHOT.jar
>
> PHONETIC_JAR=$(LUCENE)/analysis/phonetic/build/runtimeJars/lucene-analysis-phonetic-$(LUCENE_VER)-SNAPSHOT.jar
>
> QUERIES_JAR=$(LUCENE)/queries/build/runtimeJars/lucene-queries-$(LUCENE_VER)-SNAPSHOT.jar
> -- SNIP --
>
> Andi..
>