How to compile program under Linux / UNIX / FreeBSD
Q. I've downloaded tar ball software but I don't know how to compile the same? Can you provide the instructions for compiling a program?
A. Many new users find it difficult to compiling programs in Linux. Usually following steps are involved:
a] Download tar ball using wget
b] Untar tar ball using tar command
c] Compile program using make or configure command
d] Install software
Task: compiling program
Step # 1: Download program tar ball:
$ wget http://url-com/prog.tar.gz
Step # 2: Untar tar ball :
$ tar -zxvf prog.tar.gz
$ cd prog
Step # 3: Untar tar ball:
Configure program:
$ ./configure
Compile program:
$ make
Install program (must be run as the root, login using su or use sudo):
$ sudo make install
or
$ su -
$ make install
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Howto see output of C program in Linux or UNIX
- How you can run a c program in Linux?
- Howto Compiling C program and creating executable file under Linux / UNIX / *BSD
- On Linux how many kernel you can compile at the same time and how many kernel you can load in Linux?
- Download or install C, C++ compiler on Red Hat Enterprise Linux 5 (RHEL)
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: compiling program, configure_command, downloaded tar, install software, make_command, root login, sudo_command, tar ball, tar gz, tar_command, untar, wget_command ~ Last updated on: November 18, 2007



November 19th, 2007 at 3:05 pm
Step # 3: Read README, INSTALL, and any other documentation. This will save a lot of hassles when configure and/or make fails.
November 20th, 2007 at 7:30 am
Ed,
Yup, README or INSTALL will save tons of time. Appreciate your post.