Compiled LWJGL with GCJ

compiled whole LWJGL with gcj 3.3 8)

it’s far more completed than previous version

part of java.awt is missing (like we care ;D)
javax.swing is missing (like we care at all ;D)
javax.imageio is missing not really important but needed for some examples I tried to run

I compiled with ant, (tweaked the build.xml for change compiler and it worked)

I’m trying to run the bytecode, but it’s asking the _d debug lib

I don’t remeber how to build it , elias explained me once :frowning:

vrm@vrm:~/LWJGL/lib$ gij -cp examples.jar:lwjgl.jar Polygon
Exception in thread “main” java.lang.UnsatisfiedLinkError: lwjgl_d: file not found
at java.lang.Runtime._load(java.lang.String, boolean) (/usr/lib/libgcj.so.4.0.0)
at java.lang.Runtime.loadLibrary(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at java.lang.System.loadLibrary(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
at org.lwjgl.Sys.initialize() (Unknown Source)
at org.lwjgl.Sys.() (Unknown Source)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0)
at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.4.0.0)
at BaseWindow.start(int, int, int, boolean) (Unknown Source)
at Polygon.main(java.lang.String[]) (Unknown Source)

next step is binary compile

I hope it’s going to be small or at least gij is small and efficient (/me looks at sun bloated JRE)

Think you’ll run into more problems than just that I think. The direct bytebuffer implementation isnt there yet, just stubs to be filled in later, which is the real killer for using lwjgl with gcj at the moment.

And gij is just an interpreter so I wouldnt expect much performance out of that.

hehe

vrm@vrm:~/LWJGL/lib$ gij --cp ./examples.jar:./lwjgl.jar Polygon
Removed 0 duplicate displaymodes
Exception in thread “main” java.lang.Error: direct buffers are not implemented
at java.nio.ByteBuffer.allocateDirect(int) (/usr/lib/libgcj.so.4.0.0)
at org.lwjgl.input.Keyboard.() (Unknown Source)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0)
at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.4.0.0)
at BaseWindow.createGLWindow(int, int, int, boolean) (Unknown Source)
at BaseWindow.start(int, int, int, boolean) (Unknown Source)
at Polygon.main(java.lang.String[]) (Unknown Source)

anyway it’s far better than the first time I tried :slight_smile:
I managed to compile
wait & see

UPDATE: downloading and compiling gcj 3.4 (e.g. cvs version)

looking at java/nio/DirectByteBufferImplementation.java I believe they have a working implementation on big endian machines (almost all methods contains FIXME: this only handles big endian)

So it shouldn’t be long until compiling lwjgl with gcj becomes a reality! :slight_smile:

nice, I would like to help, but I’m in a long buisness travel

Hehe, this sure isn’t easy, but here are my findings so far:

downloaded and installed gcj 3.4 from cvs to /usr/local (enable-languages=c++,java) - no problems

downloaded and installed openal from cvs to /usr/local - no problems

downloaded and compiled lwjgl from cvs (regular build)

compiled lwjgl java sources with gcj -fjni … and linked to form a “native” shared library.

compiled the PolygonColoured example by compiling PolygonColoured.java and BaseWindow.java with gcj and linked them up with previous built lwjgl libraries

Everything ok so far -

Though it doesn’t work :wink:

running PolygonColoured is ok (ie window shows up and some dumps of supported opengl extensions are shown in the console) until the glu is used to set up some view point (?) in BaseWindow.java.

there it crashes out with a SIGABORT or something like that :frowning:

Maybe next time - or somebody else might get lucky :wink:

Actually y’all have been worried about the complete lack of buffers in GCJ when of course there’s nothing stopping you writing your own wee DLL with your own ByteBuffer class in it and tweaking the LWJGL to use it (seeing as we use ints everywhere all you really need is basically malloc() and free(), and some put/get methods)

Cas :slight_smile:

As I said before, I believe there now is a (limited) working solution of buffers (and rest of java.nio) available in cvs - not sure what went wrong above but it sure looks like same old buffer problem though.