Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I know: src.rpm usually contain some kind of tar or compressed source code for the app/library/package Sometimes people recommend you compile from source if the package does not work

What I don't know: Why would you recompile from source? What do I need to compile from source? gcc? xlc?

What I would like to know: Hypothetically, if you have a src rpm could you compile that rpm to run on Fedora and then take the same src rpm to AIX and compile it to run on AIX?

share|improve this question
yes and no. It's not that simple, as aix may not have all the library and package dependencies. It also means you can alter the ./configure stage of the build, or where the files get installed to. – Sirex Feb 6 '13 at 18:42

Well, the .src.rpm contains the source code and information about where the various files and executables should be copied to (installed).

So, yes, you should be able to compile the source both on Fedora and AIX. That does not, however, mean that you could also "install the rpm". Installing consists of copying files to various system folders such as /usr, /etc and so on. Different operating systems expect certain files to be at different locations so there is no guarantee that an .rpm for Fedora will be able to install on AIX. In fact, it is extremely unlikely.

As for compiling, you may want to compile from source to have a binary that is optimized for your particular hardware, or to activate certain compile flags such as the location of specific libraries. In general, if you don't know why you should compile from source, then you probably shouldn't.

If you choose to compile, you will need the appropriate compiler. That can be (among others) gcc or xlc for software written in C or C++, javac for Java etc. Which one you should use depends on the software you are installing and your personal preference. Sometimes, software has been written with specific compilers in mind (using certain options at compile time) and they will complain if you try and compile them with another.

Finally, most *nix source tarballs include a Makefile and a configure script. You will need to have the necessary tools to use them. The configure script is usually a simple BLASH script so as long as you have BASH installed you should be fine. Using the Makefile needs the make command. There are also some other basic tools (such as autoconf and automake and others) that you will need. I have not worked on a RH-based distribution for many years no but if memory serves, this command should install everything you need:

yum groupinstall "Development Tools" 
share|improve this answer
Thank you for the detailed explanation. This cleared up many ambiguities for me regarding this process. I feel like I've only seen the process from the OS/admin side and not the development and this put things in perspective. – HayekSplosives Feb 6 '13 at 19:42
@HayekSplosives if this answers your question, please mark it as accepted so the question can be marked as answered. – terdon Apr 5 '13 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .