| LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
07-09-2003, 08:25 PM
|
#1
|
root 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 9,514
|
DISCUSSION: Compiling Programs from Source
This thread is to discuss the article titled: Compiling Programs from Source
|
|
|
|
07-13-2003, 10:19 AM
|
#2
|
|
Member
Registered: Aug 2002
Location: Cape Town, South Africa
Distribution: Red Hat 8.0 (Home), Red Hat 8.0 (Work)
Posts: 388
Rep:
|
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.
|
|
|
|
07-13-2003, 10:33 AM
|
#3
|
|
Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,611
Rep:
|
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
|
|
|
|
07-15-2003, 02:27 AM
|
#4
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
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.
|
|
|
|
07-15-2003, 04:46 AM
|
#5
|
|
Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,611
Rep:
|
Use the [ code ] brackets without the space
And no the - isn't necessary.
Cool
|
|
|
|
07-15-2003, 04:52 AM
|
#6
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
Quote:
Originally posted by MasterC
Use the [ code ] brackets without the space 
|
I copied from the original article via CTRL-C / CRTL-V ...
Aha.

|
|
|
|
07-15-2003, 05:01 PM
|
#7
|
|
LQ Newbie
Registered: Jul 2003
Location: Houston, Tx
Distribution: RedHat 7.3
Posts: 3
Rep:
|
./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.
|
|
|
|
07-16-2003, 01:06 AM
|
#8
|
|
Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,611
Rep:
|
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
|
|
|
|
07-16-2003, 02:10 AM
|
#9
|
|
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
|
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.
|
07-18-2003, 04:34 PM
|
#10
|
|
Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154
Rep:
|
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.?
|
|
|
|
07-29-2003, 07:03 AM
|
#11
|
|
Member
Registered: Jul 2003
Location: Cardiff, England ;)
Distribution: Mandrake 9.1
Posts: 94
Rep:
|
=====
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?
|
|
|
|
07-29-2003, 07:08 AM
|
#12
|
|
Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,611
Rep:
|
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
|
|
|
|
07-29-2003, 07:10 AM
|
#13
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,676
|
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.
|
|
|
|
07-29-2003, 08:10 AM
|
#14
|
|
Member
Registered: Jul 2003
Location: Cardiff, England ;)
Distribution: Mandrake 9.1
Posts: 94
Rep:
|
>>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.
|
|
|
|
07-29-2003, 08:17 AM
|
#15
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,676
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:18 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|