LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices

Reply
 
Search this Thread
Old 07-09-2003, 08:25 PM   #1
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 10,356

Rep: Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616Reputation: 2616
Post DISCUSSION: Compiling Programs from Source


This thread is to discuss the article titled: Compiling Programs from Source
 
Old 07-13-2003, 10:19 AM   #2
Vlad_M
Member
 
Registered: Aug 2002
Location: Cape Town, South Africa
Distribution: Red Hat 8.0 (Home), Red Hat 8.0 (Work)
Posts: 388

Rep: Reputation: 30
A most helpful article, however I would really like to see an article on how to compile on any RH version, since they seem to make it their mission to create a distro where compiling anything is impossible.
 
Old 07-13-2003, 10:33 AM   #3
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64


The trick to compiling on ANY distro is to have the development packages installed, this would be things like GCC, make, binutils... The reason RH and some of the other RPM based distros tend to leave these out is because they provide RPMs and would expect you to use those RPM's provided. It's just a different way of thought. They still do provide the GCC et al tools, you just have to install them yourself, or rather, knowingly install them.

That's where the trick comes in

Cool
 
Old 07-15-2003, 02:27 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,655

Rep: Reputation: Disabled
Just two brief remarks:

Code:
tar zxf linuxquestions.tar.gz
...
shouldn't that be tar -zxf linuxquestions.tar.gz, i.e. the minus before the options is missing? Or isn't it necessary here?

And secondly, after a long time of experiments I found out, that some programs expect to be placed in special places in the directory tree. Then one has to specify e.g.

Code:
./configure --prefix=/opt/kde3
...
to get the executable (?) placed correctly (in this case in /opt/kde3). See also this thread ./configure - make - make install can't work ?!?.

P.S.: Why don't I get those nice lines before and after "code"?

Hehe, now it works. Nice.

Last edited by JZL240I-U; 07-15-2003 at 04:54 AM.
 
Old 07-15-2003, 04:46 AM   #5
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Use the [ code ] brackets without the space

And no the - isn't necessary.

Cool
 
Old 07-15-2003, 04:52 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,655

Rep: Reputation: Disabled
Quote:
Originally posted by MasterC
Use the [ code ] brackets without the space
I copied from the original article via CTRL-C / CRTL-V ...
Quote:
Test
Aha.
 
Old 07-15-2003, 05:01 PM   #7
mlstevenson
LQ Newbie
 
Registered: Jul 2003
Location: Houston, Tx
Distribution: RedHat 7.3
Posts: 3

Rep: Reputation: 0
./configure and de-installation

I found your article informative. But, I don't understand how to remove a program, how to uninstall it when it is no longer wanted.
 
Old 07-16-2003, 01:06 AM   #8
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
That's the tricky part as with source there is no "set" way. You can look into a program called checkinstall:
http://checkinstall.izto.org

This is probably considered as close as it gets to "make uninstall". Which brings me to my next point:
make uninstall
This is sometimes an option that the programmers will put into the Makefile. If they do, lucky you, all you have to do is type that when you are ready to remove the program and you are done.

The main reason for sources not having a universal way of being removed is that during the make install process they are simply copied over to the necessary locations. If the developer didn't write a make uninstall to rm everything from those locations, there is no way for your system to track them (without something like checkinstall).

Other options are available for things like this, check the LFS forum on this board for more info.



Cool
 
Old 07-16-2003, 02:10 AM   #9
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
I hope I don't say anything so harshly that it offends, it's not meant to.
I ASSume that this is geared toward people who have never installed from source, so I'm critiquing it as such.

Quote:
Once downloaded you want to do the following:

Code:
tar zxf linuxquestions.tar.gz
cd linuxquestions
./configure
.
.
I disagree with the ordering.
The first thing you want to do is read the README (or equivalent) file and learn what special needs this program has (libs, make arguments, env vars, maybe it doesn't use autoconf, etc.). I guess this would be the second thing, after untaring the package.
The next thing you want to do is follow the instructions in the README on how to build the package. While autoconf is quite popular, it's not the only way to build and distribute a source package.
In the HOW-TO, the note about the README and INSTALL files seems a little lost. Basically, I think that needs to be more obvious and expanded upon.

After reading the README, ./configure --help should be, in my opinion, run. Again, this is mentioned in the HOW-TO, but most READMEs don't actually say much about all the possible options, and the best way to see what you have available to you is via configure (if that's even available).
The user should learn as much as possible about the package they are installing before they jump in and start dealing with error messages because, "bash: ./configure: No such file or directory".

Non-uid0 users can't usually write to /usr/local/src, so maybe you should recommend a "sandbox/src" directory under their home dir for downloading and building packages. Or, one would have to change permissions on /usr/local/src. I have both a ~/sandbox and a /opt/src directory available to normal users. /opt/src is for global packages, and ~/sanbox is my personal playground. Non root can write to /opt/src, of course.

