There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash driver drivers error ethernet excel freeze gaming gpu hard drive hardware hdmi internet laptop malware memory monitor motherboard music network obp operating system printer problem ram registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
The Techguy Linux Software from source HOWTO

Reply  
Thread Tools
Whiteskin's Avatar
Senior Member with 2,051 posts.
 
Join Date: Nov 2002
Location: Alberta, Canada
Experience: Windows: Decent. Unix/Linux: Advanced +1
20-Mar-2005, 11:02 PM #1
The Techguy Linux Software from source HOWTO
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
__________________
emerge world_domination;
Smart Questions gentoo
Ubuntu
linux google:Shiny!
cheese's Avatar
Senior Member with 2,855 posts.
 
Join Date: Jun 2003
Location: Dark Side of The Moon..
Experience: I find computers attractive.
20-Mar-2005, 11:13 PM #2
Sticky for Whiteskin!
mushka's Avatar
Member with 51 posts.
 
Join Date: Sep 2004
Experience: much to learn
30-Mar-2005, 05:15 PM #3
lmao
I searched for quite a while to find such a wonderfully simple guide to installing from source.

many thanks

chz
ben
mushka's Avatar
Member with 51 posts.
 
Join Date: Sep 2004
Experience: much to learn
30-Mar-2005, 05:19 PM #4
and cheers to Cheese for making it stick

*BUMP*
CouchMaster's Avatar
Senior Member with 3,365 posts.
 
Join Date: May 2003
Location: West Texas
Experience: n00b
01-Apr-2005, 06:04 PM #5
Straight forward, plain English - Everything should be so easy!
xico's Avatar
Distinguished Member with 29,958 posts.
 
Join Date: Jun 2002
Location: Venice, FL
Experience: Intermediate
17-May-2005, 05:31 PM #6
Quote:
Originally Posted by Whiteskin
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
Hi Whiteskin,

I'm ready to install Ubuntu. Are there any further instructions, aside from this very good post?
__________________
If any man tells you he loves America, yet hates labor, he is a liar" - Abraham Lincoln
xico's Avatar
Distinguished Member with 29,958 posts.
 
Join Date: Jun 2002
Location: Venice, FL
Experience: Intermediate
17-May-2005, 05:34 PM #7
Quote:
Originally Posted by Whiteskin
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
Better yet will I be able to install Ubuntu with the information here?
__________________
If any man tells you he loves America, yet hates labor, he is a liar" - Abraham Lincoln
Big-K's Avatar
Distinguished Member with 6,954 posts.
 
Join Date: Nov 2003
Location: Kansas
Experience: Advanced
17-May-2005, 05:55 PM #8
No. That information is for installing programs. Ubuntu, like most distros, comes with it's own installer(which uses dos-style graphics).
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
17-May-2005, 05:58 PM #9
Ubuntu is easy enough to install.
Randolf34's Avatar
Account Disabled with 353 posts.
 
Join Date: Nov 2005
Experience: Beginner
30-Nov-2005, 03:55 AM #10
how about red hat 9.0? having fun with finding iso9660 cd images despite downloads of
everything in sight.
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
30-Nov-2005, 07:43 AM #11
^Old IMO. Quite old, i'd use fedora if you want redhat, unless you pay.
bearqst's Avatar
Member with 162 posts.
 
Join Date: May 2004
Location: Interior Alaska
Experience: Advanced
30-Nov-2005, 01:50 PM #12
Or WhiteBox for the RHEL4
rob.rice's Avatar
Computer Specs
Senior Member with 736 posts.
 
Join Date: Apr 2006
Experience: Advanced
22-Apr-2006, 04:05 AM #13
well one important thing was left out
always always right after untaring the archive read the README file
"$less README "
this is even more important if there is a configure script to run because alot of functionality depends on configuration options and you could miss out on what your installing the program for in the first place
another good idea is to keep the Makefile around just in case you want to uninstall the program a good place to do this is to make a directory named after the program in "/usr/doc" you should also copy the text documentation to this directory including the README file
jarchack's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2004
21-May-2006, 06:43 AM #14
One thing to be aware of
Many modern distros like ubuntu and red hat have package managers and repositories with prebuilt software. Although many apps can be compiled and installed (assuming dependencies are fulfilled) you may end up hosing your distros package manager database. eg, you can download, extract, compile and install the latest version of software-x.xx but when you go to use apt or synaptic afterwords it will tell you that there's a broken package. With ubuntu being Debian based I don't thing there's a single application that hasn't already been made into a .deb file.
klam's Avatar
Senior Member with 181 posts.
 
Join Date: Apr 2006
Experience: Advanced
16-Jun-2006, 08:39 PM #15
Pretty nice mini-tuto so simple and so clean. Now my question is... how do you go about uninstalling the program since *nix don't have the add/remove programs? (assuming the program installed doesn't have an uninstall option)

Don't tell me it's like Mac that u just drag the whole folder to the recycle bin lol
__________________
"the only refuge from the damnation of the panta rei, and she guessed it was the Pendulum’s business, not hers"
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:02 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.