LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2005, 01:36 PM   #1
ben1337
LQ Newbie
 
Registered: Mar 2005
Location: Wales, UK
Distribution: debian
Posts: 2

Rep: Reputation: 0
compiling from source confusion


Hi all,

Im quite new to linux, i've got a working debian woody system installed and running, and i have been using the command line to do most of my installing and unpacking of stuff, because i wanted to get stuck into it, and its been really rewarding.

something that i'm still a bit confused about though is compiling stuff from source. If i do not want to wait for a package to come out for debian, is compiling from soure what I need to be thinking about? I still dont really know what limits what programs I can compile - should compiling enable me to install anything on my system or is it still dependent on the debian version i am using or other libraries I have installed?

thanks!
 
Old 03-23-2005, 01:43 PM   #2
Stealth870
Member
 
Registered: Dec 2004
Posts: 57

Rep: Reputation: 15
Compiling from source should be something like:

./configure
./make
./make install

And it will usually work, if you ahve all the dependencies, which building from source usually does not automatically get for you (compared to apt-get) so you gotta make sure you have all necessary files. The ./configure or ./make outputs will usually tell wehn something goes wrong.
 
Old 03-23-2005, 01:44 PM   #3
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Compiling from source is less dependent on the libraries you have installed. If you install a debian package it required that you have EXACTLY the same library version as the version the package was compiled against, for example it may require GTK+ 2.6.2

If you compile from source it may only require that you have AT LEAST a certain version of the library installed, for example that you have AT LEAST GTK+ 2.2.0.

The disadvantage (from your point of view) is that programs installed from source aren't recognised by the package manager and so can't be removed using the package manager. This is why I use slackware and therefore don't use the package manager, choosing to compile everything from source and being able to keep my libraries and programs on the cutting edge (Just upgraded KDE to 3.4 (not that I use KDE!) and X to 6.8.2)
 
Old 03-23-2005, 01:46 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by Stealth870
Compiling from source should be something like:

./configure
./make
./make install

And it will usually work, if you ahve all the dependencies, which building from source usually does not automatically get for you (compared to apt-get) so you gotta make sure you have all necessary files. The ./configure or ./make outputs will usually tell wehn something goes wrong.
That's wrong, it's not ./make or ./make install

./ means "run from the current directory" and is used in front of configure because it's a script distributed with the program and is therefore in the current directory (assuming you're in the directory created when you untar the program you're going to compile). Make is a program installed in /usr/bin and so it called without the dot slash.
'make install' is run as root to install the program globally so that everyone can use it (and so you don't have to clutter your home dir)
 
Old 03-23-2005, 10:08 PM   #5
Stealth870
Member
 
Registered: Dec 2004
Posts: 57

Rep: Reputation: 15
Oh my bad, thanks for clearing that up....I knew I was gonna mess up somewhere ^_^
 
Old 03-23-2005, 11:35 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
it's weird and i think there are no hard and fast rules
if you are good enough you can get almost anything to work
but sometimes because the debian system is kind of old you will have to move back to older versions of things or upgrade underlying system stuff.....
or install alternate compiler versions
or just plain hack at the source code
it's easier to port old stuff forward than it is to port new stuff backwards
and for porting old stuff forward you can find patches... on the web sometimes
never seen patches for porting backwards

generally libs add new functionality and sometimes change or remove old functionality
and apps either do use the new stuff on not.
but the big thing is the compiler
the gcc guys have been dragging us kicking and screeming toward a more standards compiant and name safe version of c/c++
this not only makes for binary incompatability between gcc versions but also a confusing level of source code incompatability as well.
also the rest of the tool chain changes create sometimes configuration incompatability.

it's a wonder we get any of it to work at all
 
Old 03-24-2005, 04:27 AM   #7
johntramp
Member
 
Registered: Sep 2003
Location: Christchurch, New Zealand
Distribution: Gentoo / Slackware
Posts: 72

Rep: Reputation: 15
there is usually an INSTALL file in the foobar.tar.gz of the source code. Read that it will explain how to install specifically for that file.
 
Old 03-24-2005, 10:27 AM   #8
ben1337
LQ Newbie
 
Registered: Mar 2005
Location: Wales, UK
Distribution: debian
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Komakino
Compiling from source is less dependent on the libraries you have installed. If you install a debian package it required that you have EXACTLY the same library version as the version the package was compiled against, for example it may require GTK+ 2.6.2

If you compile from source it may only require that you have AT LEAST a certain version of the library installed, for example that you have AT LEAST GTK+ 2.2.0.

The disadvantage (from your point of view) is that programs installed from source aren't recognised by the package manager and so can't be removed using the package manager. This is why I use slackware and therefore don't use the package manager, choosing to compile everything from source and being able to keep my libraries and programs on the cutting edge (Just upgraded KDE to 3.4 (not that I use KDE!) and X to 6.8.2)

yeah I actually started downloading the slackware 10.1 iso files because now i've actually got linux running on my system, I want to take it further and do everything i can on my windows pc, with my linux one, so yeah I want an up to date system rather than out of date debian woody installation. I was doing the ./configure and getting loads of error messages about missing things, and i assume that this is because i don't have the up to date versions of dependencies etc.

thanks for the help
 
Old 03-24-2005, 10:51 AM   #9
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
The first package you'll want to install once you have slackware installed is checkinstall. Then you can compile something from source, but install it as a package, so that pkgtool can still seen it and remove it. There are some very helpful howtos and such at the top of the Slackware Forum.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling apt from source - where's the source? stynhx9000 Ubuntu 2 12-01-2005 08:32 AM
compiling software from source...how do i delete the folder w/ source? webazoid Linux - Software 2 07-01-2004 10:09 PM
Swaret/Pkgtool confusion and a source compile query dos1 Slackware 3 10-21-2003 07:51 AM
kernel confusion -- which source for 2.4.18-bf2.4 graybeard Linux - Distributions 1 02-17-2003 07:34 PM
Compiling from Source dguy Linux - Newbie 6 05-27-2002 12:48 PM


All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration