Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

phytonix

macrumors 6502
Original poster
Jan 26, 2006
388
15
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!
 

NuPowerbook

macrumors member
Jan 17, 2004
51
0
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.
 

wahgnube

macrumors member
Feb 15, 2006
85
0
phytonix said:
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!

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. :)
 

Marvy

macrumors regular
Jul 2, 2003
106
0
Germany
NuPowerbook said:
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.
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.