Results 1 to 8 of 8
  1. #1


    Member Since
    Apr 23, 2009
    Posts
    3
    compiling Linux app for OS X
    Greetings -

    I'm a Linux user who has been asked by a small but growing (and typically vocal) group of Mac users to compile a particular technical application I help maintain (mathematical statistics) so it will run under OS X. I don't have access to a Mac (out of the 100+ machines in my department, there are zero Macs...), so I'm looking to see if its possible to flip the right compiler flags (gcc all the way) to compile for Intel-based Macs running OS X. In other words, compile for Intel CPU (-march intel) under Linux, and send the binary to someone to run under OS X. I can do this for Windows, but this is the first time I've had a Mac user make the request. I've poked around a bit, and all I've found is how to do the port/compile *on* a Mac. I don't have that situation. I have a Linux box (many, in fact), and need to comiple a OS X-compatible binary on it. I rather assume its doable, if I statically compile libs into the binary, but I was wondering if there are other things (Mac-specific) I need to consider. Note: this is a 'real' technical application - command line, no GUI, no nothing. So, no issues about Gnome or KDE libs and such.

    Apologies if this should go in another section of the forum, but this was my first best guess.

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    I can't help too much on the technical side but I'm sure if you are willing to do so, some members here might be willing to compile the program for you (myself included - I would need detailed instructions as to what flags to include for gcc though).

    If this group is so vocal, why not borrow one of their machines?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3


    Member Since
    Apr 23, 2009
    Posts
    3
    Quote Originally Posted by vansmith View Post
    I can't help too much on the technical side but I'm sure if you are willing to do so, some members here might be willing to compile the program for you (myself included - I would need detailed instructions as to what flags to include for gcc though).
    Alas, portions of the code aren't GPL (proprietary), and I can't release the code beyond certain specified machines.

    If this group is so vocal, why not borrow one of their machines?
    Well, if they were (i) at my institution, and (ii) willing to give me a machine for a day or so, then sure - but, they're not. And, as per OP, there isn't a single Mac in my building. My best recourse, though, will be to see if I can find someone within the larger institution I work at with a Mac that would let me access theirs for a bit.

    What I've learned since my OP is that even if I static compile all the libs, even if its the same chip (more or less same Intel arch), it won't work, since OS X uses a different standard for binary executables the *nix. Too bad.

    Ah well...

  4. #4

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Quote Originally Posted by johnny_canuck View Post
    Alas, portions of the code aren't GPL (proprietary), and I can't release the code beyond certain specified machines.
    Fair enough. I had assumed it was FLOSS.

    Quote Originally Posted by johnny_canuck View Post
    Well, if they were (i) at my institution, and (ii) willing to give me a machine for a day or so, then sure - but, they're not. And, as per OP, there isn't a single Mac in my building.
    Surely one of them owns a MacBook or MacBook Pro.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  5. #5


    Member Since
    Apr 23, 2009
    Posts
    3
    Quote Originally Posted by vansmith View Post
    Surely one of them owns a MacBook or MacBook Pro.
    Nope - we're still pure (although I think I spotted our first iPhone last week).

  6. #6

    DairyKnight's Avatar
    Member Since
    Apr 27, 2009
    Posts
    3
    If you release the source code, there shouldn't be any problem for the Mac user to compile it. Make sure the end user has XCode installed. It comes with all the gcc and autotools you'll need.

    Another thing is, make sure you run necessary commands with 'sudo'. The same story in Ubuntu.

  7. #7

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Quote Originally Posted by johnny_canuck View Post
    Alas, portions of the code aren't GPL (proprietary), and I can't release the code beyond certain specified machines.
    Quote Originally Posted by DairyKnight View Post
    If you release the source code, there shouldn't be any problem for the Mac user to compile it. Make sure the end user has XCode installed. It comes with all the gcc and autotools you'll need.
    The code has to stay with him.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  8. #8

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,866
    Specs:
    Way... way too many specs to list.
    I think you'll run into difficulties compiling an app for one OS on another. Find someone that'll sign an NDA and have them compile it, then you have a releasable binary
    mike
    This machine kills fascists
    Got # ? phear the command line!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dual boot mac os x and linux linux on external hard drive
    By Magus10 in forum Running Windows (or anything else) on your Mac
    Replies: 11
    Last Post: 10-06-2012, 10:33 PM
  2. Mount a linux (ext3) drive in a VM instance of Linux
    By garycarroll in forum Running Windows (or anything else) on your Mac
    Replies: 4
    Last Post: 01-13-2009, 10:22 AM
  3. Compiling linux code
    By metalsam in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 07-14-2007, 08:04 AM
  4. App to mount Linux filesystems
    By jakeroberts in forum OS X - Apps and Games
    Replies: 2
    Last Post: 06-14-2007, 07:17 PM
  5. compiling linux apps to run on mac
    By metalsam in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 04-08-2007, 12:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •