954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Can I run Linux code (32bit machine) in Linux (64bit machine)

Hi,

I've c source code developed in 32-bit linux machine. Can I run it in 64-bit linux machine.

Thank you.
Santos

santosdas
Newbie Poster
1 post since Sep 2006
Reputation Points: 13
Solved Threads: 0
 

That depends on the code.

Grunt
Junior Poster
152 posts since Jul 2006
Reputation Points: 197
Solved Threads: 12
 

Providing the author did the job properly, all you need to do is recompile it on the target machine.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

unlike MS-Windows, not all *nix machines were created equally. A 32-bit program compiled on one *nix computer may or may not run on another 32-bit *nix computer, unless the hardware is identical. There are many different flavors of linux/unix computers and they run many different chip sets (or whatever they are called) (80x88, risk, etc). Programs have to be recompiled for each of these different machine types.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Yes, generally you must recompile code for different archs/non-standard kernels in Linux.

[offtopic]Mac OS X Leopard has a special backwards-compatibility regarding 64 and 32 bit apps[/offtopic]

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

In some distributions you can, if you're on the AMD64, i.e. x86-64 architecture, since it's a superset of x86 -- there are issues that come up, like the fact that you need thirty-two-bit libraries /and/ sixty-four-bit libraries installed on the system.

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You