Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rating: Thread Rating: 10 votes, 5.00 average. Display Modes
Old 03-26-2012, 05:37 AM   #1
djhayman
Prospect
 
Join Date: Aug 2011
Posts: 35
Compiling and Socat

Hello,

In order to carry out some experiments at work iI have needed to compile a command line utility called 'Socat' http://http://www.dest-unreach.org/socat/

I have compiled it on my laptop running 10.7.3. In the future I will be required to install it on several other machines.

If the hardware and OS version differ ie: a Mac Mini running 10.7.2 or other will I need to compile 'Socat' for each machine?

Can I make an installer to use with Apple Remote Desktop? If yes, any guidance would be appreciated.

Thanks,
Dan
djhayman is offline   Reply With Quote
Old 03-26-2012, 08:33 AM   #2
fracai
MVP
 
Join Date: May 2004
Posts: 2,099
I can't help with the installer, but generally you should match the major OS version (10.5, 10.6, 10.7, ...) and the machine architecture (ppc or i386/x86-64). If the program doesn't link to any system libraries ('otool -L socat') you can probably forget about the OS version.
fracai is offline   Reply With Quote
Old 03-26-2012, 09:22 PM   #3
dmacks
All Star
 
Join Date: Dec 2004
Posts: 678
Assuming same CPU, a program compiled on one OS should be portable to any newer one and usually to older within that major version but often not portable back to older major OS version if it links to system-supplied libs (which socat does on my machine...readline and openssl among others). So built in 10.6.2 would be fine on 10.6.3+ and 10.7.x but maybe not to 10.5.x. There are ways to specify more extensive backward compatibility if you want it. There are ways to build a "universal" binary that would work on different CPU, but it's not a default (on the other hand, some intel machines can run ppc binaries thanks to rosetta).
dmacks is offline   Reply With Quote
Old 03-27-2012, 03:49 PM   #4
djhayman
Prospect
 
Join Date: Aug 2011
Posts: 35
Thanks for your reponses. It looks like I shouldn't have a problem using socat compiled on my machine on others then. The only issue is what is the most efficent way of installing it.

I have found a packagemaker.app from Apple and think that it is the correct thing to use. The issue is I am not 100% percent sure as to what files I need to include in the installation. It looks like I have socat unix executable after my orginal compile. Can I simply copy this to each machine in the /usr/local/bin folder?

dmacks, as you have used socat before I'd love you opinion on the following: The machine I plan to install and run socat on will be connect to a display via a USB-serial cable. I plan to use socat as a serial device server. So far my plan is to use Platypus http://sveinbjorn.org/platypus to wrap a socat command into an application. Then, use launchd to ensure it starts up after each reboot and restarts should the app crash.

Do you think this is the best method? My doubts are that should the Platypus made app crash, that it doesnt necessarily mean that socat has crashed.

Any pointers will be gratfully recieved.

Thanks,
Dan
djhayman is offline   Reply With Quote
Old 03-28-2012, 12:00 AM   #5
dmacks
All Star
 
Join Date: Dec 2004
Posts: 678
I haven't actually used socat in a loooong time; just quickly built it (via its fink package) to see what libraries it used. However, it seems like maybe overkill/overly-convoluted to roll a command-line program into a clickable app and then use a non-GUI system facility to baby-sit it as a task without any user interaction.
dmacks is offline   Reply With Quote
Old 03-28-2012, 03:22 PM   #6
djhayman
Prospect
 
Join Date: Aug 2011
Posts: 35
Hello, fair point.

In slight contrast to the threads title, what is the best way for me to distribute socat? I have looked at the packagemaker.app tool created by Aple and am confident on how to use it and how to make it search the target system for min requirments.

The issue I am unsure about is whether installing socat is as straighforward as copying the unix executable to the correct folder?

Thanks,
Dan
djhayman is offline   Reply With Quote
Old 04-03-2012, 09:02 AM   #7
codeye
Guest
 
Posts: n/a
I've just had to do this.
I copied a compiled version of socat to opt/local/bin
and 2 libraries libncurses.5.dylib + libreadline.6.2.dylib to opt/local/lib
for it to run on a machine without macports installed.
  Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.