compiling Linux app for OS X

Joined
Apr 23, 2009
Messages
3
Reaction score
0
Points
1
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.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
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?
 
OP
J
Joined
Apr 23, 2009
Messages
3
Reaction score
0
Points
1
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...
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
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.

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.
 
Joined
Apr 27, 2009
Messages
3
Reaction score
0
Points
1
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.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Alas, portions of the code aren't GPL (proprietary), and I can't release the code beyond certain specified machines.

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.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's 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 ;)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top