Subject: [TAG] Compile on one, run on another machine

From: "Ferenc-Jan" <[email-masked]>
Date: Sun, 14 Mar 2004 16:14:57 +0100

Hi there!

I've got a question that may be of interest to the linuxgazette 
community. Where does one go to find out more about cross compiling? 
(I'm not even sure cross compiling is the correct term for this.) 

The case is this: I often want to compile stuff on one machine but 
run it on another. My permanently-in-disrepair, bleedingly fast & 
incredibly messy test system is the machine of choice for compiling 
all kinds of linux stuff. The barely alive, old laptop or the lean & 
mean firewall box aren't - besides, I don't want a full blown gcc 
environment on those. But I run into problems most of the time. 

Approach A: compile it as per instructions. Then I have to go and 
find all the nitty bitty parts of the package, that are now residing 
everywhere on the test system's drive. This often fails because 
missing parts don't always generate comprehensible error messages.

Approach B: try to install it to a different directory, i.e. /tmp/ 
and then move it to the other machine. This often founders on hard 
coded file location, i.e. when /tmp/lib/something is actually at 
/usr/local/lib/something (like it should be.)

I don't consider myself a beginner, but who does. I don't seem to be 
able to google the answer to this problem, but surely I'm not the 
only one running into this?

Any hints would be much appreciated, but I understand this must be 
relevant to linuxzgazette before you can spend your time on this. 
Thanks anyway!

cheers

Ferenc-Jan
_______________________________________________
TAG mailing list
[email-masked]
http://linuxgazette.net/mailman/listinfo/tag

---

From: Thomas Adam <[email-masked]>
Date: Sun, 14 Mar 2004 15:50:49 +0000 (GMT)

> Hi there!

Hello.
 
Cross-compiling refers to compiling applications on a computer that is not
intended for the same computer because often the target computer has a
different architecture.

> missing parts don't always generate comprehensible error messages.

This is not an approach, this is what usually happens when you compile a
program.

> /usr/local/lib/something (like it should be.)

This is dependant upon how ldconfig registers where the libraries are
(possibly by way of $LD_LIBRARY_PATH).

> only one running into this?

I'm not quite sure what it is you're asking. If it is "how can I compile
applications such that I can minimise the number of (likely) errors", then
the answer is to compile it statically so that the application doesn't
have to go using any external libraries. Thr only disadvantage with this
is that the resultant binary is often very large.

Dynamic libararies are the most popular -- much smaller, but it does mean
that it is up to the user to ensure that these libraries are installed.
'ldd' goes a long way to checking and ensuring that is the case. But at
compilation time, the user is often told what libraries (if any) are
needed.

-- Thomas Adam

=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor"                 -- http://linuxgazette.net

"<shrug> We'll just save up your sins, Thomas, and punish 
you for all of them at once when you get better. The 
experience will probably kill you. :)"

 -- Benjamin A. Okopnik (Linux Gazette Technical Editor)

___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html
_______________________________________________
TAG mailing list
[email-masked]
http://linuxgazette.net/mailman/listinfo/tag