LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How does one compile a program? What do you need? (https://www.linuxquestions.org/questions/linux-newbie-8/how-does-one-compile-a-program-what-do-you-need-156170/)

TheMusicGuy 03-11-2004 02:14 AM

How does one compile a program? What do you need?
 
Yeah, I'm STILL new to Linux, and I STILL don't know how to do a library of things.
I've noticed that almost all the software I download states that it must be compiled, and it gives me strange instructions.
How do I do that, and why can't I just get these programs already compiled?

slakmagik 03-11-2004 02:24 AM

If you're using SuSE, you generally can - you want rpms (packages ending in .rpm) built for SuSE. To compile you need gcc and host of other applications that may not be installed by default with SuSE (not familiar with SuSE). Then, since you've read the instructions, you just follow them. Ideally, with standard tarballs (*.tar.gz, *.tar.bz2, and so on), it's

./configure (check out what's where on your system)
make (translate the source code to binaries)
make install (put the stuff where it belongs)

There's a guide on compiling somewhere around here but I haven't been able to find it lately. If you find it, it'll go into details.

jschiwal 03-11-2004 04:17 AM

You will need to su to root just before you do the 'make install' step. Most programs will install the binary in either /usr/bin or /usr/local/bin. There may be library files installed in /usr/lib also. To write to these directories, you have to be the root user.

slakmagik 03-11-2004 05:04 AM

Yeah, thanks for catching that. With root stuff I tend to think of 'su' as understood, but it's not 'understood' if you don't know it. :)

If you install something to a directory you do have write permission to, say ~/bin, after compiling with the --prefix flag, you won't need to su but that's not usual procedure. Like jschiwal says, mostly its system directories and you won't have permission to those.

TheMusicGuy 03-12-2004 01:10 AM

Thank you


All times are GMT -5. The time now is 12:04 PM.