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 06-23-2004, 02:55 AM   #1
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Rep: Reputation: 30
When compiling from source...


How do I know which directories the program install the files to? By checking the Makefile?
 
Old 06-23-2004, 03:45 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
In general:

1) An INSTALL and/or README file is included. Especially the INSTALL file is important, contains a lot of interesting stuff.

2) run ./configure --help

Gives you all the options and shows the default settings.
For directory and file placement look for: --prefix=, this option can be used to manipulate the place the program will be installed. It also has a default, which should be shown when running ./configure --help.

Hope this helps.
 
Old 06-23-2004, 04:09 AM   #3
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by druuna
In general:

1) An INSTALL and/or README file is included. Especially the INSTALL file is important, contains a lot of interesting stuff.

2) run ./configure --help

Gives you all the options and shows the default settings.
For directory and file placement look for: --prefix=, this option can be used to manipulate the place the program will be installed. It also has a default, which should be shown when running ./configure --help.

Hope this helps.
So the INSTALL file will contain the directories the files will be installed to?

Also, will the uninstall instruction be included in the INSTALL/README file as well?
 
Old 06-23-2004, 04:25 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
The INSTALL file will mention, most of the time, what the default install location will be. This is 'just' a textfile with information for you and is _not_ used during the actual configure/make/make check/make install process.

If you want to change the default install location you need to tell configure. Using the --prefix=<dir> will accomplish this. I.e:

./configure --prefix=/usr/local

Will force the target location to /usr/local/<name-prog>

After you run ./configure (with or without extra options) a newly created Makefile is present, which holds the parameters/settings that make (make install) needs. Path settings can be found in this file too. If at all possible, do not edit the Makefile file but give the options to ./configure and let configure generate the Makefile.

Not all (source)packages have an uninstall option. If they do it will be mentioned in either the INSTALL and/or README file. Most uninstall options do not check if other programs depend on the one you are about to uninstall.
 
Old 06-23-2004, 04:29 AM   #5
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by druuna
The INSTALL file will mention, most of the time, what the default install location will be. This is 'just' a textfile with information for you and is _not_ used during the actual configure/make/make check/make install process.

If you want to change the default install location you need to tell configure. Using the --prefix=<dir> will accomplish this. I.e:

./configure --prefix=/usr/local

Will force the target location to /usr/local/<name-prog>

After you run ./configure (with or without extra options) a newly created Makefile is present, which holds the parameters/settings that make (make install) needs. Path settings can be found in this file too. If at all possible, do not edit the Makefile file but give the options to ./configure and let configure generate the Makefile.

Not all (source)packages have an uninstall option. If they do it will be mentioned in either the INSTALL and/or README file. Most uninstall options do not check if other programs depend on the one you are about to uninstall.
So if a source package do not have a uninstall option. How do we uninstall the program?
 
Old 06-23-2004, 04:51 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
It's not always possible to remove all the files that belong to one package.........
Just blindly removing all the files that were created during install might be dangerous. Other packages (installed later) might depend on them.

You need to know where the files are placed. Sometimes a seperate directory structure is present for the package, deleting this directory (and all its subdirs) will do the trick.

But, some packages also put files in /etc (global configuration), ~/.<package> (local configuration), /lib etc etc.

Especially when libraries are installed you need to check (remember) if any packages installed afterwards need these. If this is the case it is sometimes sufficiant to leave the libs and remove the rest.
 
Old 06-23-2004, 06:43 AM   #7
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by druuna
It's not always possible to remove all the files that belong to one package.........
Just blindly removing all the files that were created during install might be dangerous. Other packages (installed later) might depend on them.
How about when the 1st time I installed it, but seems to have problem, I deleted the directory. Then I reinstall the same program again. Will it be installed nicely?

Cause currently, I think I have messed up my wine and samba. Thought of just deleting the directory, then reinstall it back again. Will the new install overwrite the previous one nicely?

The problem for samba is after I compile from source and installed, I typed samba at terminal, it say command not found. So I guessed I might not have installed it correctly.

