Mac-Intel Version?

Started by elias4444, January 10, 2006, 19:22:59

Previous topic - Next topic

elias4444

With todays Mac keynote announcing the Intel Macs, I was wondering where lwjgl stood in respect to porting to the new platform? Anyone know?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Matzon

yes, we do plan that - somehow...

numberR

i think Java VM has not been released for intel-based Mac OS X yet.
we'll see if this is true or not as soon as people start to receive their iMacs or MacBook pro.

i think the biggest issue is JNI stuff such as DevIL, FMOD and maybe OpenAL too.
and last time i tried, i could successfully compile DevIL as Universal Binary.

http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html
link above explains how to compile Universal Binary using standard Unix commands.
basically, we need to add some CFLAGS before executing make like following:

CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" make


thing is, if you use gcc-4.x, the resulting binary does not work on Mac OS X 10.3.x.
However, gcc-4.x is required to create binary for x86.
so the best solution is to have Universal Binary consists of PPC binary from gcc-3.3 to support Mac OS X 10.3.x or later,
and x86 binary from gcc-4.x to support intel-based Mac OS X 10.4.x.

http://wiki.mozilla.org/Mac:Intel
it seems like Firefox team is also struggling how to get that work,
and i have no idea at this moment...

anyone?

miu

I believe Mac-Intel does have Java. Actually, Apple's Java 5 Release 2 was for the Transition Kits only, while Releases 1 and 3 were for PPC Macs.

I'm wondering whether Rosetta will handle LWJGL in the meantime and if so, what performance hit there will be.

Universal binary would be ideal packaging-wise, but even a separate MacIntel LWJGL build would be great in order to get started.

numberR

it seems like J2SE Release 4 will be released for PPC/x86 platforms.
it's not universal binary and i don't know why.

miu

I also noticed that the latest Dev. Preview of the Java 5 Rel. 4 ships as two separate downloads - ppc and i386.

In Apple's implementation, Java VM is probably very close to the core OS - their JRE releases require specific OS patch levels, unlike e.g. Sun's Windows JRE. So there's no Java 5 for OS 10.3, and JRE 1.5.0_06 will require OS 10.4.4...

Java 5 Rel. 4 for Mac will also make Java 5 the "preferred" version.

This thread has a link explaining that Rosetta won't work with JNI.

elias

JNI libs on intel macs have to be universal (or at least compiled for x86), as rosetta won't help you. I've comitted a fix for LWJGL that creates two native libraries, liblwjgl.jnilib (universal, gcc4) and liblwjgl-legacy.jnilib(ppc only, gcc3). The former is for Mac OS X 10.4 and up (both ppc and x86) while the latter is for 10.3 and earlier (ppc only, naturally). The LWJGL library loader tries both libraries, depending on which platform it is run.

In addition, lwjgl now tries to load the mac os x 10.4 version of openal if a regular openal.dylib can't be found. That way you don't have to supply an universal openal.dylib. This doesn't solve the fmod/devil problem though.

We don't have an intel mac to test on, but we've had reports of Tribal Trouble running on at least one intel mac.

miu

Hello Elias (from Oddlabs)!

I recently got my new Intel based iMac and I'm trying to make LWJGL work on it. I can see that your latest Tribal Trouble demo works on MacTels, also Puppygames' new Titan Attacks works!

However, patching the latest LWJGL 0.99 release to work doesn't seem to be straightforward - replacing binaries and jars doesn't cut it for me.

Could you provide any help with this? Perhaps you could post a Universal binary build somewhere for the rest of us who don't compile entire LWJGL from the source? Will Universal Mac binaries make it to LWJGL 1.0?

I can't seem to be able to find any binaries in the TT application, there are just .svn files there - is it supposed to be like that?

Thanks a lot!

elias

Universal binaries will definitely be included in 1.0. In the meantime, look for lwjgl.jar.svn-base and similar named native files. Don't worry about the names and directory naming, it's based on the svn working directory structure.

- elias

miu

Thanks, Elias, for your response!

Actually, I found that what I was trying to do works, at least partly.

Simple OpenGL examples work on an Intel Mac, hurrah!

However, since those games (TT, Titan Attacks) apparently don't bundle the entire LWJGL, Space Invaders demo that I was originally trying to run fails due to some sound issues. Also DevIL doesn't seem to be included.

It's great that I can at least start testing some stuff, however for the complete MacTel LWJGL I'll have to wait for the 1.0 release...

I guess if I asked when it's coming I'd hear the "Heinz ketchup" phrase - only comes out when it's ready? ;)

elias

I haven't touched Devil since I don't know if (and when) it is released in an universal build. Fortunately, we can ignore OpenAL issues, since from 10.4 and up it is bundled with Mac OS X. So what kind of sound issues are you having?

- elias

miu

Hello again Elias,

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

I traced my "sound issues" to resource files not being on the classpath... this exception wasn't handled nicely so it had me confused for a while. :oops:

HOWEVER, OpenGL and OpenAL ROCK now on my MacTel! That makes the Mac-Intel transition complete for me  :wink: Who cares about Photoshop and Office :lol:

Well, I'm still looking forward to 1.0!

Thanks again, LWJGL and Tribal Trouble rule!

Let me know if you need anything tested on a MacTel - they are probably not that rare anymore, but still...

elias

Quote from: "miu"

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

Yes, FMOD is another dependency, I guess matzon will have to update that one to make it mactel friendly ;)

Quote from: "miu"

HOWEVER, OpenGL and OpenAL ROCK now on my MacTel! That makes the Mac-Intel transition complete for me  :wink: Who cares about Photoshop and Office :lol:

Well, I'm still looking forward to 1.0!

Thanks again, LWJGL and Tribal Trouble rule!

Let me know if you need anything tested on a MacTel - they are probably not that rare anymore, but still...

Actually, we're still waiting for the not-awfully-expensive intel mac minis to arrive in Denmark. They're bundled with some intel gfx card, and unfortunately we've got a report about TT not running on it :/

- elias

Matzon

Quote from: "elias"
Quote from: "miu"

Thanks for your prompt response. I didn't realize that DevIL was actually a 3rd party dependence. So is fmod I guess (v.4 was released for Macx86, v.3 wasn't/won't be?). I haven't used those yet so it shouldn't be a problem.

Yes, FMOD is another dependency, I guess matzon will have to update that one to make it mactel friendly ;)
according to this post: http://www.fmod.org/forum/viewtopic.php?t=4658 they have released an intel version. Whats needed to get the loading going ?

elias

You don't need to do anything, but if you want to support 10.3 and 10.4 at the same time, you'll need to supply (and try to load) two versions of the library. One is the universal binary, compiled for 10.4 and later for both ppc and i386, and the other is the legacy 10.3 and earlier ppc only binary.

Take a look at the comment in MacOSXSysImplementation for further explanation and the way I've done it for the main liblwjgl.jnilib.

- elias