Hi Dawid,
On Wed, 20 Apr 2022, Dawid Weiss wrote:
If you tell me what OS you are on and what the error actually is, I can
help you a bit better. But assuming you're on a Mac, you do not need to
export
I'm actually on Windows but I tried to compile everything on Linux - an
older Ubuntu with Java 17 installed. Here is what I see:
echo $JAVA_HOME
/[...]/jvms/jdk17
java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
cd jcc
python3 setup.py build install
Traceback (most recent call last):
File "setup.py", line 100, in <module>
''' %(JDK[platform]))
RuntimeError:
Java JDK directory '/usr/lib/jvm/java-8-oracle' does not exist.
Yeah, on Linux, there is no support implemented in JCC for finding the
proper JAVA_HOME so the hardcoded value in jcc's setup.py is old and wrong
and must be overriden via the JCC_JDK variable (or edited in).
Please set the environment variable JCC_JDK to the correct location before
running setup.py.
When I set JCC_JDK:
export JCC_JDK=$JAVA_HOME
python3 setup.py build install
[lots of messages]
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro
-g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/jcc3/sources/jcc.o
build/temp.linux-x86_64-3.6/jcc3/sources/JCCEnv.o -o
build/lib.linux-x86_64-3.6/libjcc3.so -L/[...]/jvms/jdk17/jre/lib/amd64
-ljava -L/ [...]/jvms/jdk17/jre/lib/amd64/server -ljvm -Wl,-rpath=/
[...]/jvms/jdk17/jre/lib/amd64:/ [...]/jvms/jdk17/jre/lib/amd64/server
-Wl,-S -lpython3.6m
/usr/bin/ld: cannot find -ljava
/usr/bin/ld: cannot find -ljvm
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
When you look at the compilation line, Java-relative paths are wrong as
it's a JDK installation and it has lib/ and include/ directly underneath
(not under 'jre/lib/amd64', for example).
Ok, so the layout has changed with temurin I guess. This was also the case
on Mac. I need to add yet another entry into LFLAGS for linux/temurin
in setup.py that reflects this new layout.
So it seems to be some sort of expected-packaging problem?
I need to debug this by installing temurin into a linux VM of mine.
To be continued...
Andi..