home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Linux and Unix
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Topic: 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...
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2621
Discussions: 186,615, Posts: 2,223,731, Members: 229,753
Old September 17th, 2003, 01:37 PM   Digg it!   #1 (permalink)
Member
 
athlonxpguy's Avatar
 
Join Date: Sep 2003
Location: Calgary, Alberta
Posts: 324
Blog Entries: 2
Howto

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

athlonxpguy is offline   Reply With Quote
Old September 17th, 2003, 01:52 PM     #2 (permalink)
Ultimate Member
 
Agent_Embryo's Avatar
 
Join Date: Oct 2001
Location: Sweden
Posts: 1,704
Send a message via ICQ to 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.
__________________
This is The SignatureŠ
www.ghostnail.com - my band.

Agent_Embryo is offline   Reply With Quote
Old September 17th, 2003, 02:20 PM     #3 (permalink)
Member
 
athlonxpguy's Avatar
 
Join Date: Sep 2003
Location: Calgary, Alberta
Posts: 324
Blog Entries: 2
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

athlonxpguy is offline   Reply With Quote
Old September 17th, 2003, 04:08 PM     #4 (permalink)
Ultimate Member
 
Agent_Embryo's Avatar
 
Join Date: Oct 2001
Location: Sweden
Posts: 1,704
Send a message via ICQ to Agent_Embryo
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...
Agent_Embryo is offline   Reply With Quote
Old September 17th, 2003, 04:51 PM     #5 (permalink)
Ultimate Member
 
nukes's Avatar
 
Join Date: Oct 2002
Location: Scotland, UK
Posts: 3,221
Send a message via AIM to nukes Send a message via Yahoo to nukes
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
nukes is offline   Reply With Quote
Old September 17th, 2003, 04:52 PM     #6 (permalink)
Member
 
athlonxpguy's Avatar
 
Join Date: Sep 2003
Location: Calgary, Alberta
Posts: 324
Blog Entries: 2
Good stuff. I have noticed that some tarballs do not have configure scripts, just a makefile. What is done with those?
athlonxpguy is offline   Reply With Quote
Old September 18th, 2003, 04:27 PM     #7 (permalink)
Ultimate Member
 
nukes's Avatar
 
Join Date: Oct 2002
Location: Scotland, UK
Posts: 3,221
Send a message via AIM to nukes Send a message via Yahoo to nukes
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.
nukes is offline   Reply With Quote
Old September 18th, 2003, 05:58 PM     #8 (permalink)
Member
 
athlonxpguy's Avatar
 
Join Date: Sep 2003
Location: Calgary, Alberta
Posts: 324
Blog Entries: 2
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.
athlonxpguy is offline   Reply With Quote
Old September 18th, 2003, 09:46 PM     #9 (permalink)
Ultimate Member
 
Lemon[H]ead's Avatar
 
Join Date: Dec 1969
Posts: 1,411
Send a message via AIM to Lemon[H]ead
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.
Lemon[H]ead is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
If you were watching someone commit.. (7)
Is It Just Me? (16899)
Suit forces eHarmony to offer gay d.. (48)
Super folding (14)
Popular Online Pc Retailers (12)
Folderchat Weekday thread (370)
Official World of Warcraft Thread!! (4505)
Wireless Connectivity (5)
PSU recommendation, think mines is .. (14)
Recent Discussions
what do you think of SEOBowl co.. (0)
New to the IT field and have a .. (25)
Asus p5wdh 4 gigs Corsaire xms2.. (5)
Problems with WoW wotlk FPS (0)
PC Wont Perform POST (2)
Folderchat Weekday thread (370)
How to create watermarks in gim.. (0)
Official World of Warcraft Thre.. (4505)
harddrive problem (2)
Various items for sale (1)
Woot-off (5)
9800GTX 512meg (8)


All times are GMT -4. The time now is 01:20 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28