LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I need some clarification (https://www.linuxquestions.org/questions/linux-newbie-8/i-need-some-clarification-876454/)

JackNielson 04-22-2011 02:44 AM

I need some clarification
 
I was hoping that someone could answer this:
If some writes a piece of software for Linux, does that mean it will
run on any version of Linux on any architecture?
Or do versions differ and architecture need cross compiling?
Thanks

TobiSGD 04-22-2011 02:49 AM

If you compile software for the x86-architecture it will of course not run on a SPARC-system. You need to recompile in this case. That is one of the advantages of open source, since you have the source code it is not very difficult (in most cases) to adapt the software to a new architecture.
If you use any libraries in your software, these libraries have of course to be present (in a somewhat similar version) on a system where you want to run your software.

If you have the same architecture and the libraries present it shouldn't matter if you run the software on Slackware or Ubuntu.

JackNielson 04-22-2011 02:55 AM

So are you saying that the only thing that matters is the architecture, and if I write
a program for Linux(say crunchbang) on a x86 processor it should run on any other Linux distribution(say slackware) on a x86 processor?

T3RM1NVT0R 04-22-2011 02:58 AM

@ Reply
 
Hi JackNielson

Whenever someone writes the code for linux it is basically the source code and then you compile it according to your wish. I am not sure about other versions of Linux but in Redhat, Fedora and CentOS what you can do is you can download the source rpms and then you can modify the spec file to compile it according to the architecture you want to run it on.

Some of the rpms comes up with noarch tag put at the end of the name. For example (just an example not sure if this rpm comes with noarch or not) firefox-2.3.1.45-noarch.rpm which means it can run on any architecture and is architecture independent.

I hope that answers your query.

TobiSGD 04-22-2011 04:03 AM

Quote:

Originally Posted by JackNielson (Post 4332327)
So are you saying that the only thing that matters is the architecture, and if I write
a program for Linux(say crunchbang) on a x86 processor it should run on any other Linux distribution(say slackware) on a x86 processor?

If all the libraries needed by the application (for example for graphical output), the so called dependencies, are installed on both systems in an appropriate version then yes, it should run on both systems.

JackNielson 04-22-2011 05:06 AM

Thank you very much TobiSGD


All times are GMT -5. The time now is 04:13 PM.