iMarc | Interactive Media Architects
  • Portfolio
  • Process
  • About
  • Communiqué
  • Contact
  • Support
  • Search

Simply, Compiling From Source

by Jeff Turcotte - November 7, 2006 / 12:48pm View more articles

Being relatively new to Unix/Linux, I was constantly looking for guides on how to perform different tasks. One area that I found to be lacking was a simple guide/explanation to compiling from source.

As of late, distributions have made installing software so easy that a lot of general users don't tend to care about compiling from source. What most don't realize is that your choice of, and ability to customize software increase dramatically. Plus, it's just cooler to watch a program compile than it is to download 'packages', etc.

Here is a simple explanation of how to perform this simple, yet valuable skill! As an example, I will be installing Vim 7.0 from source. You will most likely need root access to perform these commands. If you have any missing libraries/programs you should be told which ones you need in the process.

1. Get the source into your /usr/local/src/ directory.

go to /usr/local/src/:

cd /usr/local/src/

get the source:

ftp ftp.vim.org
cd /pub/vim/unix/
get vim-7.0.tar.bz2
quit

extract the files:

tar -yxvf vim-7.0.tar.bz2

2. Running the configure shell script.

This step will most likely exist, but not everyone includes a configure script with the source. With the Vim install, this step doesn't take very long, but be warned that sometimes it is notoriously long. Go get a drink:

./configure

3. Compile with Make.

Time to do the actual compiling and to go get another drink:

make

4. Put everything where it should be with Make Install

If everything was successful, lets move the compiled program to its appropriate place in the file system.

make install

5. Clean up the temporary files with Make Clean

Compiling uses a lot of temp junk files that you can now get rid of. This process is automated with:

make clean

6. Restart terminal session and run it!

Lets see where Vim is! (/usr/local/bin/)

whereis vim

now run it:

vim

Everything works! Now go compile more source code. The end.

More Articles Get the RSS Feed Post A Comment

9 Comments

by anonymous   #
on November 7, 2006 / 3:15pm
well, this is pretty much a INSTALL or README. sorry, but i can see no point in his article
by kuriharu   #
on November 7, 2006 / 3:18pm
This looks like an excellent guide.

What I'd like to see is what to do when installs go wrong. I know there's no way to explain what will happen in every case, but a list of the most typical explanations would really come in handy.

I'd say about 50% of the time this doesn't work for me, and I can find NO help on how to fix the problem. It's frustrating to say the least.
by Jeff Turcotte   #
on November 7, 2006 / 4:54pm
This is for people who have no idea what an INSTALL or README is. Sometimes you just need a simple explanation of the process in order to grasp it's fundamentals.
by Fred LeBlanc   #
on November 7, 2006 / 5:08pm
I agree, and in fact it's the whole "I'm smarter than you" attitude found in the Linux community that turns me off to the whole concept of it.

It seems that a lot of README files are written from the perspective of the person(s) that created the (program|module|whatever), and that's where it all goes wrong. Get someone that doesn't know the process in there and see what questions they have. Write things from their point of view.

Anyway, nice blog.
by Christian Keyes   #
on November 7, 2006 / 11:03pm
I'm with Fred. Someone like me with no prior experience needs somewhere solid and comrehensible to begin.

I'd Scoop it...
by anonymous   #
on November 8, 2006 / 1:07am
from the vim INSTALL (which is just a textfile btw):
.........
The simplest way to compile this package is:

1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.

Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.

2. Type `make' to compile the package.

3. Optionally, type `make check' to run any self-tests that come with
the package.

4. Type `make install' to install the programs and any data files and
documentation.

5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' cr.................

by Nick   #
on November 8, 2006 / 11:46am
You mention:

"What most don't realize is that your choice of, and ability to customize software increase dramatically".

Where, in your example, does the customization part happen?
by Matt   #
on November 9, 2006 / 2:16pm
I'm not actually a Linux user, but I'm considering at least a dual-boot option next time I format. My question: why do it this way? I know there must be advantages, but you pretty much glossed over them here.
by anonymous   #
on November 10, 2006 / 5:57pm
well, it would be as solid and (much more) comprehensive if there where just one line:
RTFM! (which would be the README in this particular case)


Comments have been turned off on this blog.
Read something more recent.

Statements and opinions expressed in this blog and any comments made are the private opinions of the respective poster, and, as such, iMarc LLC is neither responsible nor liable for such content.

iMarc

iMarc is a web development company in Newburyport, MA. This is our blog.
View all blogs or learn more about iMarc.

* Hiring: We’re hiring a Web Designer to design and build web sites and branding collateral.

About the Author

Jeff's Head Jeff Turcotte, Developer
I program killer robots websites.
More blogs by Jeff

Search Our Blog

Recent Communiqués

  • Year in Quotes (volume 2)
  • Gunslinging Rockstar Ninjas
  • Now Hiring: Junior Interactive/Web Designer
  • Photoshop: Create Your Own Glossy Icons
  • They only come out at night
  • Context switches are expensive
  • <i> is not evil.
  • Schooled.
  • Full-screen branding
  • Summer Job, iMarc Style
  • Custom Away Messages are Overrated
  • Random Vent
  • Hiring: Junior Systems Administrator
  • Using A Framework
  • for lack of nail

Popular Communiqués

  • Hiring: Junior Systems Administrator
  • Photoshop: Create Your Own Glossy Icons
  • Now Hiring: Junior Interactive/Web Designer
  • Gunslinging Rockstar Ninjas
  • They only come out at night
  • Summer Job, iMarc Style
  • Random Vent
  • Full-screen branding
  • for lack of nail

Recent Comments

  • Now Hiring: Junior Interactive/Web Designer

    By Dnmhxxsh: this is be cool 8) big tit get fuck >:[

  • Now Hiring: Junior Interactive/Web Designer

    By Zblxsxro: It's serious comforter sets for teenager =-(( preteen boys raped girl %)

  • Now Hiring: Junior Interactive/Web Designer

    By Dejyleps: perfect design thanks old grannie sex tgp =-]]]

  • Year in Quotes (volume 2)

    By Nick: Not inspirational, but how i feel sometimes as "Client Support". "I'm Drowning,…

  • Firefox Html Validator on Ubuntu Gutsy

    By Simeon Anastasov: Forget about my last question - i was too lazy to read through the whole comment chain. Now I got it :)

RSS

RSS Icon Learn about RSS and get the feed for our blog.

About iMarc

  • We build custom web sites
  • In-house strategy, design, programming, hosting
  • In business since 1997
  • We’re located in Newburyport, MA
  • Call us at (978) 462-8848

© 2008 iMarc LLC, Contact Us

Links

  • Home
  • Portfolio
  • Client Support
  • Log In
  • (icon)RSS

Meet the Team

Bill's Head Bill Bushee, Senior Developer

I handle all aspects of building a database driven dynamic website. This involves creating the initial pages and web forms in HTML, designing the database structure, and writing all of the appropriate server side scripts to handle data and manage the site's interactive features.

Learn More | Meet the Others