Slashdot Mirror


IBM Releases XL compilers for Mac OS X

Visigothe writes "IBM released their XL Fortran Compiler and XL C/C++ Compiler for OS X. The compiler is binary compatible with GCC 3.3, and has multiple levels of optimization, creating binaries that are much faster than their GCC-compiled counterparts." No prices are noted, and the planned availability date is January 16.

21 of 84 comments (clear)

  1. Pricing by Erect+Horsecock · · Score: 5, Informative

    According to an Ars thread the XLC compiler will be $499 for a single seat license. WAY below the cost for the AIX versions.

    Linkage

    --
    I hope you die painfully and alone.
  2. Re:Current compiler? by Erect+Horsecock · · Score: 5, Informative
    What is MacOS X currently compiled with?


    I'm not 100% sure but I seem to remember in the WWDC keynote Jobs saying it was built with gcc3.3 the version that ships with Xcode.

    If so, the new IBM compiler would presumably speed up the entire OS somewhat if it were recompiled via IBM's compiler?


    Ya probably. I was surprised that they implemented Vector support so quickly. XLC really shines on Floating Point code, but I'm really curious to see how well it handles Vector. Even if the whole operating system isn't compiled with xlc as long as the core libs and things like codecs for QT and other multimedia apps the speed up would be impressive.
    --
    I hope you die painfully and alone.
  3. Re:Setting up a karma whore... by Anonymous Coward · · Score: 1, Informative

    I would imagine that it means a library compiled by one compiler could be linked by an app compiled with the other.

  4. Re:Setting up a karma whore... by dr2chase · · Score: 4, Informative

    Binary compatible means same data layouts, same parameter-passing conventions, same conventions for shared libraries and position-independent code. However, between those interfaces, the generated code is probably different.

    Think of it like nuts and bolts -- a nut and bolt are compatible if they have the same diameter and threads per inch, but they may be made of carbon steel, steel, bronze, nylon, titanium, whatever.

  5. Re:Setting up a karma whore... by davechen · · Score: 2, Informative

    Looking at IBM's accouncement it looks like they use same headers and run-time libraries as gcc 3.3. They say you can combine xlc and gcc compiled files. I.e., you can link object files.

  6. Re:Setting up a karma whore... by MBCook · · Score: 4, Informative
    I believe that it referes to the interfaces between code. What I mean is that, for example, it lists the functions in object files the same was as GCC and they are called with the same machine code sequence as GCC (they way arguments are put on the stack, etc). This is good for a few reasons. For one thing, it means that code written with this compiler can link to code written with GCC or vice-versa. Ordinarily you can't take an object file from VC++, one from OpenWatcom, one from GCC, and one from ICC and link them together. But if all the compilers were biniary compatablie, you would be able to. It has nothing to do with the internal code generated, as if both compilers generated identicle sequences of machine code, one couldn't be faster than the other. I think the main benefit is that, for example, you could use a static library that was compiled with this compiler with your code that uses GCC without a problem.

    As for commandline switches and such, I would assume that they would be the same (or that there would be a simple option like --gcc that would turn on "gcc mode" so that it took the same command line stuff).

    PS: If I'm wrong would someone please reply and correct me, and not just mod me wrong?

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
  7. Re:Supports G4 and G5, but not G3 by Gogo+Dodo · · Score: 2, Informative

    If I remember right (I'm not a Mac programmer), fat binaries are for mixing 68K and PPC code, not different PPC code.

  8. Re:Benchmarks by integral-fellow · · Score: 4, Informative
    for performance comparisons, see this page:
    http://www.spscicomp.org/ScicomP7/Presentations/ Blainey-SciComp7_compiler_update.pdf
  9. Re:Current compiler? by Selecter · · Score: 3, Informative
    Yes, Panther was built with the GCC 3.3 "+" some poeple are calling it. The OS would speed up quite dramatically *if* Apple were to release G3/G4/G5 specific versions as the opts for the G5 if taken to the highest level would actually slow down or break things with a G4 or more likely a G3.

    More likely they will break it down into chip specific libs and kibbles and bits and have the installer detect and choose. If they code for the middle ground I fear they will give up the best chance of having huge speed gains. They need those gains on the G5 to keep their momentum going.

  10. Re:Setting up a karma whore... by sartin · · Score: 3, Informative

    For C++, binary compatible goes the extra distance of requiring that the dynamic dispatch and run-time type information layouts be the same. When a C++ class gets created, there are hidden bits of data that are used to handle virtual functions and the likes of . Many binary interface standards don't specify how these work, but to be truly compatible, the two compilers have to match here. See Stroustup's Technical FAQ for a little more information.

  11. Re:Setting up a karma whore... by g_lightyear · · Score: 4, Informative

    "binary' refers, indeed, to the binary compatibility of object files; in GCC terms, when there's an "ABI" change, you have to re-compile all applications, as new stuff compiled in the new Application Binary Interface can't access stuff compiled in the old ABI.

    What it REALLY means:

    1) You can compile the majority of your application in GCC, and selectively compile in IBM's XLC.

    2) You can compile one library in XLC, and link it in to your GCC application.

    3) You can compile a library in GCC, and link it in to your XLC application.

    Etc. You get the point. Essentially, while the code they generate is very, very different in terms of optimization and performance, they are, in fact, completely interchangeable in terms of the things they produce as output.

    XLC is, in fact, a very different beast than GCC. The number of optimizations it provides goes well beyond what GCC currently provides, and does include auto-vectorization and support for OpenMP - things which don't suck on parallel systems.

    So XLC is a good thing for commercial software developers, and at minimum, the compatibility of the systems means that we as developers have no excuse not to be compiling, at bare minimum, the most *important* functions (and if we're doing it this way, it might as well be specific functions) in XLC, and link in that parallelized and optimized object file into our existing project.

    As for commandline switches... nope. Almost never compatible. No hope. Basic stuff is mildly similar, but the guts you'd use once optimizing are very different.

    But at a high level, yes, you just say xlc -O3 instead of gcc -O3, only you might say xlc -O5.

    --
    -- A mind is a terrible thing.
  12. Re:Current compiler? by TALlama · · Score: 4, Informative

    The only problem being that XLC doesn't support G3 Machines, so it would be impossible to create a binary that runs on any Mac, as is currently supported by GCC. In theory they could make separate binaries and install the 'correct' one, but that poses problems for systems booting off of external hard drives (which binary do you put on the drive?) and booting over the network. The ability to carry around a copy of OSX on your iPod is a powerful thing, and not one most people would give up lightly.

    Of course, this could have been gotten around by using Bundles, which is a folder that acts like a double-clickable application. The structure is:
    SomeApplication.app/ <-- The application
    Contents/MacOS/SomeApplication <-- The OSX binary
    Contents/MacOSClassic/SomeApplication <-- The OS9 binary
    Contents/Resources/Blah.jpg
    Contents/Resources/Foo.tiff

    It chould be:
    SomeApplication.app/
    Contents/MacOS/SomeApplication <-- The generic binary
    Contents/MacOS-G3/SomeApplication <-- The G3-optimized binary
    Contents/MacOS-G4/SomeApplication <-- The G4-optimized binary
    Contents/MacOS-G5/SomeApplication <-- The G5-optimized binary
    Contents/Resources/Blah.jpg
    Contents/Resources/Foo.tiff

    When you double-click, it uses whatever binary is appropriate for the system. Unfortunately, this doesn't work for Frameworks, which lack the notion of platform.
    A rant to beat the lameness filter: this bundle format should be adopted everywhere. It allows for a folder to be used as an application, and to contain all the resources it needs to be used and run. Moving the folder moves the application, and the folder doesn't use any vodoo to keep the data together, as pretty much any HD format understands folders and files.
    In addition, the multiple-binaries trick (as shown above working with OS9/X and proposed for processors) would allow the same bundle to work on muluple platforms, so I could email you a zipped version of Office from my Mac that could work on your Wintel, no Java required.
    The support is in the Finder/Explorer/Browser, which needs to understand that 'double click on bundle' == 'find correct binary and launch it'.

    --

    - The Amazina Llama

  13. Re:Benchmarks by York+the+Mysterious · · Score: 2, Informative

    http://www.spscicomp.org/ScicomP7/Presentations/Bl ainey-SciComp7_compiler_update.pdf Here's the correct address. The space in there screwed it up.

    --

    Tim Smith - Ramblings from Nerd Land
  14. Re:Benchmarks by klui · · Score: 4, Informative

    Slashdot mucks long lines. You need to use a link like this. Basically, on a POWER4 system (unknown re: G4/G5), specint2000 is around 30% improvement, specfp2000 is around 50% improvement. (Just eyeing the results.)

  15. Re:Supports G4 and G5, but not G3 by Anonymous Coward · · Score: 3, Informative

    NeXT did "Fat Binaries" before Apple did, and they are still possible in OS X's .app bundles. NeXT's added Fat Binary support on Black Tuesday in 1993. Apple's Fat binaries were introduced with the Power Macintosh line in 1994. NeXT's fat binaries could be built to run 68K, x86, SPARC, and PA-RISC.

    Of course, right now the search algorithm isn't designed for a fallback mechanism. The system can consider itself either a "MacOS" or a "MacOSClassic". Both are assumed to be generic PPC code and one doesn't fall back to the other.

  16. Re:Current compiler? by Graff · · Score: 2, Informative
    Of course, this could have been gotten around by using Bundles, which is a folder that acts like a double-clickable application...When you double-click, it uses whatever binary is appropriate for the system. Unfortunately, this doesn't work for Frameworks, which lack the notion of platform.

    Ahh, but that is what fat binaries are for. A fat binary allows you to package up several different versions of a program optimized for different runtime architectures.

    Macintoshes have been able to use fat binaries for some time, it was one of the things that allowed the fairly seamless transition from 68k processors to PowerPc processors.

    Here is more information on optimizing for the G5, if you look towards the bottom there is notes on packaging an app to run on different processors.
  17. Re:0 is more than 500 by bash_jeremy · · Score: 2, Informative

    I don't think IBM is trying to compete with the IDE. IBM made a somewhat superior compiler to gcc (what Apple currently uses to compile OSX and all their apps).

  18. Re:FASTER OS X? by g_lightyear · · Score: 3, Informative

    As there's work going into XCode to ensure that any project can specify which compiler it uses on a target-by-target basis, I fully expect we'll see several core projects in the Darwin codebase switch over to using both compilers (where XLC will be used to compile specific branches) in 10.4.

    OpenMP, at app-level, is pretty much guaranteed to get some use, and Apple will very likely spend some time in the vec/math libs fully OpenMPing that code to get parallel use of both CPUs.

    CoreGraphics would probably get some small, critical sections built with it, but it's much more difficult to figure out how to get good benefit out of OpenMP code in those circumstances.

    Anything else introduces problems; OpenMP will spawn off threads to do work, and if those threads start accessing code that isn't actually MT safe and/or fully reentrant at that level, it's going to get zero beneift.

    --
    -- A mind is a terrible thing.
  19. Re:Supports G4 and G5, but not G3 by Toraz+Chryx · · Score: 2, Informative

    Actually you're both wrong, kinda.
    the original G4 is a G3 + Altivec + MERSI + the 604e's FPU hardware

    the modern G4's bear very little resembalance to the 7400 however, having a pipeline three stages longer and a more elaborate altivec implementation.

  20. Also available for Linux PPC32/64! by Anonymous Coward · · Score: 1, Informative

    Just to note (this is slashdot after all) - these compilers have also been released for Linux on PowerPC! And there, it supports both 32-bit and 64-bit ABIs. On OS X, you're limited to the 32-bit ABI.

  21. Re:FASTER OS X? by gerardrj · · Score: 2, Informative

    Apple has completed some very major improvements to the gcc code base, I don't recall, but I think Apple managed so improve compile times by something like 25%, and code performance of something like 15%. I don't remember where I read those numbers, or how close I am to what I read.

    The reason (again from what I've read) that the gcc maintainers are resisting the changes that Apple would really like to make for the G5, is that the changes would fundamentally break many if not most of the other platforms compilers. I admit I don't understand compiler optimization, but apparently the logic that gcc uses for modeling the processor just can't keep up with the number of execution units, registers and/or the number of instructions in flight. I think the way the G5 "groups" instructions in to bundles of 5 for scheduling also throws things off a bit. I've read a few discussions that it's time for GCC to go through some sort of fundamental change that would allow for vastly different acitectures to be supported via plug-ins or modules or something.

    Apple could indeed fork gcc, but given their commitment to "giving back" to the open source community, that 's probably not going to happen. Hopefully someone more "in the know" can either confirm or correct some of this. I personally think also that forking something as fundamental as the compiler that's used for almost all open-source software would be a "bad thing".

    --
    Article X: The powers not delegated... by the Constitution...are reserved...to the people