Will Intel Mac OS X be able to run binary compiled on Linux?

Discussion in 'macOS' started by phytonix, Feb 16, 2006.

  1. phytonix macrumors 6502

    Joined:
    Jan 26, 2006
    #1
    We would like to run a pure CLI program written in C on a Mac. Because we do not have source code, we could not recompile it for PPC. This binary is compiled on x86 Redhat Linux. Is it possible to run it on a Intel Mac?
    Thank you!
     
  2. NuPowerbook macrumors member

    Joined:
    Jan 17, 2004
    #2
    No, you answered your own question, it is compiled to run on Redhat Linux.

    Mac OS X's underlying system is Darwin. Darwin is a UNIX, not a linux.

    Just because the hardware is similar now, doesn't make programs written for OS A to run on OS B. Thats like asking if you can run linux binaries on windows.
     
  3. wahgnube macrumors member

    wahgnube

    Joined:
    Feb 15, 2006
    #3
    I think the *BSDs have a Linux emulation mode (since I guess there's so much excitement and work on Linux) to run Linux binaries without recompiling. You could try googling and see if it will work on OS X.

    Since they keep harping about how it's a BSD derived UNIX and all. :)
     
  4. Marvy macrumors regular

    Joined:
    Jul 2, 2003
    Location:
    Germany
    #5
    That's not really a good comparison, as Linux and Unix have alot more in common than Windows and Linux. Linux apps can usually be compiled quite easily for the Mac as both are Unix flavors. Windows apps, on the other hand, usually need quite a lot of porting, in which calls to the Windows API need to be translated to Mac OS equivalents.
    Compiled Linux programs also come in various flavors. A popular one is the ELF executable format. It does not run under Mac OS X however, which uses Mach-O binaries. Whether the FreeBSD emulator works, I can't say. But keep in mind that you'll need many compiled Linux libraries, such as gtk, to get the executables to work. Unlike on the Mac, where libs are often included in the Application bundle, Linux apps usually always rely on the pre-installed libs, somewhere in /usr/lib or /usr/local/lib. Hope that helps.
     

Share This Page