Last edited by subaruwrx; 06-23-2004 at 07:02 AM.
 
Old 06-23-2004, 07:04 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
If it's a first time install you could do that.

Most problems arrise during the compile and/or make step. As long as you solve these before you run the 'make install' step there should be little to no need to reinstall (yes I know, sometimes you have to).

You might already know the following (simplefied) info, it's here just to make sure:

1) ./configure => create Makefile
2) make => compile
3) make check / make test => check if everything is well (optional, not always possible)

The above 3 steps take place in the sourcedir. No files are placed outside this dir (there are a few exceptions. But those exceptions create a seperate 'build' directory).

4) make install => place copiled files in appropriate location(s)
 
Old 06-23-2004, 07:54 AM   #9
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Original Poster
Rep: Reputation: 30
I kept hearing people saying installing from source better because you can configure what you want and don't want.

My question is, what, how and when exactly are we going to configure?

Thanks.
 
Old 06-23-2004, 08:59 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
These are the steps that I usually take:

1) tar xf dummy-1.0.tar (or bunzip2/gunzip etc)

2) cd dummy-1.0

3) Read the README file (and/or README.linux)

4) Read the INSTALL file

5) ./configure --help => Show all the options, write down(remember) the options you want to enable/disable (if any).

6) ./configure (--option1 --option2) => This step will create the Makefile. Check to see if anything went wrong/couldn't be found/wrong version etc. If so:
Fix problem, retry (yeah, I know that's a bit short. Too many different things could go wrong to give a short fix-compile-problem howto).

NOTE: If it takes a few tries to make the ./configure --option step work, be sure to run a 'fresh' /configure --option before you do the next (make) step. If you ran a few ./configure's with different settings, there's a chance that there are 'leftovers' from previous options hanging around. You want to make sure that your sourcetree is clean. There are a few ways to do this.

I like to be (too?) save and completely remove the sourcetree, re-unpack and run ./configure --option.

Running make clean is supposed to do a cleanup too.

7) make

8) make check (or make test) => not always available.

9) make install

Done.

Steps 3,4,5 and 6 are related to configuring. Steps 3,4 and 5 can give you info about what is possible (and what is not). Step 6 does the actual configuring (creates a file with all the options: Makefile).

It is not always necessary to supply options: A bare ./configure might be enough for the average needs. Good sources 'autodetect' a lot of the options. You can always run ./configure and check the output to see if all that you want/need is autodetected and also check to see if all dependencies are met. I often do (between steps 5 and 6).

The above answers the 'how' and 'when' questions.

The 'what' questions is kinda personal.
An understanding of what is installed on your system, what hardware is present etc makes the 'what' step a lot easier. For example: Why enable xinerama if you do have a capable graphics card (probably autodetected) but no second monitor (assumed, not detected).

I always check these and change them to my liking:
--prefix=PREFIX (--prefix=/usr/local)
--mandir=DIR (--mandir=/usr/share/man)

Hope this clears things up a bit.
 
Old 06-23-2004, 09:17 AM   #11
subaruwrx
Member
 
Registered: Mar 2004
Distribution: Ubuntu Feisty
Posts: 641

Original Poster
Rep: Reputation: 30
Thanks for the detail.

I suppose /use/share/man stores the man pages which are also available to the all the users right?
 
Old 06-23-2004, 09:21 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Yep. Manpages are sometimes placed in a subdir of the program installed. I like them in the 'default' location where 'all' manpages are.
 
  


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 07:32 AM
Compiling from source... (64) Blash Linux - Software 8 06-11-2005 12:31 AM
Compiling Source ripmaster Linux - Newbie 5 08-19-2004 01:02 AM
compiling software from source...how do i delete the folder w/ source? webazoid Linux - Software 2 07-01-2004 09:09 PM
Compiling Qt-3.2.1 from source Kroenecker Linux - Software 1 02-08-2004 07:45 AM


All times are GMT -5. The time now is 09:39 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