LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compiling from source confusion (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-from-source-confusion-305129/)

ben1337 03-23-2005 12:36 PM

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!

Stealth870 03-23-2005 12:43 PM

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.

Komakino 03-23-2005 12:44 PM

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)

Komakino 03-23-2005 12:46 PM

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)

Stealth870 03-23-2005 09:08 PM

Oh my bad, thanks for clearing that up....I knew I was gonna mess up somewhere ^_^

foo_bar_foo 03-23-2005 10:35 PM

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

johntramp 03-24-2005 03:27 AM

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.

ben1337 03-24-2005 09:27 AM

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

Itzac 03-24-2005 09:51 AM

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.


All times are GMT -5. The time now is 10:54 PM.