Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

source, binary...what's what? I'm still new to open source

Status
Not open for further replies.

JohnnyCarnage

Technical User
Jan 10, 2006
44
0
0
US
Hi gang,
I've seen many a times that binary and source code is offered for download. I wouldn't know what to do with either. In an attempt to improve my skill set...

what's the difference between the two and what are their purposes?

 
Binaries are pre-compiled and designed for a particular system or package manager whereas source is the actual source code and you would need to compile, link and install them yourself.

The answer is "42"
 
When you see binary and source code offered, they're talking about the form the program comes in.

The computer does its magic by following instructions in binary codes. These codes are specific to each kind of CPU. When you see a "binary" offered for download, they are talking about a program in a form ready to be digested by a computer.

Programmers used to enter these codes directly into the computer, but it was very cumbersome. They wrote programs to translate short words into the binary notation needed by the computer. These short words were called 'assembly language,' and the translating program was called an 'assembler'.

Eventually, programmers designed symbolic languages which could be given to a program that would do the translation to the computer. Initially, these programs (called compilers) were very inefficient, but over the course of time began to meet and even exceed the efficiency of hand-writing the assembly programs. Since it is so much easier for programmers to use these higher levels of abstraction, these days almost no programming is done in assembler (except for the construction of compilers).

A program that is still in the form of one of these symbolic languages is known as the 'source code', while the binary representation is known as the 'object code'. If you have the source code of a program, it is much easier to both read and alter than in its binary form.

So to convert source code to a binary file that will make the computer do things, you must compile it to 'object code'. Then, usually there is a linking phase where each bit of object code that goes to make the program is put together. Installation is usually just a matter of putting things in the right place so that the computer system knows where it is and what to do with it.

Hope this helps.

-
 
If you are not a programmer, don't let all this scare you away. As was stated earlier, source code is code that you will compile on your on machine. All the files come in what is called a tarball. You will recognize it by the extension filename.tar.gz. Most of the work for compiling has already been done for you. In most cases it is a simple as typing a few commands:

1) tar -zxvf filename.tar.gz
2) change to the directory this file was uncompressed to.
3) ./configure (this configures the program to your specific machine)
4) make (creates the executables)
5) make install (this will move the files to where they should go)

The term binary package is just that. It is not talking about the executable but rather how the program was packaged. Some distros of linux use a program manager that will install and remove packages from you computer. You will recognize these by the extension filename.rpm. You can usually install these from the command line by using a command like:

rpm -ivh filename.rpm

Of course, if you have the GUI running, you can browse to the directory where you downloaded the file and double click on it. Not all distros use rpm but provide a way to update your installed packages.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top