LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Porting application from Redhat to Ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/porting-application-from-redhat-to-ubuntu-914123/)

kaduu 11-17-2011 04:32 PM

Porting application from Redhat to Ubuntu
 
Hi,
Does anybody have any pointers on what are the steps necessary to be done to port an application from RedHat Linux to Ubuntu 10.04. For example can I take an application that is compiled on Redhat and run it directly on an Ubuntu box. I do understand that I would need to recompile the application on Redhat but was wondering if anybody has tried to run an app compiled one distro on another distro without recompiling.
Also any pointers to articles which list info on porting from Redhat to Ubuntu.

Thanks
Kaduu

MS3FGX 11-17-2011 04:48 PM

There is really nothing to "port", the differences between distributions are not so great that you have to go through any special steps to make it work on a specific distribution.

The only issue you may have is if the application, when compiled on Red Hat, was built against libraries which are not the same version on Ubuntu. But this isn't really a difference in distributions exactly, as the same issue could come up when trying to use a program compiled for a newer version of a particular distribution on an older version of the same distribution.

If course, if your application is compiled statically and doesn't link to any libraries in the system, then it won't matter.

chrism01 11-17-2011 04:51 PM

IF the processor is the same basic type eg x86 (intel/amd) and kernel is same base version eg 2.6.x and same bit size ie 32 or 64, THEN you can probably get away with copying the binary across from RH->Ubuntu.
Otherwise, copy the src and re-compile.
For src code langs like bash, Perl etc, should be no problem anyway.

FYI, RH has 'multi-lib', which means that a x86-64 OS also includes the libs for 32 bit and will use (ie be able to run an app) whichever is appropriate.
Don't know about Ubuntu ...

Valery Reznic 11-18-2011 05:00 AM

Quote:

Originally Posted by kaduu (Post 4526918)
Hi,
Does anybody have any pointers on what are the steps necessary to be done to port an application from RedHat Linux to Ubuntu 10.04. For example can I take an application that is compiled on Redhat and run it directly on an Ubuntu box. I do understand that I would need to recompile the application on Redhat but was wondering if anybody has tried to run an app compiled one distro on another distro without recompiling.
Also any pointers to articles which list info on porting from Redhat to Ubuntu.

Thanks
Kaduu

If you are lucky (== both distributions have nearly same libraries), then you can just copy your application and it will work.

If not you can re-build application on Ubuntu from source, as was chrism01 suggested, or use statifier (http://statifier.sf.net) or Ermine
(http://magicErmine.com) to create on RedHat self-contained executable, that can be copied to any Linux distribution with recent enough kernel

schneidz 11-18-2011 09:41 AM

all linux executables should be able to run on any distribution. however a 32-bit kernel cant run a 64-bit program.
Code:

/usr/bin/dbus-launch: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
the major difference 'tween redhat based distros and debian based distros is the package manager; how the system downloads and installs programs (yum *.rpm vs. apt-get *.deb)

Valery Reznic 11-18-2011 02:26 PM

Quote:

Originally Posted by schneidz (Post 4527582)
all linux executables should be able to run on any distribution. however a 32-bit kernel cant run a 64-bit program.
Code:

/usr/bin/dbus-launch: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
the major difference 'tween redhat based distros and debian based distros is the package manager; how the system downloads and installs programs (yum *.rpm vs. apt-get *.deb)

It's not correct. First, for any Linux executable exist minimal kernel version required to run it. In your example it's 2.6.32 Dbus launch-will not run on an system with kernel < 2.6.32
Second - shared libraries. All needed shared libraries should be present on "target" distribution and those libraries should be compatible with libraries that your executable was linked against during build time.

There are times when both of those conditions are satisfied and then executable will happily run on "foreign" distribution.
But there are also times when they are not.

jmc1987 11-18-2011 02:37 PM

Bring over the binaries might work but you might end of with endless amount of trouble with libraries, etc. Why not just get teh source code and compile it?


All times are GMT -5. The time now is 10:43 PM.