Maybe mention that ./configure --with-blah can enable option blah that wouldn't otherwise be enabled.

You might also consider recommending checking MD5 sums if they exist. This will help to bypass any problems with long downloads, noisy lines, cracked hosts, etc.

Just a few of my comments, I'm sure I could come up with more. . . I like it so far, but it does need work--it's always great to have a start.
 
1 members found this post helpful.
Old 07-18-2003, 04:34 PM   #10
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
be carefull with "make uninstall"

If it is improperly made it can delete a lot of files you need.
There is on such program I have seen.
I believe it was an issue with one of the sources used in LFS 3.?
 
Old 07-29-2003, 07:03 AM   #11
asktoby
Member
 
Registered: Jul 2003
Location: Cardiff, England ;)
Distribution: Mandrake 9.1
Posts: 94

Rep: Reputation: 15
=====
Great article. Left me with a few questions though:

I have been untar-ing my source files in random directories inside my Documents folder and compiling from there, rather than using /usr/local/src. Apart from being a little messy, is there any harm in doing that?

Once the (./configure, make, make install) process is complete and the app is working correctly, can you safely delete the source files?

Is there any need to close all open apps before installing?

Is there any need to re-boot after installing?

Must you install as root or can you install as anyone?
 
Old 07-29-2003, 07:08 AM   #12
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Just a guess, but are you coming from a windoze background

It's a good habit to get into to untar your files in a central location, just for ease of locating them and keeping the system tidy, but with my experience I've not had a problem untarring files anywhere I can and using it from that location to do the rest of the work to get it installed. Just choice.

Yes, removing the source to save space is a great way to gain back a few hundred MB sometimes. However should you need to uninstall the program, it's usually a good idea to at least keep the tarball handy.

No, you don't normally need to close all open applications You might consider doing that on MAJOR upgrades of important system files, but as a rule, no. If you are upgrading an open package and you can shut it down, it's probably a good idea to.

Re-booting is a thing of the past my friend. I install applications constantly on my server, yet I have an uptime of over 50 days (and that's really low). No, there is usually no need, the only exception might be the kernel and there are those who have said they don't even need to when they do that.

You don't have to be root, however you will need root privileges. Search the board and read up on 'sudo'. It's using a user, given certain permissions, to do things that root would normally do.

HTH

Cool
 
Old 07-29-2003, 07:10 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
ok i'll "bite"...

1) no it's ok, but very messy. there are real benefits from using a standard location though.

2) you can, yes, but you would be advised to leave it there if you wished to uninstall it. jsut go back to that directory and run "make uninstall" and the application will be removed normally. (this is a per program basis though and not controlled in any way). to reduce spoace you can run "make clean" to delete the temporary compiled data in that directory if you wish.

3) nope

4) nope, unless it's a really core piece of software like glibc (which you really don't want to go near)

5) installing as you will mean you can only install it in places you have access to. on a very large nertworked system people may install their own software to /home/user/bin or a similar location they create themselves. this alternative location would be specified at ./configure time. e.g. ./configure --prerfix=/home/user/bin. it's best to configure and make as non root for mild security benefits, but actually installing them in /usr/bin or such like will require full rioghts to those locations, which *only* root should ever have.
 
Old 07-29-2003, 08:10 AM   #14
asktoby
Member
 
Registered: Jul 2003
Location: Cardiff, England ;)
Distribution: Mandrake 9.1
Posts: 94

Rep: Reputation: 15
>>Just a guess, but are you coming from a windoze background

hehe, it's obvious isn't it? I'm about 1 month into Mandrake after 10 years of Microsoft. :-/

I'm happy to forget rebooting - it takes a very long time! I still find myself logging in/out to swap between root and user very regularly, I'll look into this "sudo" thing to save time there.
 
Old 07-29-2003, 08:17 AM   #15
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
Quote:
Originally posted by asktoby
I still find myself logging in/out to swap between root and user very regularly, I'll look into this "sudo" thing to save time there.
As long as you remember how important the root user autally is and how you shouldn't be messin' with him when you don't need to.
 
  


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 programs from source Frank Leone Linux - Newbie 3 10-30-2005 01:47 AM
why is compiling source programs under linux such a headache? guy24x Linux - Software 21 07-28-2005 06:04 AM
Compiling Programs from Source-help orisma Linux - Newbie 6 03-03-2005 07:57 AM
Compiling programs from source rpms coolfrog Linux - General 1 09-10-2004 03:17 PM
Compiling programs from source in Mandrake 10 AMD64 RC1 hydroxy Linux - Software 7 05-12-2004 03:55 PM


All times are GMT -5. The time now is 03:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration