How to Compile a Program in Linux
Download the source code for the program or driver from the Internet or other media., Unpack the downloaded code- for .zip files use "unzip your file", for .tgz or .tar.gz use "tar -zxvf yourfile"; for .bz2 use "tar -jxvf yourfile"; or extract your...
Step-by-Step Guide
-
Step 1: Download the source code for the program or driver from the Internet or other media.
It will most likely be in the form of a "tarball" and have a file extension of .tar, .tar.bz2, or .tar.gz.
Sometimes a .zip file will be used instead however. -
Step 2: Unpack the downloaded code- for .zip files use "unzip your file"
,, Arguments such as "
--prefix=" can be used to control the install location.
This checks that you have the right libraries and versions. , An executable for the program will be created in the bin directory inside the source code directory. ,, -
Step 3: for .tgz or .tar.gz use "tar -zxvf yourfile"; for .bz2 use "tar -jxvf yourfile"; or extract your files graphically.
-
Step 4: In the terminal
-
Step 5: move into the newly extracted directory (cd dirName).
-
Step 6: Run the command "./configure" to configure the source code automatically.
-
Step 7: Once configured
-
Step 8: run "make" which does the actual compiling (this can take anything from a few seconds to many hours).
-
Step 9: To install the program- run "make install".
-
Step 10: You have compiled and installed the program source code.
Detailed Guide
It will most likely be in the form of a "tarball" and have a file extension of .tar, .tar.bz2, or .tar.gz.
Sometimes a .zip file will be used instead however.
,, Arguments such as "
--prefix=" can be used to control the install location.
This checks that you have the right libraries and versions. , An executable for the program will be created in the bin directory inside the source code directory. ,,
About the Author
Brandon Murphy
Specializes in breaking down complex DIY projects topics into simple steps.
Rate This Guide
How helpful was this guide? Click to rate: