Compile both PowerPC and Intel binary solution?

Archives Forums/MacOS X Discussion/Compile both PowerPC and Intel binary solution?

Tachyon(Posted 2006) [#1]
I am awaiting my Intel-Mac next week. I had an idea which I can test when the new hardware arrives...

Would it be possible to use Rosetta on a Intel-Mac to run the PowerPC version of BlitzMax, which should theoretically allow BlitzMax to compile a PowerPC binary? I mean, if BlitzMax *thinks* it's running on PPC hardware, then the compiled code should be PPC native...right? Has anyone tried this?


xlsior(Posted 2006) [#2]
While the powerPC binaries themselves may work, I have a suspicion that BlitzMax itself has too many dependencies (i.e. it needs the powerPC XCode suite to be present as well to be able to compile anything)


Tachyon(Posted 2006) [#3]
Has Mark made any public statement regarding the development path for the Mac? Does he have any plans to integrate cross compiling on the Intel-Mac platform to allow BlitzMax to compile either PPC or Intel binaries?

Can anyone from BRL respond?


Banshee(Posted 2006) [#4]
Welcome to owning a Mac. You are already forgotten :) ce la Macintosh ...


pls(Posted 2006) [#5]
Has Mark made any public statement regarding the development path for the Mac?

No. At least not here.
Anyway the cross-compiling for universal binaries is not exactly a huge obstacle, making the game is, once it's done it's a matter of finding a powerpc or intel Mac and just compiling the damn thing.

I have both, so I can help you out.

PLS


Tachyon(Posted 2006) [#6]
PLS: Thanks for the offer! I've bookmarked your website and I may talk to you about this in a couple months when I near beta.


Garrett(Posted 2006) [#7]
Welcome to owning a Mac. You are already forgotten :) ce la Macintosh ...


ROFLMAO!


marksibly(Posted 2006) [#8]
Hi,

I haven't looked into cross-compiling yet, and probably wont until after 10.5 is out - unless of course we're expecting 10.6 by the time I get around to it!

The PowerPC version running on Rosetta wont produce PowerPC binaries. For a while there, it was the only x86 option available so there's a hack in there to work out what it's 'really' running on.

Actually, just removing that hack would allow a quick and easy way to produce PPC binaries on X86. Hmm...


taumel(Posted 2006) [#9]
Why is this linked to 10.5 at all? I mean is there a technical reason or did you just provided this as a time estimation?


Tachyon(Posted 2006) [#10]
Thanks for the reply Mark! I am really looking forward to a cross-compile option.


RocketGnome(Posted 2007) [#11]
Just curious...

Has the Mac version gotten the cross-compiler treatment yet?


Trader3564(Posted 2007) [#12]
ow, it doesn't cross-compile?
i meen when i buy a Win32 version, i cannot compile for MacOS?


anawiki(Posted 2007) [#13]
You cannot compile on Win32 for MacOS.


Winni(Posted 2007) [#14]
When you buy BlitzMax, you actually get it for all four supported platforms: Win32, Linux x86, OS X PPC and OS X x86. However, you cross-compiling is not supported, you have to compile on each platform natively.


Craig Watson(Posted 2007) [#15]
Theoretically you could get the PPC version of Blitz for your Intel Mac, force the hack built into BMK to determine whether it's a PPC system or an Intel system and then use it to build PPC binaries. I suppose I should try it at some point because I don't see why it wouldn't work.

For it to be simple and built in would kinda complicate the way Max works right now, because you'd need to keep two sets of the mods in the same places, etc. It should be doable though.

For cross-compiling other platforms, it is again theoretically doable, but complicates the build environment even further. You'd need a full crosscompiling GCC suite, full headers for each OS, plus libraries used for linking, etc.


JazzieB(Posted 2007) [#16]
The only problem with cross-compiling on just one system is that there is no guarantee that the result will actually work as it should on the other platforms. I know for a fact that I have sections of my Mac code that are different depending on whether they are being ran on an Intel based or PPC based Mac, and I didn't know that I needed to do this until I tested on the other platform.

So basically, cross-compiling on one system complicates the testing because you can't do it unless you already own those systems or have easy access to them. You could just give the results to people that have the other platforms, but if they have a problem isn't it a lot easier and quicker if you can see the results yourself immediately rather than having to keep waiting for feedback?

At the end of the day, you're better off having direct access to all platforms that you're making your games for, so you haven't really gained much by having this functonality built into the compiler. Just my opinion.


Karja(Posted 2007) [#17]
I've experimented a bit with generating PPC code with a modified Intel BMK, but so far things are looking grim. Maybe someone could enlighten me about what I've missed?

Step 1: I made sure that opt_arch is ppc in bmk_config.bmx. (I.e., just removed the checks against x86 and such.)
Step 2: Compile a new bmk and replace the old one with the new.
Step 3: Rebuild all libraries.
Step 4: Compile a PPC version of my app.

All looks fine, and the get info type is reported as Application (Power PC). However, when I try to run it on a PPC Mac it displays....strange graphics. A blue rectangle in the upper right corner - and nothing else. However, when I compile the exact same code on PPC it works just fine.

Also, worth mentioning is that when I compile the app on a PPC instead, the get info type is simply reported as Application without any additional specification.

Any thoughts on what I've missed?


ImaginaryHuman(Posted 2007) [#18]
I'm curious to try this as well since I just got an Intel Mac. I have a PPC Mac to do `proper compiling` on but would be cool to do it on the Mactel.

Is it possibly something to do with the graphics driver? Is a PPC-compiled app, which must be using OpenGL, able to make PPC OpenGL calls that will interface to the Intel OpenGL driver?


Craig Watson(Posted 2007) [#19]
Is there any difference between PowerPC and Intel BlitzMax, other than the setting in BMK?


ImaginaryHuman(Posted 2007) [#20]
For me, in terms of making separate binaries on separate `real` PPC macs and intel macs, there is no difference in how the app runs or what it does. As far as Apple is concerned a mac is a mac if it runs OSX on their hardware, so there is no real difference for the user based on the CPU that's in there. In fact I'm still not convinced that my Intel Mac has an Intel CPU. ;-)