Compile 2.9.1 to ARM #74

Open
moocow1452 opened this Issue Apr 30, 2014 · 12 comments

Comments

Projects
None yet
@moocow1452

Is it possible? I'm running off a Beaglebone Black, and between that, the Pi's souped up GFX driver, and other Android platforms, LWJGL for ARM might be worth looking into. I can get to about ant compile_native before I get errored out my one file missing another, depending on the java set I use, Oracle or OpenJDK, so I figure it at least has to be possible.

@moocow1452

This comment has been minimized.

Show comment
Hide comment
@moocow1452

moocow1452 Apr 30, 2014

compile32:
[apply] /home/debian/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c:117:22: warning: 'debugCallbackKHR' defined but not used [-Wunused-function]
[apply] /home/debian/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c: In function 'Java_org_lwjgl_opengl_LinuxKeyboard_keycodeToKeySym':
[apply] /home/debian/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c:81:2: warning: 'XKeycodeToKeysym' is deprecated (declared at /usr/include/X11/Xlib.h:1695) [-Wdeprecated-declarations]
[apply] /usr/bin/ld: cannot find -ljawt
[apply] /usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../arm-linux-gnueabihf/libXxf86vm.a(XF86VMode.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
[apply] /usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../arm-linux-gnueabihf/libXxf86vm.a: could not read symbols: Bad value
[apply] collect2: error: ld returned 1 exit status

BUILD FAILED
/home/debian/LWJGL/build.xml:468: The following error occurred while executing this line:
/home/debian/LWJGL/build.xml:492: The following error occurred while executing this line:
/home/debian/LWJGL/platform_build/linux_ant/build.xml:62: The following error occurred while executing this line:
/home/debian/LWJGL/platform_build/linux_ant/build.xml:88: apply returned: 1

Total time: 2 minutes 13 seconds

compile32:
[apply] /home/debian/LWJGL/src/native/common/opengl/org_lwjgl_opengl_CallbackUtil.c:117:22: warning: 'debugCallbackKHR' defined but not used [-Wunused-function]
[apply] /home/debian/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c: In function 'Java_org_lwjgl_opengl_LinuxKeyboard_keycodeToKeySym':
[apply] /home/debian/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxKeyboard.c:81:2: warning: 'XKeycodeToKeysym' is deprecated (declared at /usr/include/X11/Xlib.h:1695) [-Wdeprecated-declarations]
[apply] /usr/bin/ld: cannot find -ljawt
[apply] /usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../arm-linux-gnueabihf/libXxf86vm.a(XF86VMode.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
[apply] /usr/lib/gcc/arm-linux-gnueabihf/4.7/../../../arm-linux-gnueabihf/libXxf86vm.a: could not read symbols: Bad value
[apply] collect2: error: ld returned 1 exit status

BUILD FAILED
/home/debian/LWJGL/build.xml:468: The following error occurred while executing this line:
/home/debian/LWJGL/build.xml:492: The following error occurred while executing this line:
/home/debian/LWJGL/platform_build/linux_ant/build.xml:62: The following error occurred while executing this line:
/home/debian/LWJGL/platform_build/linux_ant/build.xml:88: apply returned: 1

Total time: 2 minutes 13 seconds

@tfg13

This comment has been minimized.

Show comment
Hide comment
@tfg13

tfg13 May 1, 2014

Collaborator

[apply] /usr/bin/ld: cannot find -ljawt

The linker cannot find libjawt.so.

I ran into the same problem when compiling lwjgl on a Raspberry Pi.
I found the file in $JAVA_HOME/jre/lib/arm and created a symbolic link from /usr/lib/libjawt.so.

I did not test anything, but it compiles now.

Collaborator

tfg13 commented May 1, 2014

[apply] /usr/bin/ld: cannot find -ljawt

The linker cannot find libjawt.so.

I ran into the same problem when compiling lwjgl on a Raspberry Pi.
I found the file in $JAVA_HOME/jre/lib/arm and created a symbolic link from /usr/lib/libjawt.so.

I did not test anything, but it compiles now.

@philipwhiuk

This comment has been minimized.

Show comment
Hide comment
@philipwhiuk

philipwhiuk May 21, 2014

Contributor

What distro is this? I think /usr/lib/libjawt.so is wrong - I'm not convinced Java libraries should be part of the global library folder. Unfortunately I don't have a working Raspberry Pi right now (on my TODO list) to test it on myself. On my Fedora box it's provided in:

/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/lib/amd64/libawt.so

with Java itself at:

/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java

(There's no defined $JAVA_HOME as there's no need, java is symlinked via /etc/alternatives to /usr/bin/java)

I'm not convinced there's anything we can do to in LWJGL to fix it, but I might be wrong.

Contributor

philipwhiuk commented May 21, 2014

What distro is this? I think /usr/lib/libjawt.so is wrong - I'm not convinced Java libraries should be part of the global library folder. Unfortunately I don't have a working Raspberry Pi right now (on my TODO list) to test it on myself. On my Fedora box it's provided in:

/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/lib/amd64/libawt.so

with Java itself at:

/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java

(There's no defined $JAVA_HOME as there's no need, java is symlinked via /etc/alternatives to /usr/bin/java)

I'm not convinced there's anything we can do to in LWJGL to fix it, but I might be wrong.

@rogerallen

This comment has been minimized.

Show comment
Hide comment
@rogerallen

rogerallen Jul 24, 2014

I believe the issue comes from this section of the platform_build\linux_ant\build.xml file:

<project name="lwjgl native code, linux" basedir="../../bin/lwjgl" default="compile">
...
    <property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/i386 -ljawt" />

This is an arm linux build, but it is looking for libs in the -L${java.home}/lib/i386 dir. It needs to look in the -L${java.home}/lib/arm dir.

Changing this in my build.xml gets past this error. I don't know the proper ant xml syntax to make it dependent on the architecture, though.

I believe the issue comes from this section of the platform_build\linux_ant\build.xml file:

<project name="lwjgl native code, linux" basedir="../../bin/lwjgl" default="compile">
...
    <property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/i386 -ljawt" />

This is an arm linux build, but it is looking for libs in the -L${java.home}/lib/i386 dir. It needs to look in the -L${java.home}/lib/arm dir.

Changing this in my build.xml gets past this error. I don't know the proper ant xml syntax to make it dependent on the architecture, though.

@rogerallen

This comment has been minimized.

Show comment
Hide comment
@rogerallen

rogerallen Jul 31, 2014

Oh, and just to save other people time--to get sound working on ARM, you'll need to compile your own OpenAL since LWJGL has only a x86 .so build. Using code from http://kcat.strangesoft.net/openal.html worked for me.

Oh, and just to save other people time--to get sound working on ARM, you'll need to compile your own OpenAL since LWJGL has only a x86 .so build. Using code from http://kcat.strangesoft.net/openal.html worked for me.

@wazy

This comment has been minimized.

Show comment
Hide comment
@wazy

wazy Sep 14, 2014

I can confirm that with a few tweaks I got it to compile and work for an ARM chromebook running Ubuntu. Looks like the latest commit fixed OpenGL ES build now as well.

wazy commented Sep 14, 2014

I can confirm that with a few tweaks I got it to compile and work for an ARM chromebook running Ubuntu. Looks like the latest commit fixed OpenGL ES build now as well.

@Spasi

This comment has been minimized.

Show comment
Hide comment
@Spasi

Spasi Sep 14, 2014

Member

That's good to hear. Would you mind sharing what tweaks were necessary? Maybe we can make the process simpler for other users.

Member

Spasi commented Sep 14, 2014

That's good to hear. Would you mind sharing what tweaks were necessary? Maybe we can make the process simpler for other users.

@DjArt

This comment has been minimized.

Show comment
Hide comment
@DjArt

DjArt Dec 17, 2014

How do I get a compiled version for Windows ARM? Windows RT has no OpenGL, so I used the Angle as OpenGLES-to-DirectX9 wrapper. The library itself (lwjgl.dll) works well, for example, call rundll32 lwjgl.dll, Java_org_lwjgl_DefaultSysImplementation_getJNIVersion not return any errors. But, for example, if you run Gears: ikvm -cp lwjgl-2.9.1.jar; lwjgl_util.jar; lwjgles_test.jar org.lwjgl.test.opengles.Gears, it will generate the following error:
org.lwjgl.LWJGLException: Failed to initialize EGL display. EGL error: EGL not initialized
at org.lwjgl.opengles.EGL.throwEGLError (EGL.java:919)
at org.lwjgl.opengles.EGL.throwEGLError (EGL.java:912)
at org.lwjgl.opengles.EGL.eglInitialize (EGL.java:270)
at org.lwjgl.opengles.EGLDisplay.initialize (EGLDisplay.java:110)
at org.lwjgl.opengles.EGLDisplay. (EGLDisplay.java:57)
at org.lwjgl.opengles.EGL.eglGetDisplay (EGL.java:253)
at org.lwjgl.opengl.DrawableGLES.initialize (DrawableGLES.java:91)
at org.lwjgl.opengl.WindowsDisplay.createWindow (WindowsDisplay.java:256)

    at org.lwjgl.opengl.Display.createWindow (Display.java:307)
    at org.lwjgl.opengl.Display.create (Display.java:987)
    at org.lwjgl.opengl.Display.create (Display.java:889)
    at org.lwjgl.test.opengles.Gears.init (Gears.java:294)
    at org.lwjgl.test.opengles.Gears.execute (Gears.java:121)
    at org.lwjgl.test.opengles.Gears.main (Gears.java:113)</code>

Failed to initialize Gears.
lwjgl-2.9.1.jar was compiled with the command ant jars_es. Pay attention to the ikvm: this JVM in Windows x86 runs all the tests with OpenGL, with OpenGLES in x86 I have atried to work. By the way, JVM cross-platform, and the same files run on different architectures.
What should I do?

DjArt commented Dec 17, 2014

How do I get a compiled version for Windows ARM? Windows RT has no OpenGL, so I used the Angle as OpenGLES-to-DirectX9 wrapper. The library itself (lwjgl.dll) works well, for example, call rundll32 lwjgl.dll, Java_org_lwjgl_DefaultSysImplementation_getJNIVersion not return any errors. But, for example, if you run Gears: ikvm -cp lwjgl-2.9.1.jar; lwjgl_util.jar; lwjgles_test.jar org.lwjgl.test.opengles.Gears, it will generate the following error:
org.lwjgl.LWJGLException: Failed to initialize EGL display. EGL error: EGL not initialized
at org.lwjgl.opengles.EGL.throwEGLError (EGL.java:919)
at org.lwjgl.opengles.EGL.throwEGLError (EGL.java:912)
at org.lwjgl.opengles.EGL.eglInitialize (EGL.java:270)
at org.lwjgl.opengles.EGLDisplay.initialize (EGLDisplay.java:110)
at org.lwjgl.opengles.EGLDisplay. (EGLDisplay.java:57)
at org.lwjgl.opengles.EGL.eglGetDisplay (EGL.java:253)
at org.lwjgl.opengl.DrawableGLES.initialize (DrawableGLES.java:91)
at org.lwjgl.opengl.WindowsDisplay.createWindow (WindowsDisplay.java:256)

    at org.lwjgl.opengl.Display.createWindow (Display.java:307)
    at org.lwjgl.opengl.Display.create (Display.java:987)
    at org.lwjgl.opengl.Display.create (Display.java:889)
    at org.lwjgl.test.opengles.Gears.init (Gears.java:294)
    at org.lwjgl.test.opengles.Gears.execute (Gears.java:121)
    at org.lwjgl.test.opengles.Gears.main (Gears.java:113)</code>

Failed to initialize Gears.
lwjgl-2.9.1.jar was compiled with the command ant jars_es. Pay attention to the ikvm: this JVM in Windows x86 runs all the tests with OpenGL, with OpenGLES in x86 I have atried to work. By the way, JVM cross-platform, and the same files run on different architectures.
What should I do?

@myblueraven

This comment has been minimized.

Show comment
Hide comment
@myblueraven

myblueraven Jan 27, 2015

Not sure if there is still someone interested in compiling 2.9.1 on beaglebone black.
I did it using debian 7.7, OpenJDK 7 and both with and without SGX drivers from TI.

Without SGX drivers lwjgl works but is so slow that it's practically useless (software rendering).
With SGX drivers (TI tests/demos are working) lwjgl demos are still using software rendering and my test app (using slick2d) just freezes the board when game window is created and I have to reset the beaglebone.

I could post the steps, it's just there's quite a bit of that, it will probably take me half an hour to get all pieces in line and put them into some meaningful post.

Not sure if there is still someone interested in compiling 2.9.1 on beaglebone black.
I did it using debian 7.7, OpenJDK 7 and both with and without SGX drivers from TI.

Without SGX drivers lwjgl works but is so slow that it's practically useless (software rendering).
With SGX drivers (TI tests/demos are working) lwjgl demos are still using software rendering and my test app (using slick2d) just freezes the board when game window is created and I have to reset the beaglebone.

I could post the steps, it's just there's quite a bit of that, it will probably take me half an hour to get all pieces in line and put them into some meaningful post.

@thalonkoju

This comment has been minimized.

Show comment
Hide comment
@thalonkoju

thalonkoju Nov 8, 2015

Hello. First of all let me say that I have roughly zero experience coding, however I understand running linux commands fairly well.

That being said, I'm having an issue when compiling. I'm following rogerallen's tutorial here (Thanks a bunch for that, by the way) but when compiling I get the following error:

[processor] Compiling 53 source files to /home/john/lwjgl/bin

generate-all:

compile:
     [core] Compiling 693 source files to /home/john/lwjgl/bin
     [core] /home/john/lwjgl/src/java/org/lwjgl/opencl/InfoUtilFactory.java:308: error: method calculateImage2DSize in class CLChecks cannot be applied to given types

[core]  (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0),
     [core]  ^
     [core]   required: Buffer,ByteBuffer,long,long,long
     [core]   found: ByteBuffer,long,long,long
     [core]   reason: actual and formal argument lists differ in length
     [core] /home/john/lwjgl/src/java/org/lwjgl/opencl/InfoUtilFactory.java:328: error: method calculateImage3DSize in class CLChecks cannot be applied to given types;
     [core] (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0),
     [core]  ^
     [core]   required: Buffer,ByteBuffer,long,long,long,long,long
     [core]   found: ByteBuffer,long,long,long,long,long
     [core]   reason: actual and formal argument lists differ in length
     [core] Note: Some input files use unchecked or unsafe operations.
     [core] Note: Recompile with -Xlint:unchecked for details.
     [core] 2 errors

BUILD FAILED
/home/john/lwjgl/build.xml:465: Compile failed; see the compiler error output for details.

It looks to me like there's some problem with the calculateImage2DSize and calculateImage3DSize things, but not knowing anything about that, I thought I'd ask here.

Any idea what's causing this and how to fix it? I thought it might just be something with the newer version of the source, but I couldn't find a copy of a 2014 version to try instead.

Hello. First of all let me say that I have roughly zero experience coding, however I understand running linux commands fairly well.

That being said, I'm having an issue when compiling. I'm following rogerallen's tutorial here (Thanks a bunch for that, by the way) but when compiling I get the following error:

[processor] Compiling 53 source files to /home/john/lwjgl/bin

generate-all:

compile:
     [core] Compiling 693 source files to /home/john/lwjgl/bin
     [core] /home/john/lwjgl/src/java/org/lwjgl/opencl/InfoUtilFactory.java:308: error: method calculateImage2DSize in class CLChecks cannot be applied to given types

[core]  (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0),
     [core]  ^
     [core]   required: Buffer,ByteBuffer,long,long,long
     [core]   found: ByteBuffer,long,long,long
     [core]   reason: actual and formal argument lists differ in length
     [core] /home/john/lwjgl/src/java/org/lwjgl/opencl/InfoUtilFactory.java:328: error: method calculateImage3DSize in class CLChecks cannot be applied to given types;
     [core] (host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0),
     [core]  ^
     [core]   required: Buffer,ByteBuffer,long,long,long,long,long
     [core]   found: ByteBuffer,long,long,long,long,long
     [core]   reason: actual and formal argument lists differ in length
     [core] Note: Some input files use unchecked or unsafe operations.
     [core] Note: Recompile with -Xlint:unchecked for details.
     [core] 2 errors

BUILD FAILED
/home/john/lwjgl/build.xml:465: Compile failed; see the compiler error output for details.

It looks to me like there's some problem with the calculateImage2DSize and calculateImage3DSize things, but not knowing anything about that, I thought I'd ask here.

Any idea what's causing this and how to fix it? I thought it might just be something with the newer version of the source, but I couldn't find a copy of a 2014 version to try instead.

@norehearse

This comment has been minimized.

Show comment
Hide comment
@norehearse

norehearse Dec 25, 2015

It seems like these two functions have changed their input parameters in this commit a5d8137
I just added 'host_ptr' as the first parameter for the calculateImageXDSize functions on line 308 and 328, after that the project compiled successfully!

It seems like these two functions have changed their input parameters in this commit a5d8137
I just added 'host_ptr' as the first parameter for the calculateImageXDSize functions on line 308 and 328, after that the project compiled successfully!

chrobione added a commit to chrobione/lwjgl that referenced this issue Dec 27, 2015

Update InfoUtilFactory.java
Update `calculateImage2DSize` and `calculateImage3DSize` method calls per issue LWJGL#74 (comment)
@chrobione

This comment has been minimized.

Show comment
Hide comment
@chrobione

chrobione Dec 27, 2015

Contributor

norehearse +1

FWIW...

Installing this on an Odroid XU4 with basic Ubuntu image from HardKernel. Trying to get Minecraft operational.

Downloaded the Minecraft.jar file and then had to install install Open JRE and Open JDK from Ubuntu's package manaager.

After making the same changes as norehearse getting ant generate-all and ant compile to complete successfully.

For ant compile_native, I had to apt-get install a couple X11 header libraries:

apt-get install libxcursor-dev libxrandr-dev

then ran into the [apply] /usr/bin/ld: cannot find -ljawt and just symlinked it like suggested to /usr/lib/lib/libjawt.so. (Had to find it first, sudo find / -name "libjawt.so")

And now getting ant compile_native to finish successfully.

Contributor

chrobione commented Dec 27, 2015

norehearse +1

FWIW...

Installing this on an Odroid XU4 with basic Ubuntu image from HardKernel. Trying to get Minecraft operational.

Downloaded the Minecraft.jar file and then had to install install Open JRE and Open JDK from Ubuntu's package manaager.

After making the same changes as norehearse getting ant generate-all and ant compile to complete successfully.

For ant compile_native, I had to apt-get install a couple X11 header libraries:

apt-get install libxcursor-dev libxrandr-dev

then ran into the [apply] /usr/bin/ld: cannot find -ljawt and just symlinked it like suggested to /usr/lib/lib/libjawt.so. (Had to find it first, sudo find / -name "libjawt.so")

And now getting ant compile_native to finish successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment