Page 1 of 1
Universal Binaries for Mac OS
Posted: Sat Apr 11, 2009 1:42 pm
by cxAlex
I'd like a Feature to build Universal Binaries which would work on x86 and PowerPC based Mac.
Posted: Sat Apr 11, 2009 2:04 pm
by freak
You can already create
universal binaries from PB. Just compile your code once with the x86 and once with the ppc version and then use the "lipo" commandline tool to combine the two executables into one
universal binary.
There is also a tool here, never tested it though:
http://www.purebasic.fr/english/viewtopic.php?t=36678
I don't think adding a direct IDE option for this is such a good idea because the x86 and ppc compilers have some differences (no quad or double support on ppc, also there is a limit on procedure parameters). If people just blindly select "
universal binary" as output and never test the ppc side of that
binary, they will most likely end up with a broken program on ppc Macs.
So better compile the ppc version separately and also test it separately (can be done with Rosetta), and only combine them to a
universal binary once you know they both work as expected.
Re: Universal Binaries for Mac OS
Posted: Sun Jan 28, 2024 6:16 pm
by tikidays
Why is there a compile option for "Any CPU" if it doesn't compile for Intel and ARM? Is this a prep thing?
Re: Universal Binaries for Mac OS
Posted: Sun Jan 28, 2024 10:22 pm
by mk-soft
For Any Intel CPU (SSE, etc) for user libraries ...
Re: Universal Binaries for Mac OS
Posted: Sun Jan 28, 2024 10:25 pm
by jacdelad
tikidays wrote: Sun Jan 28, 2024 6:16 pm
Why is there a compile option for "Any CPU" if it doesn't compile for Intel and ARM? Is this a prep thing?
Before asking in the forum, you should read the help:
Cpu Optimisation (next to Executable format)
This setting allows to include Cpu optimised PB functions in your executable:
All CPU : The generic functions are included that run on all CPUs.
Dynamic CPU : The generic functions as well as any available CPU specific function are included. The function to execute is decided at runtime. This creates a bigger executable, but it will run as fast as possible on all CPUs.
All other options : Include only the functions for a specific CPU. The executable will not run on any Cpu that does not support this feature.
Note: No PB functions actually support this feature for now (it is ignored for them). However, some User Libraries include such optimisations.
https://www.purebasic.com/documentation ... piler.html