Announcement

Collapse
No announcement yet.

Compiling Source Code

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Compiling Source Code

    Am I correct in assuming that when a website offers source code for compiling that I would need to download a compiler from the repository. That is, a compiler is not available by default?

    I assume that when compiling for kubuntu that I would need only one compiler that is specific to kubuntu. Am I correct?

    Thanks
    kubuntu version: 16.04.5 LTS

    Laptop: Toshiba-Satellite-L350

    #2
    You will need a compiler, and various other tools, as well as all the system library development packages the thing to be compiled needs.

    The base tools in *buntu to compile are contained in the package build-essential, but depending on how the source code is set up, you will need more things.

    https://help.ubuntu.com/community/CompilingSoftware sort of gives an overview, but imo is both too simplified in spots yet too complex in others, as well as not at all how I remember it in others.

    Basically, there are 3 steps:

    configure the build - this tells it where to look for libraries, where the things built are to go, then runs a check looking to see if all the pieces it needs are present on your system. Which can be a *lot* of stuff if it is a gui program.

    Compile - builds things using the settings above

    Install -- puts the compiled binaries, help files, icons, etc etc in the correct places

    The difficult part is finding and installing all the missing bits and baubles needed, though, and hoping that the configure scripts are not assuming you have a thing needed, or doesn't look for some piece.

    It can be a simple as:
    ./configure --prefix=/usr (or something similar)
    make
    sudo make install (or checkinstall)

    But unless the README or some other file in the source archive (or a how-to on the web) tells you what -dev packages to install, you will be tracking down all the myriad missing pieces you need, which is not clear at all from the error messages ./configure will spit out.

    It may be a bit easier to tell us what you want to build, and then we can see what steps to take and things you need to build it, and if it will even build easily if it something old. Or if there is actually a deb package out there somewhere that may be working.

    Comment


      #3
      If you are compiling a new or special version of software in the repositories, a command that will greatly simplify things is
      sudo apt-get build-dep package-name

      Sometimes the package-name varies a bit, depending on the build you want. F.ex. I build my own vim and the command I needed (back then, it's a while ago now) was sudo apt-get build-dep vim-gtk.

      If it's not in the repositories, as Claydoh says, you have to some how find out all the libraries and development versions of stuff you need and ensure you've got them. Usually the developers document stuff, but if they're not using a Debian derived distro, it can be some work. Muon package manager or synaptic is your friend.
      Last edited by jlittle; Aug 30, 2015, 02:40 AM. Reason: add ref to Claydoh's post
      Regards, John Little

      Comment


        #4
        Originally posted by claydoh View Post
        You will need a compiler, and various other tools, as well as all the system library development packages the thing to be compiled needs.

        The base tools in *buntu to compile are contained in the package build-essential, but depending on how the source code is set up, you will need more things.

        https://help.ubuntu.com/community/CompilingSoftware sort of gives an overview, but imo is both too simplified in spots yet too complex in others, as well as not at all how I remember it in others.

        Basically, there are 3 steps:

        configure the build - this tells it where to look for libraries, where the things built are to go, then runs a check looking to see if all the pieces it needs are present on your system. Which can be a *lot* of stuff if it is a gui program.

        Compile - builds things using the settings above

        Install -- puts the compiled binaries, help files, icons, etc etc in the correct places

        The difficult part is finding and installing all the missing bits and baubles needed, though, and hoping that the configure scripts are not assuming you have a thing needed, or doesn't look for some piece.

        It can be a simple as:
        ./configure --prefix=/usr (or something similar)
        make
        sudo make install (or checkinstall)

        But unless the README or some other file in the source archive (or a how-to on the web) tells you what -dev packages to install, you will be tracking down all the myriad missing pieces you need, which is not clear at all from the error messages ./configure will spit out.

        It may be a bit easier to tell us what you want to build, and then we can see what steps to take and things you need to build it, and if it will even build easily if it something old. Or if there is actually a deb package out there somewhere that may be working.
        Thank you for the response.

        I was only thinking of compiling because I saw a file on the internet that had been compiled for some operating systems, and the author suggested that if a user wanted to use the file on another OS then they would need to compile the source code.

        Best wishes.
        kubuntu version: 16.04.5 LTS

        Laptop: Toshiba-Satellite-L350

        Comment

        Working...
        X