September 17th, 2003, 01:37 PM
|
#1 (permalink)
| | Member
Join Date: Sep 2003 Location: Calgary, Alberta
Posts: 324
|
Can anyone recommend where I can get help on learning to compile programs for Linux? Like when you download the source tarball and then need to compile it.
Thanks
__________________
AMD 64 3800+ Venice | GeIL 2GB PC3200 (4x512mb) | ASUS A8N-E | 8600GTS 256MB | Antec NeoPower 480 PSU Antec | SLK3000B case | Samsung 2168W LCD
|
| |
September 17th, 2003, 01:52 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,704
|
Usually you just
* download the tarball to a suitable directory,
* do: "tar zxvf filename.tgz" (if it's gzipped)
* go into the directory where the source was extracted
* type "./configure" this runs a script that configures the source for your system
* once finished type "make"
* and then when that's finished you can do "make install"
This is a quick and dirty method. I'm sure there are better ways but this has worked for me. Good Luck. |
| |
September 17th, 2003, 02:20 PM
|
#3 (permalink)
| | Member
Join Date: Sep 2003 Location: Calgary, Alberta
Posts: 324
|
Thanks for the reply. Does the configure script usually come with the source? Also, with Mandrake (the one I am currently using), what developer packages would or should I normally install?
I am no programmer, so please be patient  |
| |
September 17th, 2003, 04:08 PM
|
#4 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,704
|
Yes, the configure script is usually in the directory of the unpacked tarball.
If you installed the default developer packages you should be fine. I'm not a programmer eighter...  |
| |
September 17th, 2003, 04:51 PM
|
#5 (permalink)
| | Ultimate Member
Join Date: Oct 2002 Location: Scotland, UK
Posts: 3,221
|
The developer packages are required if you need to build stuff from source. If you're just installing RPMs and don't program, you don't need them (for the most part)
They contain stuff like headers and docs about the libraries and programs. I would normally install the dev packages for all libraries that I install, because I am a coder and it saves headaches when configure can't find a file it needs while building from a tarball. Quote: Originally posted by Agent_Embryo Usually you just
* download the tarball to a suitable directory,
* do: "tar zxvf filename.tgz" (if it's gzipped)
* go into the directory where the source was extracted
* type "./configure" this runs a script that configures the source for your system
* once finished type "make"
* and then when that's finished you can do "make install"
This is a quick and dirty method. I'm sure there are better ways but this has worked for me. Good Luck. | While this does work, I feel I should point a bit out about some points that you've missed.
to do "make install" you need to be root.
The configure script also takes command line arguments, so you select what features of the software you want to build. Do "./configure --help" for more info. The most used option is the --prefix= one. This says where to install the program to. Normally this defaults to /usr/local which is ok for some things, but others you need to set prefix to either /usr or even / depending on the program or library. Especially if you're upgrading an older one as /usr/local isn't always in everyones path, and the guidelines are a bit fuzzy as to why its there.
__________________
_____
NuKeS
|
| |
September 17th, 2003, 04:52 PM
|
#6 (permalink)
| | Member
Join Date: Sep 2003 Location: Calgary, Alberta
Posts: 324
|
Good stuff. I have noticed that some tarballs do not have configure scripts, just a makefile. What is done with those? |
| |
September 18th, 2003, 04:27 PM
|
#7 (permalink)
| | Ultimate Member
Join Date: Oct 2002 Location: Scotland, UK
Posts: 3,221
|
just "make"
Some will have a README/INSTALL file so have a look there, its always a good place to start 
You can view it with:
"less README"
or "less INSTALL"
press Q to exit the pager. |
| |
September 18th, 2003, 05:58 PM
|
#8 (permalink)
| | Member
Join Date: Sep 2003 Location: Calgary, Alberta
Posts: 324
|
I just compiled my first program...whoohoo 
Also used URPMI, that is so cool! Another neat program is CheckInstall. I have got the hang of this now, thanks again all. |
| |
September 18th, 2003, 09:46 PM
|
#9 (permalink)
| | Ultimate Member
Join Date: Dec 1969
Posts: 1,411
|
a lot of the time after you extract the program, the details on how to compile/install are in the file INSTALL or README. After downloading and extracting, you often just have to do less INSTALL or less README to see the installation instructions. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |