Find the answer to your Linux question:
Results 1 to 8 of 8
I'm sure this has been asked before, but I didn't see anything to the effect of what I was looking for with the search function. I am new to Linux, ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    8

    Compiling help

    I'm sure this has been asked before, but I didn't see anything to the effect of what I was looking for with the search function. I am new to Linux, and have found that I need to compile software I want to use before I can install it or use it. To get to the point, I am totally in the dark about this. I know there's ways to optimize during compilation for your specific specs, (I am running a 64 bit processor) But basically, any help compiling would be great. At this point I really need hand holding, but I am usually pretty fast to pick it up if I can get a clear explanation of how it's done.

    Mod: Sorry if it seems like I am assaulting the board making so many threads but this is off-topic for my other thread.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Steve_F View Post
    I'm sure this has been asked before, but I didn't see anything to the effect of what I was looking for with the search function. I am new to Linux, and have found that I need to compile software I want to use before I can install it or use it.
    Not really. Most distros offer pre-packages software for many architectures (either for plain x86 or for x86_64/amd64 you shouldn't have any problem since are by far the two most widespread ones today).

    You shouldn't need to compile anything by hand unless you want to apply some custom patches to the software or you want to use an uncommon package that your distribution is not shipping in binary form.

    So, now comes the question: what makes you think that you need to (or why do you need to) compile something?

    To get to the point, I am totally in the dark about this. I know there's ways to optimize during compilation for your specific specs, (I am running a 64 bit processor) But basically, any help compiling would be great. At this point I really need hand holding, but I am usually pretty fast to pick it up if I can get a clear explanation of how it's done.

    Mod: Sorry if it seems like I am assaulting the board making so many threads but this is off-topic for my other thread.
    If you really want to compile everything from scratch (and not a single package or two), I suggest you to check these two:

    Gentoo Linux Documentation -- Gentoo Linux x86 Handbook
    Welcome to Linux From Scratch!

    The first is for the Gentoo handbook. Gentoo is a source distro (or better, meta-distro) where everything is compiled from scratch. It's what I use and advice always.

    LFS (Linux from scratch) is another meta-distro where you can do mostly the same that you do on Gentoo, but you have to take care of the dependencies and the updates yourself, which as a hobby is nice, but it's really not usable for everydays work unless it's to make the foundations for your own distro.

    In you really want to try either of these, you are going to have to read manuals (the Gentoo handbook is pretty detailed and all the installation is done by hand, and not via point&click).

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    8
    Well, I am on ubuntu if that help. In any case a few things have been only in the source code, while looking for various solutions to get the same programs I have in windows. But honestly I'd like to know, because i'd rather not be in the dark about it, when it seems so important.

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Steve_F View Post
    Well, I am on ubuntu if that help. In any case a few things have been only in the source code, while looking for various solutions to get the same programs I have in windows. But honestly I'd like to know, because i'd rather not be in the dark about it, when it seems so important.
    Well, it depends on the package. When you download the source (usually in a tarball, tar.bz2 or tar.gz format) you need to uncompress it. Once the contents has been uncompressed you should be able to find some kind of README or INSTALL file, or something in the lines (it really depends on the concrete package). The first thing you need to do when you download a source package is that: uncompress and search inside of it for documentation. If that fails, go to its home web and look for instructions on how to install it.




    The first and most elemental thing you need to compile a package is a compiler and some base libraries. That's usually gcc/g++ for software programmed in C, but it really depends on the package as well (some package will require python, perl or whatever instead). In ubuntu I think that you can install these basic things by installing a meta-package called "build-essentials" or something like that. Probably some ubuntu user around can be more concrete. I don't use ubuntu.

    Once you have that you might need some extra -devel packages, depending -again- on what do you want to compile. Once more, refer to the package documentation to know what its dependencies are.

    Once everything is ok most packages can be compiled by just doing this on the directory where you unpacked the sources:

    Code:
    ./configure && make && sudo make install
    Few notes:

    • These instructions mean nothing, read the documentation because each package is different. This is the most common case, but by no means the instructions I gave you are universal.
    • When you do install software this way the distribution is not aware that the software is on your system. This means that if you install a package via the ubuntu package manager and then you install the same via sources you ARE GOING to have problems for sure. These can be something as simple as your calculator not working or as cruel as your system being not able to boot if you overwrite an important system library. All kind of things can happen.
    • To avoid collisions with the native ubuntu package (and in the way avoid the problem I told you about in the previous point, I suggest using "./configure --prefix=/usr/local" instead of plain "./configure", that way everything you compile by hand will be installed into /usr/local, ubuntu shouldn't write anything there, so it's a way to avoid breakage due to collision.
    • Always save the source directory after installing, that way you can always go into there and type "make uninstall" to at least do a clean uninstall if you need.

  5. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    i'd recommend using checkinstall when installing packages from source, it at least lets you keep track of them in the package manager

  6. #6
    Just Joined!
    Join Date
    Apr 2009
    Posts
    78
    I have a related question: I'm using Ubuntu Jaunty and I recently compiled a program, but how I run it? When I go to the directory, there are "X" emblems and it says that I don't have permisson to access files, not do I know how to run it from command line. What do I do?

  7. #7
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    What program you have installed?, mostly after doing make install you can directly use the command.
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  8. #8
    Just Joined!
    Join Date
    Apr 2009
    Posts
    78
    I got it. Just had to read a bit further down the read-me file. I'm slowly but surely getting the hang of this stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...